diff --git a/.env.test b/.env.test index 535d37a9e0..09881648aa 100644 --- a/.env.test +++ b/.env.test @@ -14,3 +14,4 @@ SITE_URL="test.host" OPENID_APP_ID="test-provider" OPENID_APP_SECRET="12345" +OPENID_REFRESH_TOKEN="dummy-refresh-token" diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3cf3963ad1..52ce24cee9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,3 +1,8 @@ +# Dependabot configuration +# +# The `directory` and `schedule.interval` options are mandatory. +# Most of the configuration here is not used for security updates though. + version: 2 updates: @@ -5,7 +10,7 @@ updates: directory: "/" schedule: interval: "daily" - open-pull-requests-limit: 10 + # Only specific requirements are specified in Gemfile, so don't touch it. versioning-strategy: lockfile-only @@ -13,5 +18,6 @@ updates: directory: "/" schedule: interval: "daily" + # All versions are specified in package.json, so please update them. versioning-strategy: increase diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 31f95933d4..b1f9326fef 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -7,10 +7,11 @@ jobs: name: runner / rubocop runs-on: ubuntu-latest steps: - - name: Check out code - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true # runs 'bundle install' and caches installed gems automatically - run: git show --no-patch # the commit being tested (which is often a merge due to actions/checkout@v3) @@ -21,6 +22,8 @@ jobs: rubocop_extensions: rubocop-rails:gemfile rubocop-rspec:gemfile reporter: github-pr-check level: error + filter_mode: nofilter + use_bundler: true fail_on_error: true prettier: name: runner / prettier diff --git a/.rubocop_rspec_styleguide.yml b/.rubocop_rspec_styleguide.yml index 5dba6ea202..aef9fa3ba8 100644 --- a/.rubocop_rspec_styleguide.yml +++ b/.rubocop_rspec_styleguide.yml @@ -10,12 +10,15 @@ RSpec: FactoryBot: Enabled: false +# Enabled rules + +Capybara/NegationMatcher: + Enabled: true + EnforcedStyle: not_to + RSpec/ExpectChange: Enabled: true EnforcedStyle: block -RSpec/MultipleExpectations: - Max: 5 # Default 1 - -RSpec/MultipleMemoizedHelpers: - Max: 10 # Default 5 +RSpec/NotToNot: + Enabled: true diff --git a/.rubocop_styleguide.yml b/.rubocop_styleguide.yml index 0264a99261..81d1018a6b 100644 --- a/.rubocop_styleguide.yml +++ b/.rubocop_styleguide.yml @@ -3,7 +3,6 @@ # These are the rules we agreed upon and we work towards. AllCops: NewCops: enable - SuggestExtensions: false Exclude: - bin/**/* - db/**/* @@ -125,6 +124,9 @@ Rails/SkipsModelValidations: - update_column - update_columns +Rails/WhereExists: + EnforcedStyle: where # Cf. conversion https://github.com/openfoodfoundation/openfoodnetwork/pull/12363 + Style/Documentation: Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 80d792d884..8ed82cc4a7 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,50 +1,17 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 1400 --no-auto-gen-timestamp` -# using RuboCop version 1.60.2. +# using RuboCop version 1.62.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 16 -# Configuration parameters: AllowedMethods. -# AllowedMethods: enums -Lint/ConstantDefinitionInBlock: - Exclude: - - 'lib/tasks/import_product_images.rake' - - 'lib/tasks/users.rake' - - 'spec/controllers/spree/admin/base_controller_spec.rb' - - 'spec/helpers/serializer_helper_spec.rb' - - 'spec/lib/reports/line_items_spec.rb' - - 'spec/models/spree/ability_spec.rb' - - 'spec/models/spree/gateway_spec.rb' - - 'spec/models/spree/preferences/configuration_spec.rb' - - 'spec/models/spree/preferences/preferable_spec.rb' - - 'spec/validators/date_time_string_validator_spec.rb' - - 'spec/validators/integer_array_validator_spec.rb' - -# Offense count: 6 -# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches. -Lint/DuplicateBranch: - Exclude: - - 'app/helpers/spree/admin/base_helper.rb' - - 'app/models/enterprise.rb' - - 'app/models/spree/calculator.rb' - - 'app/models/spree/preference.rb' - - 'app/models/spree/preferences/preferable.rb' - # Offense count: 2 Lint/DuplicateMethods: Exclude: - 'lib/discourse/single_sign_on.rb' -# Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -Lint/DuplicateRequire: - Exclude: - - 'spec/lib/open_food_network/scope_variants_to_search_spec.rb' - -# Offense count: 18 +# Offense count: 16 # Configuration parameters: AllowComments, AllowEmptyLambdas. Lint/EmptyBlock: Exclude: @@ -113,6 +80,7 @@ Lint/SelfAssignment: # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AutoCorrect. Lint/UselessMethodDefinition: Exclude: - 'app/models/spree/gateway.rb' @@ -141,7 +109,7 @@ Metrics/AbcSize: - 'lib/open_food_network/order_cycle_permissions.rb' - 'lib/spree/core/controller_helpers/order.rb' - 'lib/tasks/enterprises.rake' - - 'spec/services/order_checkout_restart_spec.rb' + - 'spec/services/orders/checkout_restart_service_spec.rb' # Offense count: 9 # Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode. @@ -200,8 +168,8 @@ Metrics/ClassLength: - 'app/serializers/api/cached_enterprise_serializer.rb' - 'app/serializers/api/enterprise_shopfront_serializer.rb' - 'app/services/cart_service.rb' - - 'app/services/order_cycle_form.rb' - - 'app/services/order_syncer.rb' + - 'app/services/order_cycles/form_service.rb' + - 'app/services/orders/sync_service.rb' - 'engines/order_management/app/services/order_management/order/updater.rb' - 'lib/open_food_network/enterprise_fee_calculator.rb' - 'lib/open_food_network/order_cycle_form_applicator.rb' @@ -389,20 +357,213 @@ Naming/VariableNumber: - 'spec/models/spree/tax_rate_spec.rb' - 'spec/requests/api/orders_spec.rb' -# Offense count: 11 +# Offense count: 142 # This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: AllowedMethods, AllowedPatterns. -# AllowedMethods: order, limit, select, lock -Rails/FindEach: +# Configuration parameters: ResponseMethods. +# ResponseMethods: response, last_response +RSpecRails/HaveHttpStatus: Exclude: - - 'app/controllers/admin/order_cycles_controller.rb' - - 'app/jobs/subscription_confirm_job.rb' - - 'app/services/orders_bulk_cancel_service.rb' - - 'app/services/products_renderer.rb' - - 'lib/tasks/data.rake' - - 'lib/tasks/subscriptions/debug.rake' - - 'spec/system/admin/bulk_order_management_spec.rb' - - 'spec/system/admin/enterprise_relationships_spec.rb' + - 'spec/controllers/admin/bulk_line_items_controller_spec.rb' + - 'spec/controllers/admin/order_cycles_controller_spec.rb' + - 'spec/controllers/admin/subscriptions_controller_spec.rb' + - 'spec/controllers/api/v0/base_controller_spec.rb' + - 'spec/controllers/api/v0/customers_controller_spec.rb' + - 'spec/controllers/api/v0/enterprises_controller_spec.rb' + - 'spec/controllers/api/v0/logos_controller_spec.rb' + - 'spec/controllers/api/v0/order_cycles_controller_spec.rb' + - 'spec/controllers/api/v0/orders_controller_spec.rb' + - 'spec/controllers/api/v0/product_images_controller_spec.rb' + - 'spec/controllers/api/v0/products_controller_spec.rb' + - 'spec/controllers/api/v0/promo_images_controller_spec.rb' + - 'spec/controllers/api/v0/reports/packing_report_spec.rb' + - 'spec/controllers/api/v0/reports_controller_spec.rb' + - 'spec/controllers/api/v0/shipments_controller_spec.rb' + - 'spec/controllers/api/v0/statuses_controller_spec.rb' + - 'spec/controllers/api/v0/taxons_controller_spec.rb' + - 'spec/controllers/api/v0/terms_and_conditions_controller_spec.rb' + - 'spec/controllers/api/v0/variants_controller_spec.rb' + - 'spec/controllers/cart_controller_spec.rb' + - 'spec/controllers/checkout_controller_spec.rb' + - 'spec/controllers/enterprises_controller_spec.rb' + - 'spec/controllers/line_items_controller_spec.rb' + - 'spec/controllers/shop_controller_spec.rb' + - 'spec/controllers/spree/admin/orders/payments/payments_controller_spec.rb' + - 'spec/controllers/spree/admin/orders_controller_spec.rb' + - 'spec/controllers/spree/admin/products_controller_spec.rb' + - 'spec/controllers/spree/credit_cards_controller_spec.rb' + - 'spec/controllers/spree/orders_controller_spec.rb' + - 'spec/controllers/stripe/callbacks_controller_spec.rb' + - 'spec/controllers/stripe/webhooks_controller_spec.rb' + - 'spec/controllers/user_passwords_controller_spec.rb' + - 'spec/controllers/user_registrations_controller_spec.rb' + - 'spec/requests/admin/images_spec.rb' + - 'spec/requests/api/routes_spec.rb' + - 'spec/requests/checkout/failed_checkout_spec.rb' + - 'spec/requests/checkout/stripe_sca_spec.rb' + - 'spec/requests/home_controller_spec.rb' + - 'spec/requests/omniauth_callbacks_controller_spec.rb' + - 'spec/services/embedded_page_service_spec.rb' + - 'spec/support/api_helper.rb' + +# Offense count: 8 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: numeric, symbolic, be_status +RSpecRails/HttpStatus: + Exclude: + - 'spec/controllers/spree/admin/products_controller_spec.rb' + - 'spec/requests/api/orders_spec.rb' + +# Offense count: 146 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Inferences. +RSpecRails/InferredSpecType: + Exclude: + - 'engines/dfc_provider/spec/requests/addresses_spec.rb' + - 'engines/dfc_provider/spec/requests/catalog_items_spec.rb' + - 'engines/dfc_provider/spec/requests/enterprise_groups/affiliated_by_spec.rb' + - 'engines/dfc_provider/spec/requests/enterprise_groups_spec.rb' + - 'engines/dfc_provider/spec/requests/enterprises_spec.rb' + - 'engines/dfc_provider/spec/requests/offers_spec.rb' + - 'engines/dfc_provider/spec/requests/persons_spec.rb' + - 'engines/dfc_provider/spec/requests/social_medias_spec.rb' + - 'engines/dfc_provider/spec/requests/supplied_products_spec.rb' + - 'engines/web/spec/helpers/cookies_policy_helper_spec.rb' + - 'spec/controllers/admin/bulk_line_items_controller_spec.rb' + - 'spec/controllers/admin/column_preferences_controller_spec.rb' + - 'spec/controllers/admin/customers_controller_spec.rb' + - 'spec/controllers/admin/enterprises_controller_spec.rb' + - 'spec/controllers/admin/inventory_items_controller_spec.rb' + - 'spec/controllers/admin/invoice_settings_controller_spec.rb' + - 'spec/controllers/admin/matomo_settings_controller_spec.rb' + - 'spec/controllers/admin/order_cycles_controller_spec.rb' + - 'spec/controllers/admin/product_import_controller_spec.rb' + - 'spec/controllers/admin/proxy_orders_controller_spec.rb' + - 'spec/controllers/admin/reports_controller_spec.rb' + - 'spec/controllers/admin/schedules_controller_spec.rb' + - 'spec/controllers/admin/stripe_accounts_controller_spec.rb' + - 'spec/controllers/admin/stripe_connect_settings_controller_spec.rb' + - 'spec/controllers/admin/subscription_line_items_controller_spec.rb' + - 'spec/controllers/admin/subscriptions_controller_spec.rb' + - 'spec/controllers/admin/tag_rules_controller_spec.rb' + - 'spec/controllers/admin/terms_of_service_files_controller_spec.rb' + - 'spec/controllers/admin/variant_overrides_controller_spec.rb' + - 'spec/controllers/api/v0/customers_controller_spec.rb' + - 'spec/controllers/api/v0/enterprise_fees_controller_spec.rb' + - 'spec/controllers/api/v0/enterprises_controller_spec.rb' + - 'spec/controllers/api/v0/exchange_products_controller_spec.rb' + - 'spec/controllers/api/v0/logos_controller_spec.rb' + - 'spec/controllers/api/v0/order_cycles_controller_spec.rb' + - 'spec/controllers/api/v0/orders_controller_spec.rb' + - 'spec/controllers/api/v0/product_images_controller_spec.rb' + - 'spec/controllers/api/v0/products_controller_spec.rb' + - 'spec/controllers/api/v0/promo_images_controller_spec.rb' + - 'spec/controllers/api/v0/reports/packing_report_spec.rb' + - 'spec/controllers/api/v0/reports_controller_spec.rb' + - 'spec/controllers/api/v0/shipments_controller_spec.rb' + - 'spec/controllers/api/v0/shops_controller_spec.rb' + - 'spec/controllers/api/v0/statuses_controller_spec.rb' + - 'spec/controllers/api/v0/terms_and_conditions_controller_spec.rb' + - 'spec/controllers/api/v0/variants_controller_spec.rb' + - 'spec/controllers/base_controller_spec.rb' + - 'spec/controllers/cart_controller_spec.rb' + - 'spec/controllers/checkout_controller_spec.rb' + - 'spec/controllers/enterprises_controller_spec.rb' + - 'spec/controllers/groups_controller_spec.rb' + - 'spec/controllers/line_items_controller_spec.rb' + - 'spec/controllers/payment_gateways/paypal_controller_spec.rb' + - 'spec/controllers/payment_gateways/stripe_controller_spec.rb' + - 'spec/controllers/registration_controller_spec.rb' + - 'spec/controllers/shop_controller_spec.rb' + - 'spec/controllers/shops_controller_spec.rb' + - 'spec/controllers/spree/admin/adjustments_controller_spec.rb' + - 'spec/controllers/spree/admin/base_controller_spec.rb' + - 'spec/controllers/spree/admin/countries_controller_spec.rb' + - 'spec/controllers/spree/admin/general_settings_controller_spec.rb' + - 'spec/controllers/spree/admin/orders/customer_details_controller_spec.rb' + - 'spec/controllers/spree/admin/orders/invoices_spec.rb' + - 'spec/controllers/spree/admin/orders/payments/payments_controller_refunds_spec.rb' + - 'spec/controllers/spree/admin/orders/payments/payments_controller_spec.rb' + - 'spec/controllers/spree/admin/orders_controller_spec.rb' + - 'spec/controllers/spree/admin/overview_controller_spec.rb' + - 'spec/controllers/spree/admin/payment_methods_controller_spec.rb' + - 'spec/controllers/spree/admin/products_controller_spec.rb' + - 'spec/controllers/spree/admin/return_authorizations_controller_spec.rb' + - 'spec/controllers/spree/admin/search_controller_spec.rb' + - 'spec/controllers/spree/admin/shipping_categories_controller_spec.rb' + - 'spec/controllers/spree/admin/shipping_methods_controller_spec.rb' + - 'spec/controllers/spree/admin/tax_rates_controller_spec.rb' + - 'spec/controllers/spree/admin/tax_settings_controller_spec.rb' + - 'spec/controllers/spree/admin/variants_controller_spec.rb' + - 'spec/controllers/spree/api_keys_controller_spec.rb' + - 'spec/controllers/spree/credit_cards_controller_spec.rb' + - 'spec/controllers/spree/orders_controller_spec.rb' + - 'spec/controllers/spree/user_sessions_controller_spec.rb' + - 'spec/controllers/spree/users_controller_spec.rb' + - 'spec/controllers/stripe/callbacks_controller_spec.rb' + - 'spec/controllers/stripe/webhooks_controller_spec.rb' + - 'spec/controllers/user_confirmations_controller_spec.rb' + - 'spec/controllers/user_passwords_controller_spec.rb' + - 'spec/controllers/user_registrations_controller_spec.rb' + - 'spec/controllers/webhook_endpoints_controller_spec.rb' + - 'spec/helpers/admin/enterprises_helper_spec.rb' + - 'spec/helpers/admin/orders_helper_spec.rb' + - 'spec/helpers/admin/reports_helper_spec.rb' + - 'spec/helpers/admin/subscriptions_helper_spec.rb' + - 'spec/helpers/application_helper_spec.rb' + - 'spec/helpers/checkout_helper_spec.rb' + - 'spec/helpers/i18n_helper_spec.rb' + - 'spec/helpers/injection_helper_spec.rb' + - 'spec/helpers/link_helper_spec.rb' + - 'spec/helpers/navigation_helper_spec.rb' + - 'spec/helpers/order_cycles_helper_spec.rb' + - 'spec/helpers/serializer_helper_spec.rb' + - 'spec/helpers/shared_helper_spec.rb' + - 'spec/helpers/shop_helper_spec.rb' + - 'spec/helpers/spree/admin/base_helper_spec.rb' + - 'spec/helpers/spree/admin/general_settings_helper_spec.rb' + - 'spec/helpers/spree/admin/orders_helper_spec.rb' + - 'spec/helpers/spree/orders_helper_spec.rb' + - 'spec/helpers/tax_helper_spec.rb' + - 'spec/helpers/terms_and_conditions_helper_spec.rb' + - 'spec/jobs/connect_app_job_spec.rb' + - 'spec/mailers/producer_mailer_spec.rb' + - 'spec/mailers/subscription_mailer_spec.rb' + - 'spec/models/column_preference_spec.rb' + - 'spec/models/connected_app_spec.rb' + - 'spec/models/customer_spec.rb' + - 'spec/models/invoice_spec.rb' + - 'spec/models/oidc_account_spec.rb' + - 'spec/models/proxy_order_spec.rb' + - 'spec/models/report_blob_spec.rb' + - 'spec/models/semantic_link_spec.rb' + - 'spec/models/spree/gateway/stripe_sca_spec.rb' + - 'spec/models/subscription_spec.rb' + - 'spec/models/tag_rule/filter_order_cycles_spec.rb' + - 'spec/models/tag_rule/filter_payment_methods_spec.rb' + - 'spec/models/tag_rule/filter_products_spec.rb' + - 'spec/models/tag_rule/filter_shipping_methods_spec.rb' + - 'spec/models/tag_rule_spec.rb' + - 'spec/models/webhook_endpoint_spec.rb' + - 'spec/requests/admin/images_spec.rb' + - 'spec/requests/admin/product_import_spec.rb' + - 'spec/requests/admin/vouchers_spec.rb' + - 'spec/requests/api/orders_spec.rb' + - 'spec/requests/api/routes_spec.rb' + - 'spec/requests/api/v1/customers_spec.rb' + - 'spec/requests/api_docs_spec.rb' + - 'spec/requests/checkout/failed_checkout_spec.rb' + - 'spec/requests/checkout/paypal_spec.rb' + - 'spec/requests/checkout/routes_spec.rb' + - 'spec/requests/checkout/stripe_sca_spec.rb' + - 'spec/requests/errors_spec.rb' + - 'spec/requests/home_controller_spec.rb' + - 'spec/requests/large_request_spec.rb' + - 'spec/requests/omniauth_callbacks_controller_spec.rb' + - 'spec/requests/spree/admin/overview_spec.rb' + - 'spec/requests/spree/admin/payments_spec.rb' + - 'spec/requests/voucher_adjustments_spec.rb' + - 'spec/routing/stripe_spec.rb' # Offense count: 11 # Configuration parameters: Include. @@ -415,31 +576,6 @@ Rails/HasManyOrHasOneDependent: - 'app/models/spree/tax_rate.rb' - 'app/models/spree/variant.rb' -# Offense count: 26 -# Configuration parameters: Include. -# Include: app/helpers/**/*.rb -Rails/HelperInstanceVariable: - Exclude: - - 'app/helpers/injection_helper.rb' - - 'app/helpers/shared_helper.rb' - - 'app/helpers/spree/admin/orders_helper.rb' - - 'app/helpers/spree/orders_helper.rb' - -# Offense count: 8 -# Configuration parameters: Include. -# Include: spec/**/*.rb, test/**/*.rb -Rails/I18nLocaleAssignment: - Exclude: - - 'spec/controllers/user_registrations_controller_spec.rb' - - 'spec/helpers/i18n_helper_spec.rb' - - 'spec/models/spree/variant_spec.rb' - - 'spec/system/admin/order_cycles/list_spec.rb' - -# Offense count: 3 -Rails/I18nLocaleTexts: - Exclude: - - 'app/controllers/admin/stripe_accounts_controller.rb' - # Offense count: 22 # Configuration parameters: IgnoreScopes, Include. # Include: app/models/**/*.rb @@ -484,17 +620,6 @@ Rails/LexicallyScopedActionFilter: - 'app/controllers/spree/admin/zones_controller.rb' - 'app/controllers/spree/users_controller.rb' -# Offense count: 6 -# This cop supports unsafe autocorrection (--autocorrect-all). -Rails/NegateInclude: - Exclude: - - 'app/controllers/admin/resource_controller.rb' - - 'app/models/calculator/weight.rb' - - 'app/models/product_import/spreadsheet_entry.rb' - - 'app/services/order_cart_reset.rb' - - 'lib/spree/localized_number.rb' - - 'spec/support/matchers/table_matchers.rb' - # Offense count: 32 # This cop supports unsafe autocorrection (--autocorrect-all). Rails/Pluck: @@ -562,7 +687,7 @@ Rails/RelativeDateConstant: Exclude: - 'lib/tasks/data/remove_transient_data.rb' -# Offense count: 58 +# Offense count: 56 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Include. # Include: spec/controllers/**/*.rb, spec/requests/**/*.rb, test/controllers/**/*.rb, test/integration/**/*.rb @@ -602,14 +727,6 @@ Rails/SkipsModelValidations: - 'app/models/variant_override.rb' - 'spec/models/spree/line_item_spec.rb' -# Offense count: 3 -# This cop supports unsafe autocorrection (--autocorrect-all). -Rails/SquishedSQLHeredocs: - Exclude: - - 'app/queries/customers_with_balance.rb' - - 'app/queries/outstanding_balance.rb' - - 'spec/queries/outstanding_balance_spec.rb' - # Offense count: 7 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. @@ -618,8 +735,8 @@ Rails/TimeZone: Exclude: - 'app/models/spree/gateway/pay_pal_express.rb' - 'spec/controllers/spree/credit_cards_controller_spec.rb' - - 'spec/services/customer_order_cancellation_spec.rb' - - 'spec/services/order_cycle_webhook_service_spec.rb' + - 'spec/services/order_cycles/webhook_service_spec.rb' + - 'spec/services/orders/customer_cancellation_service_spec.rb' # Offense count: 1 # Configuration parameters: TransactionMethods. @@ -656,60 +773,12 @@ Rails/UnusedRenderContent: - 'app/controllers/api/v0/taxons_controller.rb' - 'app/controllers/api/v0/variants_controller.rb' -# Offense count: 55 -# This cop supports unsafe autocorrection (--autocorrect-all). -Rails/WhereEquals: - Exclude: - - 'app/controllers/spree/admin/products_controller.rb' - - 'app/mailers/producer_mailer.rb' - - 'app/models/enterprise.rb' - - 'app/models/enterprise_fee.rb' - - 'app/models/enterprise_group.rb' - - 'app/models/enterprise_relationship.rb' - - 'app/models/exchange.rb' - - 'app/models/order_cycle.rb' - - 'app/models/product_import/entry_processor.rb' - - 'app/models/proxy_order.rb' - - 'app/models/schedule.rb' - - 'app/models/spree/line_item.rb' - - 'app/models/spree/order.rb' - - 'app/models/spree/payment_method.rb' - - 'app/models/spree/product.rb' - - 'app/models/spree/shipping_method.rb' - - 'app/models/spree/variant.rb' - - 'app/models/subscription.rb' - - 'app/queries/payments_requiring_action.rb' - - 'app/serializers/api/enterprise_shopfront_serializer.rb' - - 'app/serializers/api/order_serializer.rb' - - 'lib/open_food_network/enterprise_fee_calculator.rb' - - 'lib/open_food_network/order_cycle_permissions.rb' - - 'lib/reporting/reports/products_and_inventory/base.rb' - - 'lib/tasks/data.rake' - - 'lib/tasks/data/anonymize_data.rake' - - 'lib/tasks/data/remove_transient_data.rb' - - 'spec/services/product_tag_rules_filterer_spec.rb' - -# Offense count: 8 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: exists, where -Rails/WhereExists: - Exclude: - - 'app/controllers/spree/admin/overview_controller.rb' - - 'app/controllers/spree/admin/tax_rates_controller.rb' - - 'app/controllers/spree/user_sessions_controller.rb' - - 'app/models/spree/preferences/store.rb' - - 'lib/tasks/sample_data/customer_factory.rb' - - 'lib/tasks/sample_data/group_factory.rb' - - 'lib/tasks/sample_data/order_cycle_factory.rb' - - 'lib/tasks/sample_data/taxon_factory.rb' - # Offense count: 1 Security/Open: Exclude: - 'app/services/image_importer.rb' -# Offense count: 9 +# Offense count: 7 # This cop supports unsafe autocorrection (--autocorrect-all). Style/ArrayIntersect: Exclude: @@ -718,7 +787,6 @@ Style/ArrayIntersect: - 'app/models/tag_rule/filter_payment_methods.rb' - 'app/models/tag_rule/filter_products.rb' - 'app/models/tag_rule/filter_shipping_methods.rb' - - 'app/services/order_syncer.rb' - 'lib/open_food_network/tag_rule_applicator.rb' - 'spec/support/matchers/select2_matchers.rb' @@ -883,13 +951,12 @@ Style/PreferredHashMethods: Exclude: - 'app/controllers/api/v0/shipments_controller.rb' -# Offense count: 3 +# Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Methods. Style/RedundantArgument: Exclude: - 'engines/dfc_provider/app/services/authorization_control.rb' - - 'spec/support/query_counter.rb' # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). @@ -899,7 +966,7 @@ Style/RedundantAssignment: # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: AllowComments. +# Configuration parameters: AutoCorrect, AllowComments. Style/RedundantInitialize: Exclude: - 'spec/models/spree/gateway_spec.rb' @@ -911,6 +978,12 @@ Style/RedundantInterpolation: - 'lib/tasks/karma.rake' - 'spec/base_spec_helper.rb' +# Offense count: 8 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantLineContinuation: + Exclude: + - 'lib/reporting/reports/enterprise_fee_summary/scope.rb' + # Offense count: 19 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowedMethods, AllowedPatterns. diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index 65b8cca69d..59d65b526a 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -6,28 +6,9 @@ This is a general guide to setting up an Open Food Network **development environ Head to our wiki on [Learning Rails](https://github.com/openfoodfoundation/openfoodnetwork/wiki/Learning-Rails) to find some good starting points. -### Requirements - -The fastest way to make it work locally is to use Docker, you only need to setup git, see the [Docker setup guide](docker/README.md). -Otherwise, for a local setup you will need: -* Ruby and bundler (check current Ruby version in [.ruby-version](https://github.com/openfoodfoundation/openfoodnetwork/blob/master/.ruby-version) file) - - To manage versions, it's recommended to use [rbenv](https://github.com/rbenv/rbenv) or [RVM](https://rvm.io/) -* Node and yarn (check current Node version in [.node-version](https://github.com/openfoodfoundation/openfoodnetwork/blob/master/.node-version) file) - - [nodevn](https://github.com/nodenv/nodenv) is recommended. -* PostgreSQL database -* Redis (for background jobs) -* Chrome (for testing) - -The following guides will provide OS-specific step-by-step instructions to get these requirements installed: -- [Ubuntu Setup Guide][ubuntu] -- [Debian Setup Guide][debian] -- [OSX Setup Guide][osx] - -For those new to Rails, the following tutorial will help get you up to speed with configuring a [Rails environment](http://guides.rubyonrails.org/getting_started.html). - ### Get it -So you have set up your local environment according to the requirements listed above. If you're planning on contributing code to the project (which we [LOVE](CONTRIBUTING.md)), it is a good idea to begin by forking this repo using the `Fork` button in the top-right corner of this screen. You should then be able to use `git clone` to copy your fork onto your local machine: +If you're planning on contributing code to the project (which we [LOVE](CONTRIBUTING.md)), it is a good idea to begin by forking this repo using the `Fork` button in the top-right corner of this screen. You should then be able to use `git clone` to copy your fork onto your local machine: git clone git@github.com:YOUR_GITHUB_USERNAME_HERE/openfoodnetwork.git @@ -43,6 +24,27 @@ Fetch the latest version of `master` from `upstream` (ie. the main repo): git fetch upstream master +### Installation + +This project needs specific ruby/bundler versions as well as node/yarn specific versions. For a local setup you will need: + +* Install or change your Ruby version according to the one specified at [.ruby-version](https://github.com/openfoodfoundation/openfoodnetwork/blob/master/.ruby-version) file. + - To manage versions, it's recommended to use [rbenv](https://github.com/rbenv/rbenv) or [RVM](https://rvm.io/). +* Install [nodenv](https://github.com/nodenv/nodenv) to ensure the correct [.node-version](https://github.com/openfoodfoundation/openfoodnetwork/blob/master/.node-version) is used. + - [nodevn](https://github.com/nodenv/nodenv) is recommended as a node version manager. +* PostgreSQL database +* Redis (for background jobs) +* Chrome (for testing) + +The following guides will provide OS-specific step-by-step instructions to get these requirements installed: +- [Ubuntu Setup Guide][ubuntu] +- [Debian Setup Guide][debian] +- [OSX Setup Guide][osx] + +For those new to Rails, the following tutorial will help get you up to speed with configuring a [Rails environment](http://guides.rubyonrails.org/getting_started.html). + +Another way to make it work locally would be using Docker. See the [Docker setup guide](docker/README.md). + ### Get it running First, you need to create the database user the app will use by manually typing the following in your terminal: @@ -53,7 +55,8 @@ sudo --login --user=postgres psql -c "CREATE USER ofn WITH SUPERUSER CREATEDB PA This will create the "ofn" user as superuser and allowing it to create databases. If this command fails, check the [troubleshooting section](#creating-the-database) for an alternative. -Next, it is _strongly recommended_ to run the setup script. +Next, it is _strongly recommended_ to run the setup script: + ```sh ./script/setup ``` diff --git a/Gemfile b/Gemfile index 23e8f60e4b..d4eea771b0 100644 --- a/Gemfile +++ b/Gemfile @@ -161,6 +161,7 @@ group :test, :development do gem 'letter_opener', '>= 1.4.1' gem 'rspec-rails', ">= 3.5.2" gem 'rspec-retry', require: false + gem 'rspec-sql' gem 'rswag' gem 'shoulda-matchers' gem 'stimulus_reflex_testing' diff --git a/Gemfile.lock b/Gemfile.lock index ae2f790fdb..d9269bc1a4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -109,7 +109,7 @@ GEM activerecord (7.0.8) activemodel (= 7.0.8) activesupport (= 7.0.8) - activerecord-import (1.5.1) + activerecord-import (1.6.0) activerecord (>= 4.2) activerecord-postgresql-adapter (0.0.1) pg @@ -156,30 +156,30 @@ GEM awesome_nested_set (3.6.0) activerecord (>= 4.0.0, < 7.2) aws-eventstream (1.3.0) - aws-partitions (1.883.0) - aws-sdk-core (3.191.0) + aws-partitions (1.914.0) + aws-sdk-core (3.192.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.8) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.77.0) + aws-sdk-kms (1.79.0) aws-sdk-core (~> 3, >= 3.191.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.143.0) - aws-sdk-core (~> 3, >= 3.191.0) + aws-sdk-s3 (1.147.0) + aws-sdk-core (~> 3, >= 3.192.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.8) aws-sigv4 (1.8.0) aws-eventstream (~> 1, >= 1.0.2) base64 (0.2.0) bcp47_spec (0.2.1) - bcrypt (3.1.19) + bcrypt (3.1.20) bigdecimal (3.0.2) - bindata (2.4.15) + bindata (2.5.0) bindex (0.8.1) bootsnap (1.18.3) msgpack (~> 1.2) - bugsnag (6.26.3) + bugsnag (6.26.4) concurrent-ruby (~> 1.0) builder (3.2.4) bullet (7.1.6) @@ -207,6 +207,7 @@ GEM nokogiri (~> 1.10, >= 1.10.4) rubyzip (>= 1.3.0, < 3) cgi (0.3.6) + childprocess (5.0.0) choice (0.2.0) chronic (0.10.2) coderay (1.1.3) @@ -237,14 +238,14 @@ GEM activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) - datafoodconsortium-connector (1.0.0.pre.alpha.10) + datafoodconsortium-connector (1.0.0.pre.alpha.12) virtual_assembly-semantizer (~> 1.0, >= 1.0.5) date (3.3.4) - debug (1.9.1) + debug (1.9.2) irb (~> 1.10) reline (>= 0.3.8) debugger-linecache (1.2.0) - devise (4.9.3) + devise (4.9.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) @@ -256,7 +257,7 @@ GEM devise (>= 4.9.0) devise-token_authenticatable (1.1.0) devise (>= 4.0.0, < 5.0.0) - diff-lcs (1.5.0) + diff-lcs (1.5.1) digest (3.1.1) docile (1.4.0) dotenv (3.1.0) @@ -311,7 +312,7 @@ GEM fog-xml (0.1.3) fog-core nokogiri (>= 1.5.11, < 2.0.0) - foreman (0.87.2) + foreman (0.88.1) formatador (0.2.5) fugit (1.8.1) et-orbi (~> 1, >= 1.2.7) @@ -326,15 +327,16 @@ GEM good_migrations (0.2.1) activerecord (>= 3.1) railties (>= 3.1) - haml (5.2.2) - temple (>= 0.8.0) + haml (6.3.0) + temple (>= 0.8.2) + thor tilt hashdiff (1.1.0) hashery (2.1.2) hashie (5.0.0) highline (2.0.3) htmlentities (4.3.4) - i18n (1.14.1) + i18n (1.14.4) concurrent-ruby (~> 1.0) i18n-js (3.9.2) i18n (>= 0.6.6) @@ -345,11 +347,11 @@ GEM activerecord (>= 3.0) invisible_captcha (2.2.0) rails (>= 5.2) - io-console (0.7.1) + io-console (0.7.2) ipaddress (0.8.3) - irb (1.11.0) + irb (1.12.0) rdoc - reline (>= 0.3.8) + reline (>= 0.4.2) jmespath (1.6.2) jquery-rails (4.4.0) rails-dom-testing (>= 1, < 3) @@ -357,9 +359,9 @@ GEM thor (>= 0.14, < 2.0) jquery-ui-rails (4.2.1) railties (>= 3.2.16) - json (2.7.1) + json (2.7.2) json-canonicalization (1.0.0) - json-jwt (1.16.5) + json-jwt (1.16.6) activesupport (>= 4.2) aes_key_wrap base64 @@ -380,15 +382,16 @@ GEM rspec (>= 2.0, < 4.0) jsonapi-serializer (2.2.0) activesupport (>= 4.2) - jwt (2.8.0) + jwt (2.8.1) base64 knapsack_pro (6.0.4) rake language_server-protocol (3.17.0.3) - launchy (2.5.2) + launchy (3.0.0) addressable (~> 2.8) - letter_opener (1.9.0) - launchy (>= 2.2, < 3) + childprocess (~> 5.0) + letter_opener (1.10.0) + launchy (>= 2.2, < 4) link_header (0.0.8) listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) @@ -412,8 +415,8 @@ GEM rake mini_magick (4.11.0) mini_mime (1.1.5) - mini_portile2 (2.8.5) - minitest (5.22.2) + mini_portile2 (2.8.6) + minitest (5.22.3) monetize (1.13.0) money (~> 6.12) money (6.16.0) @@ -430,11 +433,11 @@ GEM net-protocol net-protocol (0.2.2) timeout - net-smtp (0.4.0.1) + net-smtp (0.5.0) net-protocol - newrelic_rpm (9.7.1) + newrelic_rpm (9.8.0) nio4r (2.7.0) - nokogiri (1.16.2) + nokogiri (1.16.4) mini_portile2 (~> 2.8.2) racc (~> 1.4) oauth2 (1.4.11) @@ -504,7 +507,7 @@ GEM railties (>= 4.2) raabro (1.4.0) racc (1.7.3) - rack (2.2.8) + rack (2.2.9) rack-mini-profiler (2.3.4) rack (>= 1.2.0) rack-oauth2 (2.2.1) @@ -553,7 +556,7 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - rails-i18n (7.0.8) + rails-i18n (7.0.9) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) rails_safe_tasks (1.0.0) @@ -565,7 +568,7 @@ GEM thor (~> 1.0) zeitwerk (~> 2.5) rainbow (3.1.1) - rake (13.1.0) + rake (13.2.1) ransack (4.1.1) activerecord (>= 6.1.5) activesupport (>= 6.1.5) @@ -576,15 +579,15 @@ GEM rdf (3.3.1) bcp47_spec (~> 0.2) link_header (~> 0.0, >= 0.0.8) - rdoc (6.6.2) + rdoc (6.6.3.1) psych (>= 4.0.0) redcarpet (3.6.0) - redis (5.1.0) - redis-client (>= 0.17.0) - redis-client (0.20.0) + redis (5.2.0) + redis-client (>= 0.22.0) + redis-client (0.22.0) connection_pool regexp_parser (2.9.0) - reline (0.4.1) + reline (0.5.0) io-console (~> 0.5) request_store (1.5.1) rack (>= 1.4) @@ -604,29 +607,32 @@ GEM roo (2.10.1) nokogiri (~> 1) rubyzip (>= 1.3.0, < 3.0.0) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (6.1.1) + rspec-support (~> 3.13.0) + rspec-rails (6.1.2) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) - rspec-core (~> 3.12) - rspec-expectations (~> 3.12) - rspec-mocks (~> 3.12) - rspec-support (~> 3.12) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) rspec-retry (0.6.2) rspec-core (> 3.3) - rspec-support (3.12.1) + rspec-sql (0.0.2) + activesupport + rspec + rspec-support (3.13.1) rswag (2.13.0) rswag-api (= 2.13.0) rswag-specs (= 2.13.0) @@ -642,7 +648,7 @@ GEM rswag-ui (2.13.0) actionpack (>= 3.1, < 7.2) railties (>= 3.1, < 7.2) - rubocop (1.60.2) + rubocop (1.63.2) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -650,24 +656,27 @@ GEM rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.30.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.30.0) - parser (>= 3.2.1.0) + rubocop-ast (1.31.2) + parser (>= 3.3.0.4) rubocop-capybara (2.20.0) rubocop (~> 1.41) rubocop-factory_bot (2.25.1) rubocop (~> 1.41) - rubocop-rails (2.23.1) + rubocop-rails (2.24.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) - rubocop-ast (>= 1.30.0, < 2.0) - rubocop-rspec (2.26.1) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rspec (2.29.1) rubocop (~> 1.40) rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) + rubocop-rspec_rails (~> 2.28) + rubocop-rspec_rails (2.28.2) + rubocop (~> 1.40) ruby-graphviz (1.2.5) rexml ruby-progressbar (1.13.0) @@ -689,7 +698,7 @@ GEM tilt (>= 1.1, < 3) sd_notify (0.1.1) semantic_range (3.0.0) - shoulda-matchers (6.1.0) + shoulda-matchers (6.2.0) activesupport (>= 5.2.0) sidekiq (7.2.2) concurrent-ruby (< 2) @@ -709,7 +718,7 @@ GEM spreadsheet_architect (5.0.0) caxlsx (>= 3.3.0, < 4) rodf (>= 1.0.0, < 2) - spring (4.1.3) + spring (4.2.0) spring-commands-rspec (1.0.4) spring (>= 0.9.1) spring-commands-rubocop (0.4.0) @@ -742,14 +751,14 @@ GEM stimulus_reflex (>= 3.3.0) stringex (2.8.6) stringio (3.1.0) - stripe (10.10.0) + stripe (11.1.0) swd (2.0.3) activesupport (>= 3) attr_required (>= 0.0.5) faraday (~> 2.0) faraday-follow_redirects temple (0.8.2) - thor (1.3.0) + thor (1.3.1) thread-local (1.1.0) tilt (2.3.0) timecop (0.9.8) @@ -760,7 +769,7 @@ GEM unicode-display_width (2.5.0) uniform_notifier (1.16.0) uri (0.13.0) - valid_email2 (5.2.1) + valid_email2 (5.2.3) activemodel (>= 3.2) mail (~> 2.5) validate_url (1.0.15) @@ -769,7 +778,7 @@ GEM validates_lengths_from_database (0.8.0) activerecord (>= 4) vcr (6.2.0) - view_component (3.11.0) + view_component (3.12.0) activesupport (>= 5.2.0, < 8.0) concurrent-ruby (~> 1.0) method_source (~> 1.0) @@ -777,7 +786,7 @@ GEM rails (>= 5.2, < 8.0) stimulus_reflex (>= 3.5.0.pre2) view_component (>= 2.28.0) - virtual_assembly-semantizer (1.0.5) + virtual_assembly-semantizer (1.1.1) json-ld (~> 3.2, >= 3.2.3) warden (1.2.9) rack (>= 2.0.9) @@ -921,6 +930,7 @@ DEPENDENCIES roo rspec-rails (>= 3.5.2) rspec-retry + rspec-sql rswag rswag-api rswag-ui diff --git a/README.md b/README.md index df29a3db1a..bd855e097d 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ We also have a [Super Admin Guide][super-admin-guide] to help with configuration ## Testing -If you'd like to help out with testing, please introduce yourself on the #testing channel on [Slack][slack-invite] and download the [ZenHub browser extension][zenhub] to view the development pipeline. Also, do have a look in our [Welcome New QAs board][welcome-qa] for some good first issues, both on manual and automated testing (RSpec/Capybara). +If you'd like to help out with testing, please introduce yourself on the #testing channel on [Slack][slack-invite]. Also, do have a look in our [Welcome New QAs board][welcome-qa] for some good first issues, both on manual and automated testing (RSpec/Capybara). We use [BrowserStack](https://www.browserstack.com/) as a manual testing tool. BrowserStack provides open source projects with unlimited and free of charge accounts. A big thanks to them! @@ -53,4 +53,3 @@ Copyright (c) 2012 - 2024 Open Food Foundation, released under the AGPL licence. [super-admin-guide]: https://ofn-user-guide.gitbook.io/ofn-super-admin-guide [welcome-dev]: https://github.com/orgs/openfoodfoundation/projects/5 [welcome-qa]: https://github.com/orgs/openfoodfoundation/projects/6 -[zenhub]: https://www.zenhub.com/extension diff --git a/app/assets/javascripts/admin/bulk_product_update.js.coffee b/app/assets/javascripts/admin/bulk_product_update.js.coffee index 910fb39f8b..5adb65c399 100644 --- a/app/assets/javascripts/admin/bulk_product_update.js.coffee +++ b/app/assets/javascripts/admin/bulk_product_update.js.coffee @@ -48,7 +48,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout params = { 'q[name_cont]': $scope.q.query, 'q[supplier_id_eq]': $scope.q.producerFilter, - 'q[primary_taxon_id_eq]': $scope.q.categoryFilter, + 'q[variants_primary_taxon_id_eq]': $scope.q.categoryFilter, 'q[s]': $scope.sorting, import_date: $scope.q.importDateFilter, page: $scope.page, @@ -136,6 +136,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout on_hand: null price: null tax_category_id: null + category_id: null DisplayProperties.setShowVariants product.id, true @@ -217,7 +218,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout filters: 'q[name_cont]': $scope.q.query 'q[supplier_id_eq]': $scope.q.producerFilter - 'q[primary_taxon_id_eq]': $scope.q.categoryFilter + 'q[variants_primary_taxon_id_eq]': $scope.q.categoryFilter 'q[s]': $scope.sorting import_date: $scope.q.importDateFilter page: $scope.page @@ -332,9 +333,6 @@ filterSubmitProducts = (productsToFilter) -> if product.hasOwnProperty("on_demand") and filteredVariants.length == 0 #only update if no variants present filteredProduct.on_demand = product.on_demand hasUpdatableProperty = true - if product.hasOwnProperty("category_id") - filteredProduct.primary_taxon_id = product.category_id - hasUpdatableProperty = true if product.hasOwnProperty("inherits_properties") filteredProduct.inherits_properties = product.inherits_properties hasUpdatableProperty = true @@ -375,6 +373,9 @@ filterSubmitVariant = (variant) -> if variant.hasOwnProperty("tax_category_id") filteredVariant.tax_category_id = variant.tax_category_id hasUpdatableProperty = true + if variant.hasOwnProperty("category_id") + filteredVariant.primary_taxon_id = variant.category_id + hasUpdatableProperty = true if variant.hasOwnProperty("display_as") filteredVariant.display_as = variant.display_as hasUpdatableProperty = true diff --git a/app/assets/javascripts/admin/products/controllers/units_controller.js.coffee b/app/assets/javascripts/admin/products/controllers/units_controller.js.coffee index 01c59a1b73..a92f4aeada 100644 --- a/app/assets/javascripts/admin/products/controllers/units_controller.js.coffee +++ b/app/assets/javascripts/admin/products/controllers/units_controller.js.coffee @@ -1,3 +1,4 @@ +# Controller for "New Products" form (spree/admin/products/new) angular.module("admin.products") .controller "unitsCtrl", ($scope, VariantUnitManager, OptionValueNamer, UnitPrices, PriceParser) -> $scope.product = { master: {} } @@ -12,13 +13,15 @@ angular.module("admin.products") $scope.variant_unit_options = VariantUnitManager.variantUnitOptions() + # Extract variant_unit and variant_unit_scale from dropdown variant_unit_with_scale, + # and update hidden product fields $scope.processVariantUnitWithScale = -> if $scope.product.variant_unit_with_scale - match = $scope.product.variant_unit_with_scale.match(/^([^_]+)_([\d\.]+)$/) + match = $scope.product.variant_unit_with_scale.match(/^([^_]+)_([\d\.]+)$/) # matches string like "weight_1000" if match $scope.product.variant_unit = match[1] $scope.product.variant_unit_scale = parseFloat(match[2]) - else + else # "items" $scope.product.variant_unit = $scope.product.variant_unit_with_scale $scope.product.variant_unit_scale = null else if $scope.product.variant_unit @@ -32,6 +35,8 @@ angular.module("admin.products") else $scope.product.variant_unit = $scope.product.variant_unit_scale = null + # Extract unit_value and unit_description from text field unit_value_with_description, + # and update hidden variant fields $scope.processUnitValueWithDescription = -> if $scope.product.master.hasOwnProperty("unit_value_with_description") match = $scope.product.master.unit_value_with_description.match(/^([\d\.,]+(?= *|$)|)( *)(.*)$/) @@ -45,6 +50,7 @@ angular.module("admin.products") value = window.bigDecimal.divide(value, $scope.product.variant_unit_scale, 2) if $scope.product.master.unit_value && $scope.product.variant_unit_scale $scope.product.master.unit_value_with_description = value + " " + $scope.product.master.unit_description + # Calculate unit price based on product price and variant_unit_scale $scope.processUnitPrice = -> price = $scope.product.price scale = $scope.product.variant_unit_scale diff --git a/app/assets/javascripts/admin/products/services/option_value_namer.js.coffee b/app/assets/javascripts/admin/products/services/option_value_namer.js.coffee index 9d6d46a494..0e7c94331d 100644 --- a/app/assets/javascripts/admin/products/services/option_value_namer.js.coffee +++ b/app/assets/javascripts/admin/products/services/option_value_namer.js.coffee @@ -1,4 +1,5 @@ angular.module("admin.products").factory "OptionValueNamer", (VariantUnitManager) -> + # Javascript clone of VariantUnits::OptionValueNamer, for bulk product editing. class OptionValueNamer constructor: (@variant) -> diff --git a/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee index 521859f7ab..79f1db42ab 100644 --- a/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee @@ -68,7 +68,7 @@ angular.module('Darkswarm').controller "ProductsCtrl", ($scope, $sce, $filter, $ per_page: $scope.per_page, 'q[name_or_meta_keywords_or_variants_display_as_or_variants_display_name_or_supplier_name_cont]': $scope.query, 'q[with_properties][]': $scope.activeProperties, - 'q[primary_taxon_id_in_any][]': $scope.activeTaxons + 'q[variants_primary_taxon_id_in_any][]': $scope.activeTaxons } $scope.searchKeypress = (e)-> diff --git a/app/assets/javascripts/templates/active_selector.html.haml b/app/assets/javascripts/templates/active_selector.html.haml index 87fb066636..c7ddfc3577 100644 --- a/app/assets/javascripts/templates/active_selector.html.haml +++ b/app/assets/javascripts/templates/active_selector.html.haml @@ -1,3 +1,2 @@ -%li{ ng: { class: "{active: selector.active}" } } - %a{ "tooltip" => "{{selector.object.value}}", "tooltip-placement" => "bottom", - ng: { transclude: true, class: "{active: selector.active, 'has-tip': selector.object.value}" } } +%li{ "ng-class": "{active: selector.active}" } + %a{ tooltip: "{{selector.object.value}}", "tooltip-placement": "bottom", "ng-transclude": true, "ng-class": "{active: selector.active, 'has-tip': selector.object.value}" } diff --git a/app/assets/javascripts/templates/admin/alert_row.html.haml b/app/assets/javascripts/templates/admin/alert_row.html.haml index c1dfe45c6f..52df4db4e2 100644 --- a/app/assets/javascripts/templates/admin/alert_row.html.haml +++ b/app/assets/javascripts/templates/admin/alert_row.html.haml @@ -1,8 +1,8 @@ -.sixteen.columns.alpha.omega.alert-row{ ng: { show: '!dismissed' } } +.sixteen.columns.alpha.omega.alert-row{ "ng-show": '!dismissed' } .fifteen.columns.pad.alpha - %span.message.text-big{ ng: { bind: 'message'} } + %span.message.text-big{ "ng-bind": 'message' }     - %input{ type: 'button', ng: { value: "buttonText", show: 'buttonText && buttonAction', click: "buttonAction()" } } + %input{ type: 'button', "ng-value": "buttonText", "ng-show": 'buttonText && buttonAction', "ng-click": "buttonAction()" } .one.column.omega.pad.text-center - %a.close{ href: "#", ng: { click: "dismiss()" } } + %a.close{ href: "#", "ng-click": "dismiss()" } × diff --git a/app/assets/javascripts/templates/admin/columns_dropdown.html.haml b/app/assets/javascripts/templates/admin/columns_dropdown.html.haml index 7d6059de4d..61f42974db 100644 --- a/app/assets/javascripts/templates/admin/columns_dropdown.html.haml +++ b/app/assets/javascripts/templates/admin/columns_dropdown.html.haml @@ -1,13 +1,13 @@ -.ofn-drop-down.ofn-drop-down-v2.right#columns-dropdown{ ng: { controller: 'ColumnsDropdownCtrl' } } +.ofn-drop-down.ofn-drop-down-v2.right#columns-dropdown{ "ng-controller": 'ColumnsDropdownCtrl' } .ofn-drop-down-label = "  #{t('admin.columns')}".html_safe %span{ 'ng-class' => "expanded && 'icon-caret-up' || !expanded && 'icon-caret-down'" } %div.menu{ 'ng-show' => "expanded" } .menu_items - .menu_item{ ng: { repeat: "column in columns", click: "toggle(column);" } } - %input.redesigned-input{ type: "checkbox", ng: { checked: "column.visible" } } + .menu_item{ "ng-repeat": "column in columns", "ng-click": "toggle(column);" } + %input.redesigned-input{ type: "checkbox", "ng-checked": "column.visible" } {{ column.name }} %hr %div.menu_item.text-center - %input.fullwidth.orange{ type: "button", ng: { value: "saved() ? 'Saved': 'Saving'", show: "saved() || saving", disabled: "saved()" } } - %input.fullwidth.red{ type: "button", :value => t('admin.column_save_as_default').html_safe, ng: { show: "!saved() && !saving", click: "saveColumnPreferences(action)"} } + %input.fullwidth.orange{ type: "button", "ng-value": "saved() ? 'Saved': 'Saving'", "ng-show": "saved() || saving", "ng-disabled": "saved()" } + %input.fullwidth.red{ type: "button", value: t('admin.column_save_as_default').html_safe, "ng-show": "!saved() && !saving", "ng-click": "saveColumnPreferences(action)" } diff --git a/app/assets/javascripts/templates/admin/confirm_dialog.html.haml b/app/assets/javascripts/templates/admin/confirm_dialog.html.haml index cfd6a011f8..36d29a522b 100644 --- a/app/assets/javascripts/templates/admin/confirm_dialog.html.haml +++ b/app/assets/javascripts/templates/admin/confirm_dialog.html.haml @@ -1,8 +1,8 @@ -#confirm-dialog{ ng: { class: "dialog_class" } } +#confirm-dialog{ "ng-class": "dialog_class" } .message.clearfix.margin-bottom-30 .icon.text-center %i.icon-question-sign - .text{ ng: { bind: "::message" } } + .text{ "ng-bind": "::message" } .action-buttons.text-center - %button.cancel{ ng: { click: "close()", bind: "::cancelText" } } - %button.confirm.red{ ng: { click: "confirm()", bind: "::confirmText" } } + %button.cancel{ "ng-click": "close()", "ng-bind": "::cancelText" } + %button.confirm.red{ "ng-click": "confirm()", "ng-bind": "::confirmText" } diff --git a/app/assets/javascripts/templates/admin/edit_address_dialog.html.haml b/app/assets/javascripts/templates/admin/edit_address_dialog.html.haml index 4dd6f53aec..7a8ddd4216 100644 --- a/app/assets/javascripts/templates/admin/edit_address_dialog.html.haml +++ b/app/assets/javascripts/templates/admin/edit_address_dialog.html.haml @@ -1,12 +1,12 @@ #edit-address-dialog %h2 {{ addressType === 'bill_address' ? "#{t('admin.customers.index.edit_bill_address')}" : "#{t('admin.customers.index.edit_ship_address')}" }} - %form{ name: 'edit_address_form', novalidate: true, ng: { submit: 'updateAddress()'}} + %form{ name: 'edit_address_form', novalidate: true, "ng-submit": 'updateAddress()' } .row {{ 'admin.customers.index.required_fileds' | t }} ( %span.required * ) - .error{ ng: { repeat: "error in errors", bind: "error" } } + .error{ "ng-repeat": "error in errors", "ng-bind": "error" } %table.no-borders %tr @@ -14,61 +14,55 @@ {{ 'first_name' | t }} %span.required * %td - %input{ type: 'text', name: 'firstname', required: true, ng: { model: 'address.firstname'} } + %input{ type: 'text', name: 'firstname', required: true, "ng-model": 'address.firstname' } %tr %td {{ 'last_name' | t }} %span.required * %td - %input{ type: 'text', name: 'lastname', required: true, ng: { model: 'address.lastname'} } + %input{ type: 'text', name: 'lastname', required: true, "ng-model": 'address.lastname' } %tr %td {{ 'address' | t }} %span.required * %td - %input{ type: 'text', name: 'address1', required: true, ng: { model: 'address.address1'} } + %input{ type: 'text', name: 'address1', required: true, "ng-model": 'address.address1' } %tr %td {{ 'address2' | t }} %td - %input{ type: 'text', name: 'address2', ng: { model: 'address.address2'} } + %input{ type: 'text', name: 'address2', "ng-model": 'address.address2' } %tr %td {{ 'city' | t }} %span.required * %td - %input{ type: 'text', name: 'city', required: true, ng: { model: 'address.city'} } + %input{ type: 'text', name: 'city', required: true, "ng-model": 'address.city' } %tr %td {{ 'postcode' | t }} %span.required * %td - %input{ type: 'text', name: 'zipcode', required: true, ng: { model: 'address.zipcode'} } + %input{ type: 'text', name: 'zipcode', required: true, "ng-model": 'address.zipcode' } %tr %td {{ 'country' | t }} %span.required * %td - %input.ofn-select2.fullwidth#country_id{ type: 'number', - name: 'country_id', required: true, - placeholder: "{{ 'admin.customers.index.select_country' | t }}", - data: 'availableCountries', ng: { model: 'address.country_id' } } + %input.ofn-select2.fullwidth#country_id{ type: 'number', name: 'country_id', required: true, placeholder: "{{ 'admin.customers.index.select_country' | t }}", data: 'availableCountries', "ng-model": 'address.country_id' } %tr %td {{ 'state' | t }} %span.required * %td - %input.ofn-select2.fullwidth#state_id{ type: 'number', - name: 'state_id', required: true, - placeholder: "{{ 'admin.customers.index.select_state' | t }}", - data: 'states', ng: { model: 'address.state_id' } } + %input.ofn-select2.fullwidth#state_id{ type: 'number', name: 'state_id', required: true, placeholder: "{{ 'admin.customers.index.select_state' | t }}", data: 'states', "ng-model": 'address.state_id' } %tr %td {{ 'phone' | t }} %span.required * %td - %input{ type: 'text', name: 'phone', required: true, ng: { model: 'address.phone'} } + %input{ type: 'text', name: 'phone', required: true, "ng-model": 'address.phone' } .text-center %input.button.red.icon-plus{ type: 'submit', value: t('admin.customers.index.update_address')} diff --git a/app/assets/javascripts/templates/admin/info_dialog.html.haml b/app/assets/javascripts/templates/admin/info_dialog.html.haml index b69e3b0a4f..3e474c5501 100644 --- a/app/assets/javascripts/templates/admin/info_dialog.html.haml +++ b/app/assets/javascripts/templates/admin/info_dialog.html.haml @@ -1,9 +1,9 @@ -#info-dialog{ ng: { class: "dialog_class" } } +#info-dialog{ "ng-class": "dialog_class" } .message.clearfix.margin-bottom-30 .icon.text-center - %i{ ng: { class: "icon_class" } } + %i{ "ng-class": "icon_class" } .text {{ message }} .action-buttons.text-center - %button{ ng: { click: "close()" } } + %button{ "ng-click": "close()" } = t(:ok) diff --git a/app/assets/javascripts/templates/admin/modals/bulk_invoice.html.haml b/app/assets/javascripts/templates/admin/modals/bulk_invoice.html.haml index 4c3fd55488..c2a026d19e 100644 --- a/app/assets/javascripts/templates/admin/modals/bulk_invoice.html.haml +++ b/app/assets/javascripts/templates/admin/modals/bulk_invoice.html.haml @@ -1,15 +1,15 @@ %h4.modal-title = t('js.admin.orders.index.compiling_invoices') -%p.message{ ng: { show: 'message' } } +%p.message{ "ng-show": 'message' } {{message}} -%p.error{ ng: { show: 'error' } } +%p.error{ "ng-show": 'error' } {{error}} -%img.spinner{ src: image_path("/spinning-circles.svg"), ng: { show: "loading" } } -%p{ ng: { show: "loading" } } +%img.spinner{ src: image_path("/spinning-circles.svg"), "ng-show": "loading" } +%p{ "ng-show": "loading" } = t('js.admin.orders.index.please_wait') -%a.button{ target: '_blank', ng: { click: 'showBulkInvoice()', href: '/admin/orders/invoices/{{invoice_id}}', show: "!loading && !error" } } +%a.button{ target: '_blank', "ng-click": 'showBulkInvoice()', "ng-href": '/admin/orders/invoices/{{invoice_id}}', "ng-show": "!loading && !error" } = t('js.admin.orders.index.view_file') diff --git a/app/assets/javascripts/templates/admin/modals/image_upload.html.haml b/app/assets/javascripts/templates/admin/modals/image_upload.html.haml index 28d01d8ada..ebc198b178 100644 --- a/app/assets/javascripts/templates/admin/modals/image_upload.html.haml +++ b/app/assets/javascripts/templates/admin/modals/image_upload.html.haml @@ -1,10 +1,10 @@ %a.close-reveal-modal{"ng-click" => "$close()"} %i.fa.fa-times-circle{'aria-hidden' => "true"} -%form#image_upload{ name: 'form', novalidate: true, enctype: 'multipart/form-data', multipart: true, ng: { controller: "ProductImageCtrl" } } +%form#image_upload{ name: 'form', novalidate: true, enctype: 'multipart/form-data', multipart: true, "ng-controller": "ProductImageCtrl" } %div.image-preview - %img.spinner{ src: image_path("/spinning-circles.svg"), ng: { hide: "!imageUploader.isUploading" }} - %img.preview{ng: {src: "{{imagePreview}}", class: "{'faded': imageUploader.isUploading}"}} + %img.spinner{ src: image_path("/spinning-circles.svg"), "ng-hide": "!imageUploader.isUploading" } + %img.preview{ "ng-src": "{{imagePreview}}", "ng-class": "{'faded': imageUploader.isUploading}" } %label{for: 'image-upload', class: 'button'} {{ 'admin.products.index.upload_an_image' | t }} %input#image-upload{hidden: true, type: 'file', 'nv-file-select' => true, uploader: "imageUploader"} diff --git a/app/assets/javascripts/templates/admin/new_customer_dialog.html.haml b/app/assets/javascripts/templates/admin/new_customer_dialog.html.haml index 9cdcb97713..8914e21f08 100644 --- a/app/assets/javascripts/templates/admin/new_customer_dialog.html.haml +++ b/app/assets/javascripts/templates/admin/new_customer_dialog.html.haml @@ -2,14 +2,14 @@ .text-normal.margin-bottom-30.text-center {{ 'js.admin.customers.index.add_a_new_customer_for' | t:{ shop_name: CurrentShop.shop.name } }} - %form{ name: 'new_customer_form', novalidate: true, ng: { submit: "addCustomer()" }} + %form{ name: 'new_customer_form', novalidate: true, "ng-submit": "addCustomer()" } .text-center.margin-bottom-30 - %input.fullwidth{ type: 'email', name: 'email', required: true, placeholder: "{{ 'js.admin.customers.index.customer_placeholder' | t }}", ng: { model: "email" } } - %div{ ng: { show: "submitted && new_customer_form.$pristine" } } - .error{ ng: { show: "(new_customer_form.email.$error.email || new_customer_form.email.$error.required)" } } + %input.fullwidth{ type: 'email', name: 'email', required: true, placeholder: "{{ 'js.admin.customers.index.customer_placeholder' | t }}", "ng-model": "email" } + %div{ "ng-show": "submitted && new_customer_form.$pristine" } + .error{ "ng-show": "(new_customer_form.email.$error.email || new_customer_form.email.$error.required)" } {{ 'js.admin.customers.index.valid_email_error' | t }} - .error{ ng: { repeat: "error in errors", bind: "error" } } + .error{ "ng-repeat": "error in errors", "ng-bind": "error" } .text-center %input.button.red.icon-plus{ type: 'submit', value: "{{ 'js.admin.customers.index.add_customer' | t }}" } diff --git a/app/assets/javascripts/templates/admin/new_tag_rule_dialog.html.haml b/app/assets/javascripts/templates/admin/new_tag_rule_dialog.html.haml index 50d61d3563..cc43116af1 100644 --- a/app/assets/javascripts/templates/admin/new_tag_rule_dialog.html.haml +++ b/app/assets/javascripts/templates/admin/new_tag_rule_dialog.html.haml @@ -4,7 +4,7 @@ .text-center.margin-bottom-30 -# %select.fullwidth{ 'select2-min-search' => 5, 'ng-model' => 'newRuleType', 'ng-options' => 'ruleType.id as ruleType.name for ruleType in availableRuleTypes' } - %input.ofn-select2.fullwidth{ :id => 'rule_type_selector', ng: { model: "ruleType" }, data: "ruleTypes", 'min-search' => "5" } + %input.ofn-select2.fullwidth{ id: 'rule_type_selector', data: "ruleTypes", "min-search": "5", "ng-model": "ruleType" } .text-center - %input.button.red.icon-plus{ type: 'button', value: "{{ 'js.admin.new_tag_rule_dialog.add_rule' | t }}", ng: { click: 'addRule(tagGroup, ruleType)' } } + %input.button.red.icon-plus{ type: 'button', value: "{{ 'js.admin.new_tag_rule_dialog.add_rule' | t }}", "ng-click": 'addRule(tagGroup, ruleType)' } diff --git a/app/assets/javascripts/templates/admin/order_cycles_selector.html.haml b/app/assets/javascripts/templates/admin/order_cycles_selector.html.haml index a0b9e7776c..e39cc7ca8b 100644 --- a/app/assets/javascripts/templates/admin/order_cycles_selector.html.haml +++ b/app/assets/javascripts/templates/admin/order_cycles_selector.html.haml @@ -3,16 +3,16 @@ %td#available-order-cycles {{ 'js.admin.order_cycles.schedules.available' | t }} .order-cycles - .order-cycle{ ng: { repeat: 'orderCycle in orderCycles | available:selectedOrderCycles as availableOrderCycles', click: 'selections.available = orderCycle', dblclick: 'add(orderCycle)', class: '{selected: selections.available == orderCycle}' } } + .order-cycle{ "ng-repeat": 'orderCycle in orderCycles | available:selectedOrderCycles as availableOrderCycles', "ng-click": 'selections.available = orderCycle', "ng-dblclick": 'add(orderCycle)', "ng-class": '{selected: selections.available == orderCycle}' } {{ orderCycle.name }} %td#add-remove-buttons - %a.add.button{ href: 'javascript:void(0)', ng: { click: 'add()' } } + %a.add.button{ href: 'javascript:void(0)', "ng-click": 'add()' } %i.icon-chevron-right - %a.remove.button{ href: 'javascript:void(0)', ng: { click: 'remove()' } } + %a.remove.button{ href: 'javascript:void(0)', "ng-click": 'remove()' } %i.icon-chevron-left %td#selected-order-cycles {{ 'js.admin.order_cycles.schedules.selected' | t }} .order-cycles - .order-cycle{ ng: { repeat: 'orderCycle in selectedOrderCycles', click: 'selections.selected = orderCycle', dblclick: 'remove(orderCycle)', class: '{selected: selections.selected == orderCycle}' } } + .order-cycle{ "ng-repeat": 'orderCycle in selectedOrderCycles', "ng-click": 'selections.selected = orderCycle', "ng-dblclick": 'remove(orderCycle)', "ng-class": '{selected: selections.selected == orderCycle}' } {{ orderCycle.name }} -.error{ ng: { repeat: "error in errors", bind: "error" } } +.error{ "ng-repeat": "error in errors", "ng-bind": "error" } diff --git a/app/assets/javascripts/templates/admin/panel.html.haml b/app/assets/javascripts/templates/admin/panel.html.haml index 4d3780aed0..54b9fa5c39 100644 --- a/app/assets/javascripts/templates/admin/panel.html.haml +++ b/app/assets/javascripts/templates/admin/panel.html.haml @@ -1,2 +1,2 @@ -%td{ colspan: "{{columnCount}}", ng: { if: "template" } } - .panel{ ng: { include: "template" } } +%td{ colspan: "{{columnCount}}", "ng-if": "template" } + .panel{ "ng-include": "template" } diff --git a/app/assets/javascripts/templates/admin/panels/enterprise_package.html.haml b/app/assets/javascripts/templates/admin/panels/enterprise_package.html.haml index 4ef49a3bc0..0c3a737a90 100644 --- a/app/assets/javascripts/templates/admin/panels/enterprise_package.html.haml +++ b/app/assets/javascripts/templates/admin/panels/enterprise_package.html.haml @@ -1,7 +1,7 @@ -.row.enterprise_package_panel{ ng: { controller: 'indexPackagePanelCtrl' } } +.row.enterprise_package_panel{ "ng-controller": 'indexPackagePanelCtrl' } .alpha.eight.columns - %div{ ng: { if: "!enterprise.is_primary_producer", switch: "enterprise.sells" } } - .info{ ng: { switch: { when: "none" } } } + %div{ "ng-if": "!enterprise.is_primary_producer", "ng-switch": "enterprise.sells" } + .info{ "ng-switch-when": "none" } %h3 {{ 'js.admin.panels.enterprise_package.hub_profile' | t }} @@ -15,7 +15,7 @@ %p {{ 'js.admin.panels.enterprise_package.hub_profile_text2' | t }} - .info{ ng: { switch: { when: "any" } } } + .info{ "ng-switch-when": "any" } %h3 {{ 'js.admin.panels.enterprise_package.hub_shop' | t }} @@ -28,7 +28,7 @@ %p {{ 'js.admin.panels.enterprise_package.hub_shop_text3' | t }} - .info{ ng: { switch: { default: true } } } + .info{ "ng-switch-default": true } %h3 {{ 'js.admin.panels.enterprise_package.choose_package' | t }} %i.icon-arrow-right @@ -40,8 +40,8 @@ %p {{ 'js.admin.panels.enterprise_package.choose_package_text2' | t }} - %div{ ng: { if: "enterprise.is_primary_producer", switch: "enterprise.sells" } } - .info{ ng: { switch: { when: "none" } } } + %div{ "ng-if": "enterprise.is_primary_producer", "ng-switch": "enterprise.sells" } + .info{ "ng-switch-when": "none" } %h3 {{ 'js.admin.panels.enterprise_package.profile_only' | t }} @@ -58,7 +58,7 @@ %p {{ 'js.admin.panels.enterprise_package.profile_only_text3' | t }} - .info{ ng: { switch: { when: "own" } } } + .info{ "ng-switch-when": "own" } %h3 {{ 'js.admin.panels.enterprise_package.producer_shop' | t }} @@ -68,7 +68,7 @@ %p {{ 'js.admin.panels.enterprise_package.producer_shop_text2' | t }} - .info{ ng: { switch: { when: "any" } } } + .info{ "ng-switch-when": "any" } %h3 {{ 'js.admin.panels.enterprise_package.producer_hub' | t }} @@ -81,7 +81,7 @@ %p {{ 'js.admin.panels.enterprise_package.producer_hub_text3' | t }} - .info{ ng: { switch: { default: true } } } + .info{ "ng-switch-default": true } %h3 {{ 'js.admin.panels.enterprise_package.choose_package' | t }} %i.icon-arrow-right @@ -93,9 +93,9 @@ %p {{ 'js.admin.panels.enterprise_package.choose_package_text2' | t }} - .omega.eight.columns{ ng: { switch: "enterprise.is_primary_producer" } } - %div{ ng: { switch: { when: "false" } } } - %a.button.selector.hub-profile{ ng: { click: "enterprise.owned && (enterprise.sells='none')", class: "{selected: enterprise.sells=='none', disabled: !enterprise.owned}" } } + .omega.eight.columns{ "ng-switch": "enterprise.is_primary_producer" } + %div{ "ng-switch-when": "false" } + %a.button.selector.hub-profile{ "ng-click": "enterprise.owned && (enterprise.sells='none')", "ng-class": "{selected: enterprise.sells=='none', disabled: !enterprise.owned}" } .top %h3 {{ 'js.admin.panels.enterprise_package.profile_only' | t }} @@ -103,15 +103,15 @@ {{ 'js.admin.panels.enterprise_package.get_listing' | t }} .bottom {{ 'js.admin.panels.enterprise_package.always_free' | t }} - %a.button.selector.hub{ ng: { click: "enterprise.owned && (enterprise.sells='any')", class: "{selected: enterprise.sells=='any', disabled: !enterprise.owned}" } } + %a.button.selector.hub{ "ng-click": "enterprise.owned && (enterprise.sells='any')", "ng-class": "{selected: enterprise.sells=='any', disabled: !enterprise.owned}" } .top %h3 {{ 'js.admin.panels.enterprise_package.hub_shop' | t }} %p {{ 'js.admin.panels.enterprise_package.sell_produce_others' | t }} - %div{ ng: { switch: { when: "true" } } } - %a.button.selector.producer-profile{ ng: { click: "enterprise.owned && (enterprise.sells='none')", class: "{selected: enterprise.sells=='none', disabled: !enterprise.owned}" } } + %div{ "ng-switch-when": "true" } + %a.button.selector.producer-profile{ "ng-click": "enterprise.owned && (enterprise.sells='none')", "ng-class": "{selected: enterprise.sells=='none', disabled: !enterprise.owned}" } .top %h3 {{ 'js.admin.panels.enterprise_package.profile_only' | t }} @@ -119,27 +119,27 @@ {{ 'js.admin.panels.enterprise_package.get_listing' | t }} .bottom {{ 'js.admin.panels.enterprise_package.always_free' | t }} - %a.button.selector.producer-shop{ ng: { click: "enterprise.owned && (enterprise.sells='own')", class: "{selected: enterprise.sells=='own', disabled: !enterprise.owned}" } } + %a.button.selector.producer-shop{ "ng-click": "enterprise.owned && (enterprise.sells='own')", "ng-class": "{selected: enterprise.sells=='own', disabled: !enterprise.owned}" } .top %h3 {{ 'js.admin.panels.enterprise_package.producer_shop' | t }} %p {{ 'js.admin.panels.enterprise_package.sell_own_produce' | t }} - %a.button.selector.producer-hub{ ng: { click: "enterprise.owned && (enterprise.sells='any')", class: "{selected: enterprise.sells=='any', disabled: !enterprise.owned}" } } + %a.button.selector.producer-hub{ "ng-click": "enterprise.owned && (enterprise.sells='any')", "ng-class": "{selected: enterprise.sells=='any', disabled: !enterprise.owned}" } .top %h3 {{ 'js.admin.panels.enterprise_package.producer_hub' | t }} %p {{ 'js.admin.panels.enterprise_package.sell_both' | t }} - %a.button.update.fullwidth{ ng: { show: "enterprise.owned", class: "{disabled: saved() && !saving, saving: saving}", click: "save()" } } - %span{ ng: {hide: "saved() || saving" } } + %a.button.update.fullwidth{ "ng-show": "enterprise.owned", "ng-class": "{disabled: saved() && !saving, saving: saving}", "ng-click": "save()" } + %span{ "ng-hide": "saved() || saving" } {{ 'js.admin.panels.save' | t }} %i.icon-save - %span{ ng: {show: "saved() && !saving" } } + %span{ "ng-show": "saved() && !saving" } {{ 'js.admin.panels.saved' | t }} %i.icon-ok-sign - %span{ ng: {show: "saving" } } + %span{ "ng-show": "saving" } {{ 'js.admin.panels.saving' | t }} %i.icon-refresh diff --git a/app/assets/javascripts/templates/admin/panels/enterprise_producer.html.haml b/app/assets/javascripts/templates/admin/panels/enterprise_producer.html.haml index b1f022420d..f85ecc2a09 100644 --- a/app/assets/javascripts/templates/admin/panels/enterprise_producer.html.haml +++ b/app/assets/javascripts/templates/admin/panels/enterprise_producer.html.haml @@ -1,6 +1,6 @@ -.row.enterprise_producer_panel{ ng: { controller: 'indexProducerPanelCtrl' } } +.row.enterprise_producer_panel{ "ng-controller": 'indexProducerPanelCtrl' } .alpha.eight.columns - .info{ ng: { show: "enterprise.is_primary_producer==true" } } + .info{ "ng-show": "enterprise.is_primary_producer==true" } %h3 {{ 'js.admin.panels.enterprise_producer.producer' | t }} %p @@ -8,7 +8,7 @@ %p {{ 'js.admin.panels.enterprise_producer.producer_text2' | t }} - .info{ ng: { show: "enterprise.is_primary_producer==false" } } + .info{ "ng-show": "enterprise.is_primary_producer==false" } %h3 {{ 'js.admin.panels.enterprise_producer.non_producer' | t }} %p @@ -17,7 +17,7 @@ {{ 'js.admin.panels.enterprise_producer.non_producer_text2' | t }} .omega.eight.columns - %a.button.selector.producer{ ng: { click: 'enterprise.owned && changeToProducer()', class: "{selected: enterprise.is_primary_producer==true, disabled: !enterprise.owned}" } } + %a.button.selector.producer{ "ng-click": 'enterprise.owned && changeToProducer()', "ng-class": "{selected: enterprise.is_primary_producer==true, disabled: !enterprise.owned}" } .top %h3 {{ 'js.admin.panels.enterprise_producer.producer' | t }} @@ -26,7 +26,7 @@ .bottom {{ 'js.admin.panels.enterprise_producer.producer_example' | t }} - %a.button.selector.non-producer{ ng: { click: 'enterprise.owned && changeToNonProducer()', class: "{selected: enterprise.is_primary_producer==false, disabled: !enterprise.owned}" } } + %a.button.selector.non-producer{ "ng-click": 'enterprise.owned && changeToNonProducer()', "ng-class": "{selected: enterprise.is_primary_producer==false, disabled: !enterprise.owned}" } .top %h3 {{ 'js.admin.panels.enterprise_producer.non_producer' | t }} @@ -35,13 +35,13 @@ .bottom {{ 'js.admin.panels.enterprise_producer.non_producer_example' | t }} - %a.button.update.fullwidth{ ng: { show: "enterprise.owned", class: "{disabled: saved() && !saving, saving: saving}", click: "save()" } } - %span{ ng: {hide: "saved() || saving" } } + %a.button.update.fullwidth{ "ng-show": "enterprise.owned", "ng-class": "{disabled: saved() && !saving, saving: saving}", "ng-click": "save()" } + %span{ "ng-hide": "saved() || saving" } {{ 'js.admin.panels.save' | t }} %i.icon-save - %span{ ng: {show: "saved() && !saving" } } + %span{ "ng-show": "saved() && !saving" } {{ 'js.admin.panels.saved' | t }} %i.icon-ok-sign - %span{ ng: {show: "saving" } } + %span{ "ng-show": "saving" } {{ 'js.admin.panels.saving' | t }} %i.icon-refresh diff --git a/app/assets/javascripts/templates/admin/panels/enterprise_status.html.haml b/app/assets/javascripts/templates/admin/panels/enterprise_status.html.haml index d5022fd26e..3e0a2d396e 100644 --- a/app/assets/javascripts/templates/admin/panels/enterprise_status.html.haml +++ b/app/assets/javascripts/templates/admin/panels/enterprise_status.html.haml @@ -1,10 +1,10 @@ -.row.enterprise_status_panel{ ng: { controller: 'indexStatusPanelCtrl' } } +.row.enterprise_status_panel{ "ng-controller": 'indexStatusPanelCtrl' } .alpha.omega.sixteen.columns - %h4.status-ok.text-center{ ng: { show: "issues.length == 0 && warnings.length == 0" } } + %h4.status-ok.text-center{ "ng-show": "issues.length == 0 && warnings.length == 0" } %i.icon-ok-sign {{ 'js.admin.panels.enterprise_status.status_title' | t:{ name: object.name } }} - %table{ ng: { show: "issues.length > 0 || warnings.length > 0" } } + %table{ "ng-show": "issues.length > 0 || warnings.length > 0" } %thead %th.severity {{ 'js.admin.panels.enterprise_status.severity' | t }} @@ -12,17 +12,17 @@ {{ 'js.admin.panels.enterprise_status.description' | t }} %th.resolve {{ 'js.admin.panels.enterprise_status.resolve' | t }} - %tr{ ng: { repeat: "issue in issues"} } + %tr{ "ng-repeat": "issue in issues" } %td.severity %i.icon-warning-sign.issue %td.description - %span{ ng: { bind: "::issue.description" } } + %span{ "ng-bind": "::issue.description" } %td.resolve - %div{ ng: { bind: { html: "issue.link" } } } - %tr{ ng: { repeat: "warning in warnings"} } + %div{ "ng-bind-html": "issue.link" } + %tr{ "ng-repeat": "warning in warnings" } %td.severity %i.icon-warning-sign.warning %td.description - %span{ ng: { bind: "::warning.description" } } + %span{ "ng-bind": "::warning.description" } %td.resolve - %div{ ng: { bind: { html: "warning.link" } } } + %div{ "ng-bind-html": "warning.link" } diff --git a/app/assets/javascripts/templates/admin/save_bar.html.haml b/app/assets/javascripts/templates/admin/save_bar.html.haml index 08b6da5361..2a33901459 100644 --- a/app/assets/javascripts/templates/admin/save_bar.html.haml +++ b/app/assets/javascripts/templates/admin/save_bar.html.haml @@ -1,9 +1,9 @@ -#save-bar.animate-show{ ng: { show: 'dirty || persist || StatusMessage.active()' } } +#save-bar.animate-show{ "ng-show": 'dirty || persist || StatusMessage.active()' } .container .seven.columns.alpha - %h5#status-message{ ng: { show: "StatusMessage.invalidMessage == ''", style: 'StatusMessage.statusMessage.style' } } + %h5#status-message{ "ng-show": "StatusMessage.invalidMessage == ''", "ng-style": 'StatusMessage.statusMessage.style' } {{ StatusMessage.statusMessage.text || " " }} - %h5#status-message{ ng: { show: "StatusMessage.invalidMessage !== ''" }, style: 'color: #C85136' } + %h5#status-message{ style: 'color: #C85136', "ng-show": "StatusMessage.invalidMessage !== ''" } {{ StatusMessage.invalidMessage || " " }} - .nine.columns.omega.text-right{ ng: { transclude: true } } + .nine.columns.omega.text-right{ "ng-transclude": true } diff --git a/app/assets/javascripts/templates/admin/schedule_dialog.html.haml b/app/assets/javascripts/templates/admin/schedule_dialog.html.haml index 421cf25d42..928cf3da90 100644 --- a/app/assets/javascripts/templates/admin/schedule_dialog.html.haml +++ b/app/assets/javascripts/templates/admin/schedule_dialog.html.haml @@ -1,24 +1,24 @@ #schedule-dialog .text-normal.margin-bottom-30.text-center - %span{ ng: { hide: 'schedule.id' } } + %span{ "ng-hide": 'schedule.id' } {{ 'js.admin.order_cycles.schedules.adding_a_new_schedule' | t }} - %span{ ng: { show: 'schedule.id' } } + %span{ "ng-show": 'schedule.id' } {{ 'js.admin.order_cycles.schedules.updating_a_schedule' | t }} - %form{ name: 'schedule_form', novalidate: true, ng: { submit: "submit()" }} + %form{ name: 'schedule_form', novalidate: true, "ng-submit": "submit()" } .text-center.margin-bottom-20 - %input.fullwidth{ type: 'text', name: 'name', required: true, placeholder: "{{ 'js.admin.order_cycles.schedules.schedule_name_placeholder' | t }}", ng: { model: "schedule.name" } } - %div{ ng: { show: "submitted && schedule_form.$pristine" } } - .error{ ng: { show: "(schedule_form.name.$error.required)" } } + %input.fullwidth{ type: 'text', name: 'name', required: true, placeholder: "{{ 'js.admin.order_cycles.schedules.schedule_name_placeholder' | t }}", "ng-model": "schedule.name" } + %div{ "ng-show": "submitted && schedule_form.$pristine" } + .error{ "ng-show": "(schedule_form.name.$error.required)" } {{ 'js.admin.order_cycles.schedules.name_required_error' | t }} .order-cycles-selector.text-center.margin-bottom-30 .text-center - %input.button{ type: 'submit', value: "{{ 'js.admin.order_cycles.schedules.create_schedule' | t }}", ng: { hide: 'schedule.id' } } - %input.button{ type: 'submit', value: "{{ 'js.admin.order_cycles.schedules.update_schedule' | t }}", ng: { show: 'schedule.id' } } - %span{ ng: { show: 'schedule.id' } } or - %input.button.red{ type: 'button', value: "{{ 'js.admin.order_cycles.schedules.delete_schedule' | t }}", ng: { show: 'schedule.id', click: 'delete()'} } - %input.button{ type: 'button', value: "{{ 'actions.cancel' | t }}", ng: { click: 'close()' } } + %input.button{ type: 'submit', value: "{{ 'js.admin.order_cycles.schedules.create_schedule' | t }}", "ng-hide": 'schedule.id' } + %input.button{ type: 'submit', value: "{{ 'js.admin.order_cycles.schedules.update_schedule' | t }}", "ng-show": 'schedule.id' } + %span{ "ng-show": 'schedule.id' } or + %input.button.red{ type: 'button', value: "{{ 'js.admin.order_cycles.schedules.delete_schedule' | t }}", "ng-show": 'schedule.id', "ng-click": 'delete()' } + %input.button{ type: 'button', value: "{{ 'actions.cancel' | t }}", "ng-click": 'close()' } diff --git a/app/assets/javascripts/templates/admin/tag.html.haml b/app/assets/javascripts/templates/admin/tag.html.haml index c4afcfa5ad..a9db76671a 100644 --- a/app/assets/javascripts/templates/admin/tag.html.haml +++ b/app/assets/javascripts/templates/admin/tag.html.haml @@ -1,8 +1,8 @@ .tag-template %div - %span.tag-with-rules{ ng: { if: "data.rules" }, "ofn-with-tip" => "{{ 'admin.tag_has_rules' | t:{num: data.rules} }}" } + %span.tag-with-rules{ "ofn-with-tip": "{{ 'admin.tag_has_rules' | t:{num: data.rules} }}", "ng-if": "data.rules" } {{$getDisplayText()}} - %span{ ng: { if: "!data.rules" } } + %span{ "ng-if": "!data.rules" } {{$getDisplayText()}} - %a.remove-button{ ng: {click: "$removeTag()"} } + %a.remove-button{ "ng-click": "$removeTag()" } ✖ diff --git a/app/assets/javascripts/templates/admin/tag_autocomplete.html.haml b/app/assets/javascripts/templates/admin/tag_autocomplete.html.haml index 2b9b3f3f2f..39b321128c 100644 --- a/app/assets/javascripts/templates/admin/tag_autocomplete.html.haml +++ b/app/assets/javascripts/templates/admin/tag_autocomplete.html.haml @@ -1,11 +1,11 @@ .autocomplete-template - %span.tag-with-rules{ ng: { if: "data.rules" } } + %span.tag-with-rules{ "ng-if": "data.rules" } {{$getDisplayText()}} - %span.tag-with-rules{ ng: { if: "data.rules == 1" } } + %span.tag-with-rules{ "ng-if": "data.rules == 1" } — {{ 'admin.has_one_rule' | t }} - %span.tag-with-rules{ ng: { if: "data.rules > 1" } } + %span.tag-with-rules{ "ng-if": "data.rules > 1" } — {{ 'admin.has_n_rules' | t:{ num: data.rules } }} - %span{ ng: { if: "!data.rules" } } + %span{ "ng-if": "!data.rules" } {{$getDisplayText()}} diff --git a/app/assets/javascripts/templates/admin/tag_rules/discount_order_input.html.haml b/app/assets/javascripts/templates/admin/tag_rules/discount_order_input.html.haml index abad41ea62..ac087096ad 100644 --- a/app/assets/javascripts/templates/admin/tag_rules/discount_order_input.html.haml +++ b/app/assets/javascripts/templates/admin/tag_rules/discount_order_input.html.haml @@ -1,7 +1,3 @@ %div - %input{ type: "number", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_calculator_attributes_preferred_flat_percent", - min: -100, - max: 100, - ng: { model: "rule.calculator.preferred_flat_percent" }, 'invert-number' => true } + %input{ type: "number", id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_calculator_attributes_preferred_flat_percent", min: -100, max: 100, "invert-number": true, "ng-model": "rule.calculator.preferred_flat_percent" } %span.text-normal % diff --git a/app/assets/javascripts/templates/admin/tag_rules/filter_order_cycles_input.html.haml b/app/assets/javascripts/templates/admin/tag_rules/filter_order_cycles_input.html.haml index 87eddb331e..43458b40c6 100644 --- a/app/assets/javascripts/templates/admin/tag_rules/filter_order_cycles_input.html.haml +++ b/app/assets/javascripts/templates/admin/tag_rules/filter_order_cycles_input.html.haml @@ -1,11 +1,5 @@ %div - %input.fullwidth.light.ofn-select2{ id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_order_cycles_visibility", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_order_cycles_visibility]", - ng: { model: "rule.preferred_matched_order_cycles_visibility", if: "!rule.is_default" }, - data: 'visibilityOptions', "min-search" => 5 } - %input{ type: "hidden", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_order_cycles_visibility", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_order_cycles_visibility]", - ng: { value: "'hidden'", if: "rule.is_default" } } - %span.text-normal{ ng: { if: "rule.is_default" } } + %input.fullwidth.light.ofn-select2{ id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_order_cycles_visibility", name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_order_cycles_visibility]", data: 'visibilityOptions', "min-search": 5, "ng-model": "rule.preferred_matched_order_cycles_visibility", "ng-if": "!rule.is_default" } + %input{ type: "hidden", id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_order_cycles_visibility", name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_order_cycles_visibility]", "ng-value": "'hidden'", "ng-if": "rule.is_default" } + %span.text-normal{ "ng-if": "rule.is_default" } =t(:not_visible) diff --git a/app/assets/javascripts/templates/admin/tag_rules/filter_payment_methods_input.html.haml b/app/assets/javascripts/templates/admin/tag_rules/filter_payment_methods_input.html.haml index 8151feb677..013e606987 100644 --- a/app/assets/javascripts/templates/admin/tag_rules/filter_payment_methods_input.html.haml +++ b/app/assets/javascripts/templates/admin/tag_rules/filter_payment_methods_input.html.haml @@ -1,11 +1,5 @@ %div - %input.fullwidth.light.ofn-select2{ id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_payment_methods_visibility", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_payment_methods_visibility]", - ng: { model: "rule.preferred_matched_payment_methods_visibility", if: "!rule.is_default" }, - data: 'visibilityOptions', "min-search" => 5 } - %input{ type: "hidden", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_payment_methods_visibility", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_payment_methods_visibility]", - ng: { value: "'hidden'", if: "rule.is_default" } } - %span.text-normal{ ng: { if: "rule.is_default" } } + %input.fullwidth.light.ofn-select2{ id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_payment_methods_visibility", name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_payment_methods_visibility]", data: 'visibilityOptions', "min-search": 5, "ng-model": "rule.preferred_matched_payment_methods_visibility", "ng-if": "!rule.is_default" } + %input{ type: "hidden", id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_payment_methods_visibility", name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_payment_methods_visibility]", "ng-value": "'hidden'", "ng-if": "rule.is_default" } + %span.text-normal{ "ng-if": "rule.is_default" } = t(:not_visible) diff --git a/app/assets/javascripts/templates/admin/tag_rules/filter_products_input.html.haml b/app/assets/javascripts/templates/admin/tag_rules/filter_products_input.html.haml index b30901791a..302b5fb85b 100644 --- a/app/assets/javascripts/templates/admin/tag_rules/filter_products_input.html.haml +++ b/app/assets/javascripts/templates/admin/tag_rules/filter_products_input.html.haml @@ -1,11 +1,5 @@ %div - %input.fullwidth.light.ofn-select2{ id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_variants_visibility", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_variants_visibility]", - ng: { model: "rule.preferred_matched_variants_visibility", if: "!rule.is_default" }, - data: 'visibilityOptions', "min-search" => 5 } - %input{ type: "hidden", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_variants_visibility", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_variants_visibility]", - ng: { value: "'hidden'", if: "rule.is_default" } } - %span.text-normal{ ng: { if: "rule.is_default" } } + %input.fullwidth.light.ofn-select2{ id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_variants_visibility", name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_variants_visibility]", data: 'visibilityOptions', "min-search": 5, "ng-model": "rule.preferred_matched_variants_visibility", "ng-if": "!rule.is_default" } + %input{ type: "hidden", id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_variants_visibility", name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_variants_visibility]", "ng-value": "'hidden'", "ng-if": "rule.is_default" } + %span.text-normal{ "ng-if": "rule.is_default" } = t(:not_visible) diff --git a/app/assets/javascripts/templates/admin/tag_rules/filter_shipping_methods_input.html.haml b/app/assets/javascripts/templates/admin/tag_rules/filter_shipping_methods_input.html.haml index 48cf29a732..ab6a5aeb80 100644 --- a/app/assets/javascripts/templates/admin/tag_rules/filter_shipping_methods_input.html.haml +++ b/app/assets/javascripts/templates/admin/tag_rules/filter_shipping_methods_input.html.haml @@ -1,12 +1,6 @@ %div - %input.fullwidth.light.ofn-select2{ id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_shipping_methods_visibility", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_shipping_methods_visibility]", - ng: { model: "rule.preferred_matched_shipping_methods_visibility", if: "!rule.is_default" }, - data: 'visibilityOptions', "min-search" => 5 } - %input{ type: "hidden", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_shipping_methods_visibility", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_shipping_methods_visibility]", - ng: { value: "'hidden'", if: "rule.is_default" } } - %span.text-normal{ ng: { if: "rule.is_default" } } + %input.fullwidth.light.ofn-select2{ id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_shipping_methods_visibility", name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_shipping_methods_visibility]", data: 'visibilityOptions', "min-search": 5, "ng-model": "rule.preferred_matched_shipping_methods_visibility", "ng-if": "!rule.is_default" } + %input{ type: "hidden", id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_matched_shipping_methods_visibility", name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_matched_shipping_methods_visibility]", "ng-value": "'hidden'", "ng-if": "rule.is_default" } + %span.text-normal{ "ng-if": "rule.is_default" } = t(:not_visible) diff --git a/app/assets/javascripts/templates/admin/tag_rules/tag_rule.html.haml b/app/assets/javascripts/templates/admin/tag_rules/tag_rule.html.haml index 7907b9dfda..598eafe972 100644 --- a/app/assets/javascripts/templates/admin/tag_rules/tag_rule.html.haml +++ b/app/assets/javascripts/templates/admin/tag_rules/tag_rule.html.haml @@ -6,45 +6,27 @@ %col.actions{ width: "10%" } %tr %td - %input{ type: "hidden", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_id", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][id]", - ng: { value: "rule.id" } } + %input{ type: "hidden", id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_id", name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][id]", "ng-value": "rule.id" } - %input{ type: "hidden", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_type", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][type]", - ng: { value: "rule.type" } } + %input{ type: "hidden", id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_type", name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][type]", "ng-value": "rule.type" } - %input{ type: "hidden", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_priority", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][priority]", - ng: { value: "tagGroup.startIndex + $index" } } + %input{ type: "hidden", id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_priority", name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][priority]", "ng-value": "tagGroup.startIndex + $index" } - %input{ type: "hidden", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_is_default", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][is_default]", - ng: { value: "rule.is_default" } } + %input{ type: "hidden", id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_is_default", name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][is_default]", "ng-value": "rule.is_default" } - %input{ type: "hidden", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_customer_tags", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_customer_tags]", - ng: { value: "rule.preferred_customer_tags" } } + %input{ type: "hidden", id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_customer_tags", name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_customer_tags]", "ng-value": "rule.preferred_customer_tags" } - %input{ type: "hidden", - id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_{{opt[rule.type].taggable}}_tags", - name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_{{opt[rule.type].taggable}}_tags]", - ng: { value: "opt[rule.type].tagListFor(rule)" } } + %input{ type: "hidden", id: "enterprise_tag_rules_attributes_{{tagGroup.startIndex + $index}}_preferred_{{opt[rule.type].taggable}}_tags", name: "enterprise[tag_rules_attributes][{{tagGroup.startIndex + $index}}][preferred_{{opt[rule.type].taggable}}_tags]", "ng-value": "opt[rule.type].tagListFor(rule)" } %span.text-normal {{ opt[rule.type].textTop }} %td %tags-with-translation{ object: "rule", max: 1, "tags-attr" => "{{opt[rule.type].tagsAttr}}", "tag-list-attr" => "{{opt[rule.type].tagListAttr}}" } %td.actions{ rowspan: 2 } - %a{ ng: { click: "deleteTagRule(tagGroup || defaultTagGroup, rule)" }, :class => "delete-tag-rule icon-trash no-text" } + %a{ class: "delete-tag-rule icon-trash no-text", "ng-click": "deleteTagRule(tagGroup || defaultTagGroup, rule)" } %tr %td %span.text-normal {{ opt[rule.type].textBottom }} %td - %div{ ng: { include: "opt[rule.type].inputTemplate"} } + %div{ "ng-include": "opt[rule.type].inputTemplate" } %hr diff --git a/app/assets/javascripts/templates/admin/tags_input.html.haml b/app/assets/javascripts/templates/admin/tags_input.html.haml index c652aea610..d74c4d7de0 100644 --- a/app/assets/javascripts/templates/admin/tags_input.html.haml +++ b/app/assets/javascripts/templates/admin/tags_input.html.haml @@ -1,10 +1,2 @@ -%tags-input{ template: 'admin/tag.html', - "placeholder" => t('admin.order_cycles.form.add_a_tag'), - ng: { model: 'object[tagsAttr]', class: "{'limit-reached': limitReached}"}, - on: { tag: { added: 'tagAdded($tag)', removed:'tagRemoved()' } } } - %auto-complete{ ng: { if: "findTags" }, source: "findTags({query: $query})", - template: "admin/tag_autocomplete.html", - "min-length" => "0", - "load-on-focus" => "true", - "load-on-empty" => "true", - "max-results-to-show" => "32"} +%tags-input{ template: 'admin/tag.html', placeholder: t('admin.order_cycles.form.add_a_tag'), "ng-model": 'object[tagsAttr]', "ng-class": "{'limit-reached': limitReached}", "on-tag-added": 'tagAdded($tag)', "on-tag-removed": 'tagRemoved()' } + %auto-complete{ source: "findTags({query: $query})", template: "admin/tag_autocomplete.html", "min-length": "0", "load-on-focus": "true", "load-on-empty": "true", "max-results-to-show": "32", "ng-if": "findTags" } diff --git a/app/assets/javascripts/templates/bulk_buy_modal.html.haml b/app/assets/javascripts/templates/bulk_buy_modal.html.haml index 0c4706e43c..7788285342 100644 --- a/app/assets/javascripts/templates/bulk_buy_modal.html.haml +++ b/app/assets/javascripts/templates/bulk_buy_modal.html.haml @@ -22,24 +22,22 @@ .variant-bulk-buy-quantity-label {{ "js.shopfront.bulk_buy_modal.min_quantity" | t }} %div - %button.bulk-buy-add.variant-quantity{type: "button", ng: {click: "add(-1)", disabled: "!canAdd(-1)"}}> + %button.bulk-buy-add.variant-quantity{ type: "button", "ng-click": "add(-1)", "ng-disabled": "!canAdd(-1)" }> -# U+FF0D Fullwidth Hyphen-Minus - - %input.bulk-buy.variant-quantity{type: "number", min: "0", max: "{{ available() }}", - ng: {model: "variant.line_item.quantity", max: "Infinity"}}> - %button.bulk-buy-add.variant-quantity{type: "button", ng: {click: "add(1)", disabled: "!canAdd(1)"}} + %input.bulk-buy.variant-quantity{ type: "number", min: "0", max: "{{ available() }}", "ng-model": "variant.line_item.quantity", "ng-max": "Infinity" }> + %button.bulk-buy-add.variant-quantity{ type: "button", "ng-click": "add(1)", "ng-disabled": "!canAdd(1)" } -# U+FF0B Fullwidth Plus Sign + .columns.small-12.medium-6 .variant-bulk-buy-quantity-label {{ "js.shopfront.bulk_buy_modal.max_quantity" | t }} %div - %button.bulk-buy-add.variant-quantity{type: "button", ng: {click: "addMax(-1)", disabled: "!canAddMax(-1)"}}> + %button.bulk-buy-add.variant-quantity{ type: "button", "ng-click": "addMax(-1)", "ng-disabled": "!canAddMax(-1)" }> -# U+FF0D Fullwidth Hyphen-Minus - - %input.bulk-buy.variant-quantity{type: "number", min: "0", max: "{{ available() }}", - ng: {model: "variant.line_item.max_quantity", max: "Infinity"}}> - %button.bulk-buy-add.variant-quantity{type: "button", ng: {click: "addMax(1)", disabled: "!canAddMax(1)"}} + %input.bulk-buy.variant-quantity{ type: "number", min: "0", max: "{{ available() }}", "ng-model": "variant.line_item.max_quantity", "ng-max": "Infinity" }> + %button.bulk-buy-add.variant-quantity{ type: "button", "ng-click": "addMax(1)", "ng-disabled": "!canAddMax(1)" } -# U+FF0B Fullwidth Plus Sign + diff --git a/app/assets/javascripts/templates/filter_selector.html.haml b/app/assets/javascripts/templates/filter_selector.html.haml index 742ace2a0e..81559e4004 100644 --- a/app/assets/javascripts/templates/filter_selector.html.haml +++ b/app/assets/javascripts/templates/filter_selector.html.haml @@ -1,3 +1,3 @@ %ul - %active-selector{ ng: { repeat: "selector in allSelectors", show: "ifDefined(selector.fits, true)" } } + %active-selector{ "ng-repeat": "selector in allSelectors", "ng-show": "ifDefined(selector.fits, true)" } %span{"ng-bind" => "::selector.object.name"} diff --git a/app/assets/javascripts/templates/help-modal.html.haml b/app/assets/javascripts/templates/help-modal.html.haml index f87abd8fd4..0d7c3ad1e6 100644 --- a/app/assets/javascripts/templates/help-modal.html.haml +++ b/app/assets/javascripts/templates/help-modal.html.haml @@ -5,5 +5,5 @@ .small-12.columns.text-center {{ helpText }} .row.text-center - %button.primary.small{ ng: { click: '$close()' } } + %button.primary.small{ "ng-click": '$close()' } = t(:ok) diff --git a/app/assets/javascripts/templates/partials/hub_details.html.haml b/app/assets/javascripts/templates/partials/hub_details.html.haml index d9fb935f2a..0f58547413 100644 --- a/app/assets/javascripts/templates/partials/hub_details.html.haml +++ b/app/assets/javascripts/templates/partials/hub_details.html.haml @@ -1,4 +1,4 @@ -.row.pad-top{ng: { if: 'enterprise.is_distributor' } } +.row.pad-top{ "ng-if": 'enterprise.is_distributor' } .cta-container.small-12.columns .row .small-4.columns diff --git a/app/assets/javascripts/templates/price_breakdown.html.haml b/app/assets/javascripts/templates/price_breakdown.html.haml index 78d4ed7f33..6c3cf06029 100644 --- a/app/assets/javascripts/templates/price_breakdown.html.haml +++ b/app/assets/javascripts/templates/price_breakdown.html.haml @@ -1,6 +1,6 @@ -.joyride-tip-guide.price_breakdown{ng: {class: "{ in: tt_isOpen, fade: tt_animation }", show: "tt_isOpen"}} +.joyride-tip-guide.price_breakdown{ "ng-class": "{ in: tt_isOpen, fade: tt_animation }", "ng-show": "tt_isOpen" } %span.joyride-nub.top - .background{ng: {click: "tt_isOpen = false"}} + .background{ "ng-click": "tt_isOpen = false" } .joyride-content-wrapper %h6 {{ "js.shopfront.price_breakdown" | t }} %ul diff --git a/app/assets/javascripts/templates/shared/question_mark_with_tooltip.html.haml b/app/assets/javascripts/templates/shared/question_mark_with_tooltip.html.haml index 9c68ca47c4..0ec169915b 100644 --- a/app/assets/javascripts/templates/shared/question_mark_with_tooltip.html.haml +++ b/app/assets/javascripts/templates/shared/question_mark_with_tooltip.html.haml @@ -1,5 +1,5 @@ -.joyride-tip-guide.question-mark-tooltip{class: "{{ context }}", ng: {class: "{ in: tt_isOpen, fade: tt_animation }", show: "tt_isOpen"}} - .background{ng: {click: "tt_isOpen = false"}} +.joyride-tip-guide.question-mark-tooltip{ class: "{{ context }}", "ng-class": "{ in: tt_isOpen, fade: tt_animation }", "ng-show": "tt_isOpen" } + .background{ "ng-click": "tt_isOpen = false" } .joyride-content-wrapper {{ key | t }} %span.joyride-nub.bottom diff --git a/app/controllers/admin/customers_controller.rb b/app/controllers/admin/customers_controller.rb index 9751e9c6bb..ff5c43ab63 100644 --- a/app/controllers/admin/customers_controller.rb +++ b/app/controllers/admin/customers_controller.rb @@ -70,7 +70,7 @@ module Admin def collection if json_request? && params[:enterprise_id].present? - CustomersWithBalance.new(customers).query. + CustomersWithBalanceQuery.new(customers).call. includes( :enterprise, { bill_address: [:state, :country] }, diff --git a/app/controllers/admin/dfc_product_imports_controller.rb b/app/controllers/admin/dfc_product_imports_controller.rb new file mode 100644 index 0000000000..1b3f8dfb88 --- /dev/null +++ b/app/controllers/admin/dfc_product_imports_controller.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +require "private_address_check" +require "private_address_check/tcpsocket_ext" + +module Admin + class DfcProductImportsController < Spree::Admin::BaseController + # Define model class for `can?` permissions: + def model_class + self.class + end + + def index + # The plan: + # + # * Fetch DFC catalog as JSON from URL. + enterprise = OpenFoodNetwork::Permissions.new(spree_current_user) + .managed_product_enterprises.is_primary_producer + .find(params.require(:enterprise_id)) + + catalog_url = params.require(:catalog_url) + + json_catalog = DfcRequest.new(spree_current_user).get(catalog_url) + graph = DfcIo.import(json_catalog) + + # * First step: import all products for given enterprise. + # * Second step: render table and let user decide which ones to import. + imported = graph.map do |subject| + import_product(subject, enterprise) + end + + @count = imported.compact.count + end + + private + + # Most of this code is the same as in the DfcProvider::SuppliedProductsController. + def import_product(subject, enterprise) + return unless subject.is_a? DataFoodConsortium::Connector::SuppliedProduct + + variant = SuppliedProductBuilder.import_variant(subject, enterprise) + product = variant.product + + product.save! if product.new_record? + variant.save! if variant.new_record? + + variant + end + end +end diff --git a/app/controllers/admin/order_cycles_controller.rb b/app/controllers/admin/order_cycles_controller.rb index 2e1258eaa0..35333e7af7 100644 --- a/app/controllers/admin/order_cycles_controller.rb +++ b/app/controllers/admin/order_cycles_controller.rb @@ -45,7 +45,8 @@ module Admin end def create - @order_cycle_form = OrderCycleForm.new(@order_cycle, order_cycle_params, spree_current_user) + @order_cycle_form = OrderCycles::FormService.new(@order_cycle, order_cycle_params, + spree_current_user) if @order_cycle_form.save flash[:success] = t('.success') @@ -61,7 +62,8 @@ module Admin end def update - @order_cycle_form = OrderCycleForm.new(@order_cycle, order_cycle_params, spree_current_user) + @order_cycle_form = OrderCycles::FormService.new(@order_cycle, order_cycle_params, + spree_current_user) if @order_cycle_form.save update_nil_subscription_line_items_price_estimate(@order_cycle) @@ -98,7 +100,7 @@ module Admin def update_nil_subscription_line_items_price_estimate(order_cycle) order_cycle.schedules.each do |schedule| - Subscription.where(schedule_id: schedule.id).each do |subscription| + Subscription.where(schedule_id: schedule.id).find_each do |subscription| shop = Enterprise.managed_by(spree_current_user).find_by(id: subscription.shop_id) fee_calculator = OpenFoodNetwork::EnterpriseFeeCalculator.new(shop, order_cycle) subscription.subscription_line_items.nil_price_estimate.each do |line_item| diff --git a/app/controllers/admin/product_import_controller.rb b/app/controllers/admin/product_import_controller.rb index 181870f3b2..c71e3ad015 100644 --- a/app/controllers/admin/product_import_controller.rb +++ b/app/controllers/admin/product_import_controller.rb @@ -10,6 +10,8 @@ module Admin @product_categories = Spree::Taxon.order('name ASC').pluck(:name).uniq @tax_categories = Spree::TaxCategory.order('name ASC').pluck(:name) @shipping_categories = Spree::ShippingCategory.order('name ASC').pluck(:name) + @producers = OpenFoodNetwork::Permissions.new(spree_current_user). + managed_product_enterprises.is_primary_producer.by_name.to_a end def import diff --git a/app/controllers/admin/products_v3_controller.rb b/app/controllers/admin/products_v3_controller.rb index ede851965d..667706aeba 100644 --- a/app/controllers/admin/products_v3_controller.rb +++ b/app/controllers/admin/products_v3_controller.rb @@ -2,6 +2,138 @@ module Admin class ProductsV3Controller < Spree::Admin::BaseController - def index; end + before_action :init_filters_params + before_action :init_pagination_params + + def index + fetch_products + render "index", locals: { producers:, categories:, flash: } + end + + def bulk_update + product_set = product_set_from_params + + product_set.collection.each { |p| authorize! :update, p } + @products = product_set.collection # use instance variable mainly for testing + + if product_set.save + flash[:success] = I18n.t('admin.products_v3.bulk_update.success') + redirect_to [:index, + { page: @page, per_page: @per_page, search_term: @search_term, + producer_id: @producer_id, category_id: @category_id }] + elsif product_set.errors.present? + @error_counts = { saved: product_set.saved_count, invalid: product_set.invalid.count } + + render "index", status: :unprocessable_entity, locals: { producers:, categories:, flash: } + end + end + + def index_url(params) + "/admin/products?#{params.to_query}" # todo: fix routing so this can be automaticly generated + end + + private + + def init_filters_params + # params comes from the form + # _params comes from the url + # priority is given to params from the form (if present) over url params + @search_term = params[:search_term] || params[:_search_term] + @producer_id = params[:producer_id] || params[:_producer_id] + @category_id = params[:category_id] || params[:_category_id] + end + + def init_pagination_params + # prority is given to element dataset (if present) over url params + @page = params[:page].presence || 1 + @per_page = params[:per_page].presence || 15 + end + + def producers + producers = OpenFoodNetwork::Permissions.new(spree_current_user) + .managed_product_enterprises.is_primary_producer.by_name + producers.map { |p| [p.name, p.id] } + end + + def categories + Spree::Taxon.order(:name).map { |c| [c.name, c.id] } + end + + def fetch_products + product_query = OpenFoodNetwork::Permissions.new(spree_current_user) + .editable_products.merge(product_scope).ransack(ransack_query).result + @pagy, @products = pagy(product_query.order(:name), items: @per_page, page: @page, + size: [1, 2, 2, 1]) + end + + def product_scope + user = spree_current_user + scope = if user.has_spree_role?("admin") || user.enterprises.present? + Spree::Product + else + Spree::Product.active + end + + scope.includes(product_query_includes).distinct + end + + def ransack_query + query = {} + query.merge!(supplier_id_in: @producer_id) if @producer_id.present? + if @search_term.present? + query.merge!(Spree::Variant::SEARCH_KEY => @search_term) + end + query.merge!(variants_primary_taxon_id_in: @category_id) if @category_id.present? + query + end + + # Optimise by pre-loading required columns + def product_query_includes + [ + :image, + :supplier, + { variants: [ + :default_price, + :primary_taxon, + :product, + :stock_items, + :tax_category, + ] }, + ] + end + + # Similar to spree/admin/products_controller + def product_set_from_params + # Form field names: + # '[products][0][id]' (hidden field) + # '[products][0][name]' + # '[products][0][variants_attributes][0][id]' (hidden field) + # '[products][0][variants_attributes][0][display_name]' + # + # Resulting in params: + # "products" => { + # "0" => { + # "id" => "123" + # "name" => "Pommes", + # "variants_attributes" => { + # "0" => { + # "id" => "1234", + # "display_name" => "Large box", + # } + # } + # } + collection_hash = products_bulk_params[:products] + .transform_values { |product| + # Convert variants_attributes form hash to an array if present + product[:variants_attributes] &&= product[:variants_attributes].values + product + }.with_indifferent_access + Sets::ProductSet.new(collection_attributes: collection_hash) + end + + def products_bulk_params + params.permit(products: ::PermittedAttributes::Product.attributes) + .to_h.with_indifferent_access + end end end diff --git a/app/controllers/admin/resource_controller.rb b/app/controllers/admin/resource_controller.rb index b7764d7d50..b47336f0d1 100644 --- a/app/controllers/admin/resource_controller.rb +++ b/app/controllers/admin/resource_controller.rb @@ -229,7 +229,7 @@ module Admin end def member_action? - !collection_actions.include? action + collection_actions.exclude? action end def new_actions diff --git a/app/controllers/admin/stripe_accounts_controller.rb b/app/controllers/admin/stripe_accounts_controller.rb index b72175ac05..3b094adc5e 100644 --- a/app/controllers/admin/stripe_accounts_controller.rb +++ b/app/controllers/admin/stripe_accounts_controller.rb @@ -16,14 +16,14 @@ module Admin authorize! :destroy, stripe_account if stripe_account.deauthorize_and_destroy - flash[:success] = "Stripe account disconnected." + flash[:success] = I18n.t('stripe.success_code.disconnected') else - flash[:error] = "Failed to disconnect Stripe." + flash[:error] = I18n.t('stripe.error_code.disconnect_failure') end redirect_to main_app.edit_admin_enterprise_path(stripe_account.enterprise) rescue ActiveRecord::RecordNotFound - flash[:error] = "Failed to disconnect Stripe." + flash[:error] = I18n.t('stripe.error_code.disconnect_failure') redirect_to spree.admin_dashboard_path end diff --git a/app/controllers/api/v0/order_cycles_controller.rb b/app/controllers/api/v0/order_cycles_controller.rb index 289b0260e4..7bb56ecc56 100644 --- a/app/controllers/api/v0/order_cycles_controller.rb +++ b/app/controllers/api/v0/order_cycles_controller.rb @@ -70,22 +70,7 @@ module Api end def search_params - permitted_search_params = params.slice :q, :page, :per_page - - if permitted_search_params.key? :q - permitted_search_params[:q].slice!(*permitted_ransack_params) - end - - permitted_search_params - end - - def permitted_ransack_params - [ - "#{[:name, :meta_keywords, :variants_display_as, - :variants_display_name, :supplier_name] - .join('_or_')}_cont", - :with_properties, :primary_taxon_id_in_any - ] + params.slice :q, :page, :per_page end def distributor @@ -101,7 +86,8 @@ module Api end def distributed_products - OrderCycleDistributedProducts.new(distributor, order_cycle, customer).products_relation + OrderCycles::DistributedProductsService.new(distributor, order_cycle, + customer).products_relation end end end diff --git a/app/controllers/api/v0/orders_controller.rb b/app/controllers/api/v0/orders_controller.rb index 8570ac3db5..2ffb4304b3 100644 --- a/app/controllers/api/v0/orders_controller.rb +++ b/app/controllers/api/v0/orders_controller.rb @@ -47,7 +47,7 @@ module Api def capture authorize! :admin, order - payment_capture = OrderCaptureService.new(order) + payment_capture = Orders::CaptureService.new(order) if payment_capture.call render json: order.reload, serializer: Api::Admin::OrderSerializer, status: :ok diff --git a/app/controllers/api/v0/shipments_controller.rb b/app/controllers/api/v0/shipments_controller.rb index d742f2c29e..4d3d469597 100644 --- a/app/controllers/api/v0/shipments_controller.rb +++ b/app/controllers/api/v0/shipments_controller.rb @@ -21,7 +21,7 @@ module Api @shipment.refresh_rates @shipment.save! - OrderWorkflow.new(@order).advance_to_payment if @order.line_items.any? + Orders::WorkflowService.new(@order).advance_to_payment if @order.line_items.any? @order.recreate_all_fees! @@ -85,6 +85,8 @@ module Api @order.contents.remove(variant, quantity, @shipment, restock_item) @shipment.reload if @shipment.persisted? + @order.recreate_all_fees! + render json: @shipment, serializer: Api::ShipmentSerializer, status: :ok end diff --git a/app/controllers/api/v1/customers_controller.rb b/app/controllers/api/v1/customers_controller.rb index 3f488251e7..0fe756efc5 100644 --- a/app/controllers/api/v1/customers_controller.rb +++ b/app/controllers/api/v1/customers_controller.rb @@ -59,7 +59,7 @@ module Api def customer @customer ||= if action_name == "show" - CustomersWithBalance.new(Customer.where(id: params[:id])).query.first! + CustomersWithBalanceQuery.new(Customer.where(id: params[:id])).call.first! else Customer.find(params[:id]) end @@ -74,7 +74,7 @@ module Api customers = customers.where(enterprise_id: params[:enterprise_id]) if params[:enterprise_id] if @extra_customer_fields.include?(:balance) - customers = CustomersWithBalance.new(customers).query + customers = CustomersWithBalanceQuery.new(customers).call end customers.ransack(params[:q]).result.order(:id) diff --git a/app/controllers/checkout_controller.rb b/app/controllers/checkout_controller.rb index 3c0254e0e4..efd8e80eeb 100644 --- a/app/controllers/checkout_controller.rb +++ b/app/controllers/checkout_controller.rb @@ -128,7 +128,7 @@ class CheckoutController < BaseController def advance_order_state return if @order.complete? - OrderWorkflow.new(@order).advance_checkout(raw_params.slice(:shipping_method_id)) + Orders::WorkflowService.new(@order).advance_checkout(raw_params.slice(:shipping_method_id)) end def order_params diff --git a/app/controllers/concerns/checkout_callbacks.rb b/app/controllers/concerns/checkout_callbacks.rb index 7da81a592b..c7eb90ebde 100644 --- a/app/controllers/concerns/checkout_callbacks.rb +++ b/app/controllers/concerns/checkout_callbacks.rb @@ -65,7 +65,7 @@ module CheckoutCallbacks def valid_order_line_items? @order.insufficient_stock_lines.empty? && - OrderCycleDistributedVariants.new(@order.order_cycle, @order.distributor). + OrderCycles::DistributedVariantsService.new(@order.order_cycle, @order.distributor). distributes_order_variants?(@order) end diff --git a/app/controllers/concerns/order_completion.rb b/app/controllers/concerns/order_completion.rb index 5e3d2c198c..58bf7a03b9 100644 --- a/app/controllers/concerns/order_completion.rb +++ b/app/controllers/concerns/order_completion.rb @@ -64,7 +64,7 @@ module OrderCompletion return redirect_to order_failed_route(step: 'payment') end - if OrderWorkflow.new(@order).next && @order.complete? + if Orders::WorkflowService.new(@order).next && @order.complete? processing_succeeded redirect_to order_completion_route else diff --git a/app/controllers/concerns/order_stock_check.rb b/app/controllers/concerns/order_stock_check.rb index c979948686..13ff145ae8 100644 --- a/app/controllers/concerns/order_stock_check.rb +++ b/app/controllers/concerns/order_stock_check.rb @@ -6,7 +6,7 @@ module OrderStockCheck def valid_order_line_items? @order.insufficient_stock_lines.empty? && - OrderCycleDistributedVariants.new(@order.order_cycle, @order.distributor). + OrderCycles::DistributedVariantsService.new(@order.order_cycle, @order.distributor). distributes_order_variants?(@order) end diff --git a/app/controllers/enterprises_controller.rb b/app/controllers/enterprises_controller.rb index 1043fdb4c6..bc16d12f18 100644 --- a/app/controllers/enterprises_controller.rb +++ b/app/controllers/enterprises_controller.rb @@ -70,7 +70,7 @@ class EnterprisesController < BaseController order = current_order(true) # reset_distributor must be called before any call to current_customer or current_distributor - order_cart_reset = OrderCartReset.new(order, params[:id]) + order_cart_reset = Orders::CartResetService.new(order, params[:id]) order_cart_reset.reset_distributor order_cart_reset.reset_other!(spree_current_user, current_customer) rescue ActiveRecord::RecordNotFound diff --git a/app/controllers/payment_gateways/stripe_controller.rb b/app/controllers/payment_gateways/stripe_controller.rb index cabf14b4bf..8364e8e376 100644 --- a/app/controllers/payment_gateways/stripe_controller.rb +++ b/app/controllers/payment_gateways/stripe_controller.rb @@ -79,7 +79,7 @@ module PaymentGateways end def last_payment - @last_payment ||= OrderPaymentFinder.new(@order).last_payment + @last_payment ||= Orders::FindPaymentService.new(@order).last_payment end def cancel_incomplete_payments diff --git a/app/controllers/spree/admin/base_controller.rb b/app/controllers/spree/admin/base_controller.rb index c03756814e..f926612ef0 100644 --- a/app/controllers/spree/admin/base_controller.rb +++ b/app/controllers/spree/admin/base_controller.rb @@ -26,7 +26,7 @@ module Spree def warn_invalid_order_cycles return if flash[:notice].present? - warning = OrderCycleWarning.new(spree_current_user).call + warning = OrderCycles::WarningService.new(spree_current_user).call flash[:notice] = warning if warning.present? end diff --git a/app/controllers/spree/admin/invoices_controller.rb b/app/controllers/spree/admin/invoices_controller.rb index e0c01c7bee..701652e031 100644 --- a/app/controllers/spree/admin/invoices_controller.rb +++ b/app/controllers/spree/admin/invoices_controller.rb @@ -21,12 +21,11 @@ module Spree @order = Order.find_by(number: params[:order_id]) if @order.distributor.can_invoice? authorize! :invoice, @order - OrderInvoiceGenerator.new(@order).generate_or_update_latest_invoice + ::Orders::GenerateInvoiceService.new(@order).generate_or_update_latest_invoice else flash[:error] = t(:must_have_valid_business_number, enterprise_name: @order.distributor.name) end - redirect_back(fallback_location: spree.admin_dashboard_path) end diff --git a/app/controllers/spree/admin/orders/customer_details_controller.rb b/app/controllers/spree/admin/orders/customer_details_controller.rb index 7f93651e48..1f67f790df 100644 --- a/app/controllers/spree/admin/orders/customer_details_controller.rb +++ b/app/controllers/spree/admin/orders/customer_details_controller.rb @@ -24,7 +24,7 @@ module Spree end refresh_shipment_rates - OrderWorkflow.new(@order).advance_to_payment + ::Orders::WorkflowService.new(@order).advance_to_payment flash[:success] = Spree.t('customer_details_updated') redirect_to spree.admin_order_customer_path(@order) diff --git a/app/controllers/spree/admin/orders_controller.rb b/app/controllers/spree/admin/orders_controller.rb index 4e2b729dd6..a73adf58c4 100644 --- a/app/controllers/spree/admin/orders_controller.rb +++ b/app/controllers/spree/admin/orders_controller.rb @@ -50,7 +50,7 @@ module Spree return redirect_to spree.edit_admin_order_path(@order) end - OrderWorkflow.new(@order).advance_to_payment + ::Orders::WorkflowService.new(@order).advance_to_payment if @order.complete? redirect_to spree.edit_admin_order_path(@order) @@ -104,7 +104,7 @@ module Spree @order = if params[:invoice_id].present? @order.invoices.find(params[:invoice_id]).presenter else - OrderInvoiceGenerator.new(@order).generate_or_update_latest_invoice + ::Orders::GenerateInvoiceService.new(@order).generate_or_update_latest_invoice @order.invoices.first.presenter end end diff --git a/app/controllers/spree/admin/payments_controller.rb b/app/controllers/spree/admin/payments_controller.rb index 041dacf8d6..0afaa5227c 100644 --- a/app/controllers/spree/admin/payments_controller.rb +++ b/app/controllers/spree/admin/payments_controller.rb @@ -33,7 +33,7 @@ module Spree return end - OrderWorkflow.new(@order).complete! unless @order.completed? + ::Orders::WorkflowService.new(@order).complete! unless @order.completed? authorize_stripe_sca_payment @payment.process_offline! diff --git a/app/controllers/spree/admin/products_controller.rb b/app/controllers/spree/admin/products_controller.rb index e153faff38..32099627d8 100644 --- a/app/controllers/spree/admin/products_controller.rb +++ b/app/controllers/spree/admin/products_controller.rb @@ -175,7 +175,7 @@ module Spree Spree::Variant. select('DISTINCT spree_variants.import_date'). joins(:product). - where('spree_products.supplier_id IN (?)', editable_enterprises.collect(&:id)). + where(spree_products: { supplier_id: editable_enterprises.collect(&:id) }). where.not(spree_variants: { import_date: nil }). where(spree_variants: { deleted_at: nil }). order('spree_variants.import_date DESC') diff --git a/app/controllers/spree/orders_controller.rb b/app/controllers/spree/orders_controller.rb index 113f827628..af0738b17e 100644 --- a/app/controllers/spree/orders_controller.rb +++ b/app/controllers/spree/orders_controller.rb @@ -42,7 +42,7 @@ module Spree # Patching to redirect to shop if order is empty def edit @insufficient_stock_lines = @order.insufficient_stock_lines - @unavailable_order_variants = OrderCycleDistributedVariants. + @unavailable_order_variants = OrderCycles::DistributedVariantsService. new(current_order_cycle, current_distributor).unavailable_order_variants(@order) if @order.line_items.empty? @@ -60,7 +60,7 @@ module Spree @insufficient_stock_lines = [] @order = order_to_update unless @order - flash[:error] = t(:order_not_found) + flash[:error] = t(:order_not_updated) redirect_to(main_app.root_path) && return end @@ -82,7 +82,7 @@ module Spree format.html do if params.key?(:checkout) @order.next_transition.run_callbacks if @order.cart? - redirect_to main_app.checkout_step_path(@order.checkout_steps.first) + redirect_to main_app.checkout_step_path("address") elsif @order.complete? redirect_to main_app.order_path(@order) else @@ -102,7 +102,7 @@ module Spree @order = Spree::Order.find_by!(number: params[:id]) authorize! :cancel, @order - if CustomerOrderCancellation.new(@order).call + if Orders::CustomerCancellationService.new(@order).call flash[:success] = I18n.t(:orders_your_order_has_been_cancelled) else flash[:error] = I18n.t(:orders_could_not_cancel) diff --git a/app/controllers/spree/users_controller.rb b/app/controllers/spree/users_controller.rb index 60b7b33e26..ad4e9082ae 100644 --- a/app/controllers/spree/users_controller.rb +++ b/app/controllers/spree/users_controller.rb @@ -16,7 +16,7 @@ module Spree before_action :set_locale def show - @payments_requiring_action = PaymentsRequiringAction.new(spree_current_user).query + @payments_requiring_action = PaymentsRequiringActionQuery.new(spree_current_user).call @orders = orders_collection.includes(:line_items) customers = spree_current_user.customers @@ -79,7 +79,7 @@ module Spree private def orders_collection - CompleteOrdersWithBalance.new(@user).query + CompleteOrdersWithBalanceQuery.new(@user).call end def load_object diff --git a/app/helpers/admin/injection_helper.rb b/app/helpers/admin/injection_helper.rb index 3585fb0817..54ec2a238a 100644 --- a/app/helpers/admin/injection_helper.rb +++ b/app/helpers/admin/injection_helper.rb @@ -162,7 +162,7 @@ module Admin def admin_inject_available_units admin_inject_json "admin.products", "availableUnits", - Spree::Config.available_units + CurrentConfig.get(:available_units) end def admin_inject_json(ng_module, name, data) diff --git a/app/helpers/checkout_helper.rb b/app/helpers/checkout_helper.rb index eb96a28dd7..393c606ed7 100644 --- a/app/helpers/checkout_helper.rb +++ b/app/helpers/checkout_helper.rb @@ -59,7 +59,7 @@ module CheckoutHelper end def display_checkout_taxes_hash(order) - totals = OrderTaxAdjustmentsFetcher.new(order).totals + totals = Orders::FetchTaxAdjustmentsService.new(order).totals totals.map do |tax_rate, tax_amount| { diff --git a/app/helpers/enterprises_helper.rb b/app/helpers/enterprises_helper.rb index efb09655dd..4a7c6ae817 100644 --- a/app/helpers/enterprises_helper.rb +++ b/app/helpers/enterprises_helper.rb @@ -12,11 +12,11 @@ module EnterprisesHelper end def available_shipping_methods - OrderAvailableShippingMethods.new(current_order, current_customer).to_a + Orders::AvailableShippingMethodsService.new(current_order, current_customer).to_a end def available_payment_methods - OrderAvailablePaymentMethods.new(current_order, current_customer).to_a + Orders::AvailablePaymentMethodsService.new(current_order, current_customer).to_a end def managed_enterprises diff --git a/app/helpers/injection_helper.rb b/app/helpers/injection_helper.rb index cb191f1367..63a0797992 100644 --- a/app/helpers/injection_helper.rb +++ b/app/helpers/injection_helper.rb @@ -154,7 +154,6 @@ module InjectionHelper end def enterprise_injection_data - @enterprise_injection_data ||= OpenFoodNetwork::EnterpriseInjectionData.new - { data: @enterprise_injection_data } + @enterprise_injection_data ||= { data: OpenFoodNetwork::EnterpriseInjectionData.new } end end diff --git a/app/helpers/order_helper.rb b/app/helpers/order_helper.rb index cdafb9f55b..e0d6c65313 100644 --- a/app/helpers/order_helper.rb +++ b/app/helpers/order_helper.rb @@ -2,7 +2,7 @@ module OrderHelper def last_payment_method(order) - OrderPaymentFinder.new(order).last_payment&.payment_method + Orders::FindPaymentService.new(order).last_payment&.payment_method end def outstanding_balance_label(order) @@ -16,6 +16,6 @@ module OrderHelper end def order_comparator(order) - OrderInvoiceComparator.new(order) + Orders::CompareInvoiceService.new(order) end end diff --git a/app/helpers/shared_helper.rb b/app/helpers/shared_helper.rb index 17bd12adbe..63e5498409 100644 --- a/app/helpers/shared_helper.rb +++ b/app/helpers/shared_helper.rb @@ -1,16 +1,6 @@ # frozen_string_literal: true module SharedHelper - def distributor_link_class(distributor) - cart = current_order(true) - @active_distributors ||= Enterprise.distributors_with_active_order_cycles - - klass = "shop-distributor" - klass += " empties-cart" unless cart.line_items.empty? || cart.distributor == distributor - klass += @active_distributors.include?(distributor) ? ' active' : ' inactive' - klass - end - def enterprise_user? spree_current_user&.enterprises&.count.to_i > 0 end diff --git a/app/helpers/spree/admin/base_helper.rb b/app/helpers/spree/admin/base_helper.rb index cf8bb97e6b..4d46a8e297 100644 --- a/app/helpers/spree/admin/base_helper.rb +++ b/app/helpers/spree/admin/base_helper.rb @@ -12,7 +12,7 @@ module Spree id: "#{model}_#{method}_field") end - def error_message_on(object, method, _options = {}) + def error_message_on(object, method, options = {}) object = convert_to_model(object) obj = object.respond_to?(:errors) ? object : instance_variable_get("@#{object}") @@ -20,7 +20,7 @@ module Spree # rubocop:disable Rails/OutputSafety errors = obj.errors[method].map { |err| h(err) }.join('
').html_safe # rubocop:enable Rails/OutputSafety - content_tag(:span, errors, class: 'formError') + content_tag(:span, errors, class: 'formError', **options) else '' end @@ -33,8 +33,6 @@ module Spree when :boolean hidden_field_tag(name, 0) + check_box_tag(name, 1, value, preference_field_options(options)) - when :string - text_field_tag(name, value, preference_field_options(options)) when :password password_field_tag(name, value, preference_field_options(options)) when :text @@ -88,8 +86,6 @@ module Spree { size: 10, class: 'input_integer', step: :any } when :boolean {} - when :string - { size: 10, class: 'input_string fullwidth' } when :password { size: 10, class: 'password_string fullwidth' } when :text diff --git a/app/helpers/spree/admin/orders_helper.rb b/app/helpers/spree/admin/orders_helper.rb index 893a417297..71970c53d3 100644 --- a/app/helpers/spree/admin/orders_helper.rb +++ b/app/helpers/spree/admin/orders_helper.rb @@ -3,20 +3,20 @@ module Spree module Admin module OrdersHelper - def event_links + def event_links(order) links = [] - links << cancel_event_link if @order.can_cancel? - links << resume_event_link if @order.can_resume? + links << cancel_event_link(order) if order.can_cancel? + links << resume_event_link(order) if order.can_resume? links.join(' ').html_safe # rubocop:disable Rails/OutputSafety end def generate_invoice_button(order) if order.distributor.can_invoice? - button_link_to t(:create_or_update_invoice), generate_admin_order_invoices_path(@order), + button_link_to t(:create_or_update_invoice), generate_admin_order_invoices_path(order), data: { method: 'post' }, icon: 'icon-plus' else button_link_to t(:create_or_update_invoice), "#", data: { - confirm: t(:must_have_valid_business_number, enterprise_name: @order.distributor.name) + confirm: t(:must_have_valid_business_number, enterprise_name: order.distributor.name) }, icon: 'icon-plus' end end @@ -26,82 +26,81 @@ module Spree end def order_links(order) - @order ||= order links = [] - links << edit_order_link unless action_name == "edit" - links.concat(complete_order_links) if @order.complete? || @order.resumed? - links << ship_order_link if @order.ready_to_ship? - links << cancel_order_link if @order.can_cancel? + links << edit_order_link(order) unless action_name == "edit" + links.concat(complete_order_links(order)) if order.complete? || order.resumed? + links << ship_order_link if order.ready_to_ship? + links << cancel_order_link(order) if order.can_cancel? links end private - def complete_order_links - [resend_confirmation_link] + invoice_links + def complete_order_links(order) + [resend_confirmation_link(order)] + invoice_links(order) end - def invoice_links + def invoice_links(order) return [] unless Spree::Config[:enable_invoices?] - [send_invoice_link, print_invoice_link] + [send_invoice_link(order), print_invoice_link(order)] end - def send_invoice_link - if @order.distributor.can_invoice? - send_invoice_link_with_url + def send_invoice_link(order) + if order.distributor.can_invoice? + send_invoice_link_with_url(order) else - send_invoice_link_without_url + send_invoice_link_without_url(order) end end - def print_invoice_link - if @order.distributor.can_invoice? - print_invoice_link_with_url + def print_invoice_link(order) + if order.distributor.can_invoice? + print_invoice_link_with_url(order) else - notify_about_required_enterprise_number + notify_about_required_enterprise_number(order) end end - def edit_order_link + def edit_order_link(order) { name: t(:edit_order), - url: spree.edit_admin_order_path(@order), + url: spree.edit_admin_order_path(order), icon: 'icon-edit' } end - def resend_confirmation_link + def resend_confirmation_link(order) { name: t(:resend_confirmation), - url: spree.resend_admin_order_path(@order), + url: spree.resend_admin_order_path(order), icon: 'icon-email', confirm: t(:confirm_resend_order_confirmation) } end - def send_invoice_link_with_url + def send_invoice_link_with_url(order) { name: t(:send_invoice), - url: invoice_admin_order_path(@order), + url: invoice_admin_order_path(order), icon: 'icon-email', confirm: t(:confirm_send_invoice) } end - def send_invoice_link_without_url + def send_invoice_link_without_url(order) { name: t(:send_invoice), url: "#", icon: 'icon-email', - confirm: t(:must_have_valid_business_number, enterprise_name: @order.distributor.name) } + confirm: t(:must_have_valid_business_number, enterprise_name: order.distributor.name) } end - def print_invoice_link_with_url + def print_invoice_link_with_url(order) { name: t(:print_invoice), - url: spree.print_admin_order_path(@order), + url: spree.print_admin_order_path(order), icon: 'icon-print', target: "_blank" } end - def notify_about_required_enterprise_number + def notify_about_required_enterprise_number(order) { name: t(:print_invoice), url: "#", icon: 'icon-print', - confirm: t(:must_have_valid_business_number, enterprise_name: @order.distributor.name) } + confirm: t(:must_have_valid_business_number, enterprise_name: order.distributor.name) } end def ship_order_link @@ -110,24 +109,24 @@ module Spree icon: 'icon-truck' } end - def cancel_order_link + def cancel_order_link(order) { name: t(:cancel_order), - url: spree.fire_admin_order_path(@order.number, e: 'cancel'), + url: spree.fire_admin_order_path(order.number, e: 'cancel'), icon: 'icon-trash' } end - def cancel_event_link + def cancel_event_link(order) event_label = I18n.t("cancel", scope: "actions") button_link_to(event_label, - fire_admin_order_url(@order, e: "cancel"), + fire_admin_order_url(order, e: "cancel"), method: :put, icon: "icon-cancel", form_id: "cancel_order_form") end - def resume_event_link + def resume_event_link(order) event_label = I18n.t("resume", scope: "actions") confirm_message = I18n.t("admin.orders.edit.order_sure_want_to", event: event_label) button_link_to(event_label, - fire_admin_order_url(@order, e: "resume"), + fire_admin_order_url(order, e: "resume"), method: :put, icon: "icon-resume", data: { confirm: confirm_message }) end diff --git a/app/helpers/spree/orders_helper.rb b/app/helpers/spree/orders_helper.rb index 63a4682bc2..d3d1a155c1 100644 --- a/app/helpers/spree/orders_helper.rb +++ b/app/helpers/spree/orders_helper.rb @@ -17,17 +17,18 @@ module Spree def changeable_orders # Only returns open order for the current user + shop + oc combo - return @changeable_orders unless @changeable_orders.nil? - return @changeable_orders = [] unless spree_current_user && - current_distributor && current_order_cycle - return @changeable_orders = [] unless current_distributor.allow_order_changes? + @changeable_orders ||= if spree_current_user && + current_order_cycle && current_distributor&.allow_order_changes? - @changeable_orders = Spree::Order.complete.where( - state: 'complete', - user_id: spree_current_user.id, - distributor_id: current_distributor.id, - order_cycle_id: current_order_cycle.id - ) + Spree::Order.complete.where( + state: 'complete', + user_id: spree_current_user.id, + distributor_id: current_distributor.id, + order_cycle_id: current_order_cycle.id + ) + else + [] + end end def changeable_orders_link_path diff --git a/app/jobs/bulk_invoice_job.rb b/app/jobs/bulk_invoice_job.rb index 3c360005fa..c77eb077f9 100644 --- a/app/jobs/bulk_invoice_job.rb +++ b/app/jobs/bulk_invoice_job.rb @@ -7,9 +7,10 @@ class BulkInvoiceJob < ApplicationJob def perform(order_ids, filepath, options = {}) @options = options - orders = sorted_orders(order_ids) - orders.filter!(&:invoiceable?) if OpenFoodNetwork::FeatureToggle.enabled?(:invoices, - current_user) + + # The `find` method returns records in the same order as the given ids. + orders = Spree::Order.find(order_ids) + orders.each(&method(:generate_invoice)) ensure_directory_exists filepath @@ -21,19 +22,13 @@ class BulkInvoiceJob < ApplicationJob private - # Ensures the records are returned in the same order the ids were originally given in - def sorted_orders(order_ids) - orders_by_id = Spree::Order.where(id: order_ids).to_a.index_by(&:id) - order_ids.map { |id| orders_by_id[id.to_i] } - end - def renderer @renderer ||= InvoiceRenderer.new end def generate_invoice(order) renderer_data = if OpenFoodNetwork::FeatureToggle.enabled?(:invoices, current_user) - OrderInvoiceGenerator.new(order).generate_or_update_latest_invoice + Orders::GenerateInvoiceService.new(order).generate_or_update_latest_invoice order.invoices.first.presenter else order diff --git a/app/jobs/connect_app_job.rb b/app/jobs/connect_app_job.rb index 9ecfad4cd7..43d273f155 100644 --- a/app/jobs/connect_app_job.rb +++ b/app/jobs/connect_app_job.rb @@ -4,7 +4,7 @@ class ConnectAppJob < ApplicationJob include CableReady::Broadcaster def perform(app, token, channel: nil) - url = "https://n8n.openfoodnetwork.org.uk/webhook/regen/connect-enterprise" + url = I18n.t("connect_app.url") event = "connect-app" enterprise = app.enterprise payload = { diff --git a/app/jobs/order_cycle_opened_job.rb b/app/jobs/order_cycle_opened_job.rb index 9d84027fe3..3b4cee16db 100644 --- a/app/jobs/order_cycle_opened_job.rb +++ b/app/jobs/order_cycle_opened_job.rb @@ -5,7 +5,7 @@ class OrderCycleOpenedJob < ApplicationJob def perform ActiveRecord::Base.transaction do recently_opened_order_cycles.find_each do |order_cycle| - OrderCycleWebhookService.create_webhook_job(order_cycle, 'order_cycle.opened') + OrderCycles::WebhookService.create_webhook_job(order_cycle, 'order_cycle.opened') end mark_as_opened(recently_opened_order_cycles) end diff --git a/app/jobs/subscription_confirm_job.rb b/app/jobs/subscription_confirm_job.rb index 8f67005c74..4a7e69a384 100644 --- a/app/jobs/subscription_confirm_job.rb +++ b/app/jobs/subscription_confirm_job.rb @@ -23,7 +23,7 @@ class SubscriptionConfirmJob < ApplicationJob unconfirmed_proxy_orders.update_all(confirmed_at: Time.zone.now) # Confirm these proxy orders - ProxyOrder.where(id: unconfirmed_proxy_orders_ids).each do |proxy_order| + ProxyOrder.where(id: unconfirmed_proxy_orders_ids).find_each do |proxy_order| JobLogger.logger.info "Confirming Order for Proxy Order #{proxy_order.id}" confirm_order!(proxy_order.order) end diff --git a/app/mailers/producer_mailer.rb b/app/mailers/producer_mailer.rb index f4dcb334e7..4752141c42 100644 --- a/app/mailers/producer_mailer.rb +++ b/app/mailers/producer_mailer.rb @@ -52,7 +52,7 @@ class ProducerMailer < ApplicationMailer def distributors_pickup_times_for(line_items) @order_cycle.distributors. joins(:distributed_orders). - where("spree_orders.id IN (?)", line_items.map(&:order_id).uniq). + where(spree_orders: { id: line_items.map(&:order_id).uniq }). map do |distributor| [distributor.name, @order_cycle.pickup_time_for(distributor)] end diff --git a/app/mailers/spree/order_mailer.rb b/app/mailers/spree/order_mailer.rb index e3430c7787..97ffd3f6b1 100644 --- a/app/mailers/spree/order_mailer.rb +++ b/app/mailers/spree/order_mailer.rb @@ -52,7 +52,8 @@ module Spree find_user(options[:current_user_id]) end renderer_data = if OpenFoodNetwork::FeatureToggle.enabled?(:invoices, current_user) - OrderInvoiceGenerator.new(@order).generate_or_update_latest_invoice + ::Orders::GenerateInvoiceService + .new(@order).generate_or_update_latest_invoice @order.invoices.first.presenter else @order diff --git a/app/models/calculator/weight.rb b/app/models/calculator/weight.rb index c4b6534ef8..4fdebf72d3 100644 --- a/app/models/calculator/weight.rb +++ b/app/models/calculator/weight.rb @@ -10,7 +10,7 @@ module Calculator end def set_preference(name, value) - if name == :unit_from_list && !["kg", "lb"].include?(value) + if name == :unit_from_list && ["kg", "lb"].exclude?(value) calculable.errors.add(:preferred_unit_from_list, I18n.t(:calculator_preferred_unit_error)) else __send__ self.class.preference_setter_method(name), value diff --git a/app/models/concerns/order_validations.rb b/app/models/concerns/order_validations.rb index 36733f5c35..52aa257b5f 100644 --- a/app/models/concerns/order_validations.rb +++ b/app/models/concerns/order_validations.rb @@ -15,7 +15,7 @@ module OrderValidations # Check that line_items in the current order are available from a newly selected distribution def products_available_from_new_distribution - return if OrderCycleDistributedVariants.new(order_cycle, distributor) + return if OrderCycles::DistributedVariantsService.new(order_cycle, distributor) .distributes_order_variants?(self) errors.add(:base, I18n.t(:spree_order_availability_error)) diff --git a/app/models/current_config.rb b/app/models/current_config.rb new file mode 100644 index 0000000000..ca79a5dfdf --- /dev/null +++ b/app/models/current_config.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Wraps repeatedly-called configs in a CurrentAttributes object so they only get fetched once +# per request at most, eg: CurrentConfig.get(:available_units) for Spree::Config[:available_units] + +class CurrentConfig < ActiveSupport::CurrentAttributes + attribute :display_currency, :hide_cents, :currency_decimal_mark, + :currency_thousands_separator, :currency_symbol_position, :available_units + + def get(config_key) + return public_send(config_key) unless public_send(config_key).nil? + + public_send("#{config_key}=", Spree::Config.public_send(config_key)) + end + + def currency + ENV.fetch("CURRENCY") + end +end diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index 7f9ab5a965..22a18473a9 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -161,7 +161,7 @@ class Enterprise < ApplicationRecord scope :is_hub, -> { where(sells: 'any') } scope :supplying_variant_in, lambda { |variants| joins(supplied_products: :variants). - where('spree_variants.id IN (?)', variants). + where(spree_variants: { id: variants }). select('DISTINCT enterprises.*') } @@ -205,7 +205,7 @@ class Enterprise < ApplicationRecord "). joins('INNER JOIN exchange_variants ON (exchange_variants.exchange_id = exchanges.id)'). joins('INNER JOIN spree_variants ON (spree_variants.id = exchange_variants.variant_id)'). - where('spree_variants.product_id IN (?)', product_ids).select('DISTINCT enterprises.id') + where(spree_variants: { product_id: product_ids }).select('DISTINCT enterprises.id') where(id: exchanges) } @@ -214,7 +214,7 @@ class Enterprise < ApplicationRecord if user.has_spree_role?('admin') where(nil) else - joins(:enterprise_roles).where('enterprise_roles.user_id = ?', user.id) + joins(:enterprise_roles).where(enterprise_roles: { user_id: user.id }) end } @@ -369,10 +369,10 @@ class Enterprise < ApplicationRecord :producer_shop # Producer with shopfront and supplies other hubs. when "producer_sells_none" :producer # Producer only supplies through others. - when "non_producer_sells_any" - :hub # Hub selling others products in order cycles. - when "non_producer_sells_own" - :hub # Wholesaler selling through own shopfront? Does this need a separate name or even exist? + when "non_producer_sells_any", "non_producer_sells_own" + # Hub selling others products in order cycles + # Or Wholesaler selling through own shopfront? Does this need a separate name or even exist? + :hub when "non_producer_sells_none" :hub_profile # Hub selling outside the system. end @@ -382,7 +382,7 @@ class Enterprise < ApplicationRecord def distributed_taxons Spree::Taxon. joins(:products). - where('spree_products.id IN (?)', Spree::Product.in_distributor(self).select(&:id)). + where(spree_products: { id: Spree::Product.in_distributor(self).select(&:id) }). select('DISTINCT spree_taxons.*') end @@ -398,7 +398,7 @@ class Enterprise < ApplicationRecord def supplied_taxons Spree::Taxon. joins(:products). - where('spree_products.id IN (?)', Spree::Product.in_supplier(self).select(&:id)). + where(spree_products: { id: Spree::Product.in_supplier(self).select(&:id) }). select('DISTINCT spree_taxons.*') end @@ -472,7 +472,7 @@ class Enterprise < ApplicationRecord ExchangeVariant.joins(exchange: :order_cycle) .merge(Exchange.outgoing) .select("DISTINCT exchange_variants.variant_id, exchanges.receiver_id AS enterprise_id") - .where("exchanges.receiver_id = ?", id) + .where(exchanges: { receiver_id: id }) .merge(OrderCycle.active.with_distributor(id)) end diff --git a/app/models/enterprise_fee.rb b/app/models/enterprise_fee.rb index 9c22754919..a4bcdd272d 100644 --- a/app/models/enterprise_fee.rb +++ b/app/models/enterprise_fee.rb @@ -32,7 +32,7 @@ class EnterpriseFee < ApplicationRecord if user.has_spree_role?('admin') where(nil) else - where('enterprise_id IN (?)', user.enterprises.select(&:id)) + where(enterprise_id: user.enterprises.select(&:id)) end } @@ -40,7 +40,7 @@ class EnterpriseFee < ApplicationRecord joins(:calculator).where.not(spree_calculators: { type: PER_ORDER_CALCULATORS }) } scope :per_order, lambda { - joins(:calculator).where('spree_calculators.type IN (?)', PER_ORDER_CALCULATORS) + joins(:calculator).where(spree_calculators: { type: PER_ORDER_CALCULATORS }) } def self.clear_all_adjustments(order) diff --git a/app/models/enterprise_group.rb b/app/models/enterprise_group.rb index 91be3db4fd..c6160fb404 100644 --- a/app/models/enterprise_group.rb +++ b/app/models/enterprise_group.rb @@ -41,7 +41,7 @@ class EnterpriseGroup < ApplicationRecord if user.has_spree_role?('admin') where(nil) else - where('owner_id = ?', user.id) + where(owner_id: user.id) end } diff --git a/app/models/enterprise_relationship.rb b/app/models/enterprise_relationship.rb index 3e673eab34..29cd043f9a 100644 --- a/app/models/enterprise_relationship.rb +++ b/app/models/enterprise_relationship.rb @@ -27,12 +27,12 @@ class EnterpriseRelationship < ApplicationRecord where('parent_id IN (?) OR child_id IN (?)', enterprises.select(&:id), enterprises.select(&:id)) } - scope :permitting, ->(enterprise_ids) { where('child_id IN (?)', enterprise_ids) } - scope :permitted_by, ->(enterprise_ids) { where('parent_id IN (?)', enterprise_ids) } + scope :permitting, ->(enterprise_ids) { where(child_id: enterprise_ids) } + scope :permitted_by, ->(enterprise_ids) { where(parent_id: enterprise_ids) } scope :with_permission, ->(permission) { joins(:permissions). - where('enterprise_relationship_permissions.name = ?', permission) + where(enterprise_relationship_permissions: { name: permission }) } scope :by_name, -> { with_enterprises.order('child_enterprises.name, parent_enterprises.name') } @@ -108,6 +108,6 @@ class EnterpriseRelationship < ApplicationRecord def child_variant_overrides VariantOverride.unscoped.for_hubs(child) - .joins(variant: :product).where("spree_products.supplier_id IN (?)", parent) + .joins(variant: :product).where(spree_products: { supplier_id: parent }) end end diff --git a/app/models/exchange.rb b/app/models/exchange.rb index d349679dc1..796a251ed1 100644 --- a/app/models/exchange.rb +++ b/app/models/exchange.rb @@ -38,8 +38,8 @@ class Exchange < ApplicationRecord scope :outgoing, -> { where(incoming: false) } scope :from_enterprise, lambda { |enterprise| where(sender_id: enterprise) } scope :to_enterprise, lambda { |enterprise| where(receiver_id: enterprise) } - scope :from_enterprises, lambda { |enterprises| where('exchanges.sender_id IN (?)', enterprises) } - scope :to_enterprises, lambda { |enterprises| where('exchanges.receiver_id IN (?)', enterprises) } + scope :from_enterprises, lambda { |enterprises| where(exchanges: { sender_id: enterprises }) } + scope :to_enterprises, lambda { |enterprises| where(exchanges: { receiver_id: enterprises }) } scope :involving, lambda { |enterprises| where('exchanges.receiver_id IN (?) OR exchanges.sender_id IN (?)', enterprises, enterprises). select('DISTINCT exchanges.*') @@ -48,7 +48,7 @@ class Exchange < ApplicationRecord where('exchanges.incoming OR exchanges.receiver_id = ?', distributor) } scope :with_variant, lambda { |variant| - joins(:exchange_variants).where('exchange_variants.variant_id = ?', variant) + joins(:exchange_variants).where(exchange_variants: { variant_id: variant }) } scope :with_any_variant, lambda { |variant_ids| joins(:exchange_variants). @@ -57,7 +57,7 @@ class Exchange < ApplicationRecord } scope :with_product, lambda { |product| joins(:exchange_variants). - where('exchange_variants.variant_id IN (?)', product.variants.select(&:id)) + where(exchange_variants: { variant_id: product.variants.select(&:id) }) } scope :by_enterprise_name, -> { joins('INNER JOIN enterprises AS sender ON (sender.id = exchanges.sender_id)'). diff --git a/app/models/invoice.rb b/app/models/invoice.rb index 55524521b2..7cfc71c9a6 100644 --- a/app/models/invoice.rb +++ b/app/models/invoice.rb @@ -4,7 +4,7 @@ class Invoice < ApplicationRecord self.belongs_to_required_by_default = false belongs_to :order, class_name: 'Spree::Order' - serialize :data, Hash + serialize :data, Hash, coder: YAML before_validation :serialize_order after_create :cancel_previous_invoices default_scope { order(created_at: :desc) } diff --git a/app/models/invoice/data_presenter.rb b/app/models/invoice/data_presenter.rb index 8c5c4dbbab..f45e35612b 100644 --- a/app/models/invoice/data_presenter.rb +++ b/app/models/invoice/data_presenter.rb @@ -91,6 +91,14 @@ class Invoice Spree::Money.new(shipment.amount + shipment.additional_tax_total, currency:) end + def display_line_item_tax_rate(item) + all_tax_adjustments.select { |a| + a.adjustable.type == 'Spree::LineItem' && a.adjustable.id == item.id + }.map(&:originator).map { |tr| + number_to_percentage(tr.amount * 100, precision: 1) + }.join(", ") + end + def display_shipment_tax_rates all_eligible_adjustments.select { |a| a.originator.type == 'Spree::TaxRate' && a.adjustable_type == 'Spree::Shipment' diff --git a/app/models/invoice/data_presenter/line_item.rb b/app/models/invoice/data_presenter/line_item.rb index 2b43a1a4d8..2b55cca925 100644 --- a/app/models/invoice/data_presenter/line_item.rb +++ b/app/models/invoice/data_presenter/line_item.rb @@ -3,11 +3,10 @@ class Invoice class DataPresenter class LineItem < Invoice::DataPresenter::Base - attributes :added_tax, :currency, :included_tax, :price_with_adjustments, :quantity, + attributes :id, :added_tax, :currency, :included_tax, :price_with_adjustments, :quantity, :variant_id, :unit_price_price_and_unit, :unit_presentation, :enterprise_fee_additional_tax, :enterprise_fee_included_tax attributes_with_presenter :variant - array_attribute :tax_rates, class_name: 'TaxRate' invoice_generation_attributes :added_tax, :included_tax, :price_with_adjustments, :quantity, :variant_id @@ -35,10 +34,6 @@ class Invoice fee_tax = enterprise_fee_included_tax || 0.0 Spree::Money.new(price_with_adjustments - ((included_tax + fee_tax) / quantity), currency:) end - - def display_line_item_tax_rates - tax_rates.map { |tr| number_to_percentage(tr.amount * 100, precision: 1) }.join(", ") - end end end end diff --git a/app/models/order_cycle.rb b/app/models/order_cycle.rb index b6e7d80913..e6b0d1dff1 100644 --- a/app/models/order_cycle.rb +++ b/app/models/order_cycle.rb @@ -165,17 +165,17 @@ class OrderCycle < ApplicationRecord def attachable_distributor_payment_methods DistributorPaymentMethod.joins(:payment_method). merge(Spree::PaymentMethod.available). - where("distributor_id IN (?)", distributor_ids) + where(distributor_id: distributor_ids) end def attachable_distributor_shipping_methods DistributorShippingMethod.joins(:shipping_method). merge(Spree::ShippingMethod.frontend). - where("distributor_id IN (?)", distributor_ids) + where(distributor_id: distributor_ids) end def clone! - OrderCycleClone.new(self).create + OrderCycles::CloneService.new(self).create end def variants diff --git a/app/models/product_import/entry_processor.rb b/app/models/product_import/entry_processor.rb index d2603e2762..05bc462eff 100644 --- a/app/models/product_import/entry_processor.rb +++ b/app/models/product_import/entry_processor.rb @@ -56,7 +56,7 @@ module ProductImport else Spree::Variant. joins(:product). - where('spree_products.supplier_id IN (?)', enterprise_id). + where(spree_products: { supplier_id: enterprise_id }). count end diff --git a/app/models/product_import/entry_validator.rb b/app/models/product_import/entry_validator.rb index 9eaed6034a..34369fe44d 100644 --- a/app/models/product_import/entry_validator.rb +++ b/app/models/product_import/entry_validator.rb @@ -24,7 +24,6 @@ module ProductImport def self.non_updatable_fields { - category: :primary_taxon_id, description: :description, unit_type: :variant_unit_scale, variant_unit_name: :variant_unit_name, @@ -69,7 +68,7 @@ module ProductImport def mark_as_new_variant(entry, product_id) variant_attributes = entry.assignable_attributes.except( 'id', 'product_id', 'on_hand', 'on_demand', 'variant_unit', 'variant_unit_name', - 'variant_unit_scale', 'primary_taxon_id' + 'variant_unit_scale' ) # Variant needs a product. Product needs to be assigned first in order for # delegate to work. name= will fail otherwise. @@ -398,7 +397,7 @@ module ProductImport def mark_as_existing_variant(entry, existing_variant) existing_variant.assign_attributes( entry.assignable_attributes.except('id', 'product_id', 'variant_unit', 'variant_unit_name', - 'variant_unit_scale', 'primary_taxon_id') + 'variant_unit_scale') ) check_on_hand_nil(entry, existing_variant) diff --git a/app/models/product_import/spreadsheet_entry.rb b/app/models/product_import/spreadsheet_entry.rb index 2dd9a42418..a46d061ee7 100644 --- a/app/models/product_import/spreadsheet_entry.rb +++ b/app/models/product_import/spreadsheet_entry.rb @@ -94,7 +94,7 @@ module ProductImport units = UnitConverter.new(attrs) units.converted_attributes.each do |attr, value| - if respond_to?("#{attr}=") && !NON_PRODUCT_ATTRIBUTES.include?(attr) + if respond_to?("#{attr}=") && NON_PRODUCT_ATTRIBUTES.exclude?(attr) public_send("#{attr}=", value) end end diff --git a/app/models/proxy_order.rb b/app/models/proxy_order.rb index 449478b44e..5a017bb1e6 100644 --- a/app/models/proxy_order.rb +++ b/app/models/proxy_order.rb @@ -17,7 +17,7 @@ class ProxyOrder < ApplicationRecord scope :closed, -> { joins(:order_cycle).merge(OrderCycle.closed) } scope :not_closed, -> { joins(:order_cycle).merge(OrderCycle.not_closed) } scope :canceled, -> { where.not(proxy_orders: { canceled_at: nil }) } - scope :not_canceled, -> { where('proxy_orders.canceled_at IS NULL') } + scope :not_canceled, -> { where(proxy_orders: { canceled_at: nil }) } scope :placed_and_open, -> { joins(:order).not_closed .where(spree_orders: { state: ['complete', 'resumed'] }) @@ -58,7 +58,7 @@ class ProxyOrder < ApplicationRecord def initialise_order! return order if order.present? - factory = OrderFactory.new(order_attrs, skip_stock_check: true) + factory = Orders::FactoryService.new(order_attrs, skip_stock_check: true) self.order = factory.create save! order diff --git a/app/models/report_rendering_options.rb b/app/models/report_rendering_options.rb index feadbaf7ff..dd69ecf887 100644 --- a/app/models/report_rendering_options.rb +++ b/app/models/report_rendering_options.rb @@ -4,5 +4,5 @@ class ReportRenderingOptions < ApplicationRecord self.belongs_to_required_by_default = false belongs_to :user, class_name: "Spree::User" - serialize :options, Hash + serialize :options, Hash, coder: YAML end diff --git a/app/models/schedule.rb b/app/models/schedule.rb index 3ab11d1a0b..dd7499ec45 100644 --- a/app/models/schedule.rb +++ b/app/models/schedule.rb @@ -8,7 +8,8 @@ class Schedule < ApplicationRecord has_many :coordinators, -> { distinct }, through: :order_cycles scope :with_coordinator, lambda { |enterprise| - joins(:order_cycles).where('coordinator_id = ?', enterprise.id) + joins(:order_cycles) + .where(order_cycles: { coordinator_id: enterprise.id }) .select('DISTINCT schedules.*') } diff --git a/app/models/semantic_link.rb b/app/models/semantic_link.rb new file mode 100644 index 0000000000..ea8fa0bdba --- /dev/null +++ b/app/models/semantic_link.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +# Link a Spree::Variant to an external DFC SuppliedProduct. +class SemanticLink < ApplicationRecord + belongs_to :variant, class_name: "Spree::Variant" + + validates :semantic_id, presence: true +end diff --git a/app/models/spree/ability.rb b/app/models/spree/ability.rb index 127b9c2766..037bfecdb6 100644 --- a/app/models/spree/ability.rb +++ b/app/models/spree/ability.rb @@ -239,6 +239,8 @@ module Spree can [:admin, :index, :guide, :import, :save, :save_data, :validate_data, :reset_absent_products], ProductImport::ProductImporter + can [:admin, :index], ::Admin::DfcProductImportsController + # Reports page can [:admin, :index, :show], ::Admin::ReportsController can [:admin, :show, :customers, :orders_and_distributors, :group_buys, :payments, diff --git a/app/models/spree/adjustment.rb b/app/models/spree/adjustment.rb index 90d2cca514..e3165f3ca9 100644 --- a/app/models/spree/adjustment.rb +++ b/app/models/spree/adjustment.rb @@ -120,7 +120,7 @@ module Spree end def currency - adjustable ? adjustable.currency : Spree::Config[:currency] + adjustable ? adjustable.currency : CurrentConfig.get(:currency) end def display_amount diff --git a/app/models/spree/calculator.rb b/app/models/spree/calculator.rb index 9ff0e53651..7c1f11c274 100644 --- a/app/models/spree/calculator.rb +++ b/app/models/spree/calculator.rb @@ -44,9 +44,9 @@ module Spree # Given an object which might be an Order or a LineItem (amongst # others), return a collection of line items. def line_items_for(object) - if object.is_a?(Spree::LineItem) - [object] - elsif object.respond_to? :line_items + return [object] if object.is_a?(Spree::LineItem) + + if object.respond_to? :line_items object.line_items elsif object.respond_to?(:order) && object.order.present? object.order.line_items diff --git a/app/models/spree/credit_card.rb b/app/models/spree/credit_card.rb index 5949023cb5..35a43ee828 100644 --- a/app/models/spree/credit_card.rb +++ b/app/models/spree/credit_card.rb @@ -152,7 +152,7 @@ module Spree end def default_missing? - !user.credit_cards.exists?(is_default: true) + !user.credit_cards.where(is_default: true).exists? end def default_card_needs_updating? diff --git a/app/models/spree/line_item.rb b/app/models/spree/line_item.rb index c2810cbcb8..74d3acdc7e 100644 --- a/app/models/spree/line_item.rb +++ b/app/models/spree/line_item.rb @@ -85,7 +85,7 @@ module Spree scope :from_order_cycle, lambda { |order_cycle| joins(order: :order_cycle). - where('order_cycles.id = ?', order_cycle) + where(order_cycles: { id: order_cycle }) } # Here we are simply joining the line item to its variant and product @@ -94,12 +94,12 @@ module Spree scope :supplied_by_any, lambda { |enterprises| product_ids = Spree::Product.unscoped.where(supplier_id: enterprises).select(:id) variant_ids = Spree::Variant.unscoped.where(product_id: product_ids).select(:id) - where("spree_line_items.variant_id IN (?)", variant_ids) + where(spree_line_items: { variant_id: variant_ids }) } scope :with_tax, -> { joins(:adjustments). - where('spree_adjustments.originator_type = ?', 'Spree::TaxRate'). + where(spree_adjustments: { originator_type: 'Spree::TaxRate' }). select('DISTINCT spree_line_items.*') } @@ -110,7 +110,7 @@ module Spree ON (spree_adjustments.adjustable_id=spree_line_items.id AND spree_adjustments.adjustable_type = 'Spree::LineItem' AND spree_adjustments.originator_type='Spree::TaxRate')"). - where('spree_adjustments.id IS NULL') + where(spree_adjustments: { id: nil }) } def copy_price @@ -193,6 +193,7 @@ module Spree adjustments.tax.additional.sum(:amount) end + # Some of the tax rates may not be applicable depending to the order's tax zone def tax_rates variant&.tax_category&.tax_rates || [] end diff --git a/app/models/spree/order.rb b/app/models/spree/order.rb index a663b9b9c8..03fdf5208c 100644 --- a/app/models/spree/order.rb +++ b/app/models/spree/order.rb @@ -141,7 +141,7 @@ module Spree if user.has_spree_role?('admin') where(nil) else - where('spree_orders.distributor_id IN (?)', user.enterprises.select(&:id)) + where(spree_orders: { distributor_id: user.enterprises.select(&:id) }) end } @@ -165,6 +165,7 @@ module Spree scope :finalized, -> { where(state: FINALIZED_STATES) } scope :complete, -> { where.not(completed_at: nil) } scope :incomplete, -> { where(completed_at: nil) } + scope :invoiceable, -> { where(state: [:complete, :resumed]) } scope :by_state, lambda { |state| where(state:) } scope :not_state, lambda { |state| where.not(state:) } @@ -186,7 +187,7 @@ module Spree end def currency - self[:currency] || Spree::Config[:currency] + self[:currency] || CurrentConfig.get(:currency) end def display_item_total @@ -213,10 +214,6 @@ module Spree completed_at.present? end - def invoiceable? - complete? || resumed? - end - # Indicates whether or not the user is allowed to proceed to checkout. # Currently this is implemented as a check for whether or not there is at # least one LineItem in the Order. Feel free to override this logic in your @@ -652,7 +649,7 @@ module Spree end def fee_handler - @fee_handler ||= OrderFeesHandler.new(self) + @fee_handler ||= Orders::HandleFeesService.new(self) end def clear_legacy_taxes! @@ -689,7 +686,7 @@ module Spree end def set_currency - self.currency = Spree::Config[:currency] if self[:currency].nil? + self.currency = CurrentConfig.get(:currency) if self[:currency].nil? end def using_guest_checkout? @@ -697,11 +694,11 @@ module Spree end def registered_email? - Spree::User.exists?(email:) + Spree::User.where(email:).exists? end def adjustments_fetcher - @adjustments_fetcher ||= OrderAdjustmentsFetcher.new(self) + @adjustments_fetcher ||= Orders::FetchAdjustmentsService.new(self) end def skip_payment_for_subscription? diff --git a/app/models/spree/order/checkout.rb b/app/models/spree/order/checkout.rb index e5a09f2cc3..e51ffe442a 100644 --- a/app/models/spree/order/checkout.rb +++ b/app/models/spree/order/checkout.rb @@ -8,7 +8,6 @@ module Spree class_attribute :next_event_transitions class_attribute :previous_states class_attribute :checkout_flow - class_attribute :checkout_steps def self.checkout_flow(&block) if block_given? @@ -20,7 +19,6 @@ module Spree end def self.define_state_machine! - self.checkout_steps = {} self.next_event_transitions = [] self.previous_states = [:cart] @@ -97,7 +95,6 @@ module Spree end def self.go_to_state(name, options = {}) - checkout_steps[name] = options previous_states.each do |state| add_transition({ from: state, to: name }.merge(options)) end @@ -112,30 +109,14 @@ module Spree @next_event_transitions ||= [] end - def self.checkout_steps - @checkout_steps ||= {} - end - def self.add_transition(options) next_event_transitions << { options.delete(:from) => options.delete(:to) }. merge(options) end - def checkout_steps - steps = self.class.checkout_steps. - each_with_object([]) { |(step, options), checkout_steps| - next if options.include?(:if) && !options[:if].call(self) - - checkout_steps << step - }.map(&:to_s) - # Ensure there is always a complete step - steps << "complete" unless steps.include?("complete") - steps - end - def restart_checkout_flow update_columns( - state: checkout_steps.first, + state: "address", updated_at: Time.zone.now, ) end diff --git a/app/models/spree/payment.rb b/app/models/spree/payment.rb index 4c209d10d7..6479694df9 100644 --- a/app/models/spree/payment.rb +++ b/app/models/spree/payment.rb @@ -246,7 +246,7 @@ module Spree # and this is it. Related to #1998. # See https://github.com/spree/spree/issues/1998#issuecomment-12869105 def set_unique_identifier - self.identifier = generate_identifier while self.class.exists?(identifier:) + self.identifier = generate_identifier while self.class.where(identifier:).exists? end def generate_identifier diff --git a/app/models/spree/payment/processing.rb b/app/models/spree/payment/processing.rb index 499a669987..8f9d0e4573 100644 --- a/app/models/spree/payment/processing.rb +++ b/app/models/spree/payment/processing.rb @@ -48,7 +48,7 @@ module Spree end def capture_and_complete_order! - OrderWorkflow.new(order).complete! + Orders::WorkflowService.new(order).complete! capture! end diff --git a/app/models/spree/payment_method.rb b/app/models/spree/payment_method.rb index 5b60aded62..a729571066 100644 --- a/app/models/spree/payment_method.rb +++ b/app/models/spree/payment_method.rb @@ -29,8 +29,7 @@ module Spree return where(nil) if user.admin? joins(:distributors). - where('distributors_payment_methods.distributor_id IN (?)', - user.enterprises.select(&:id)). + where(distributors_payment_methods: { distributor_id: user.enterprises.select(&:id) }). select('DISTINCT spree_payment_methods.*') } @@ -40,7 +39,7 @@ module Spree } scope :for_distributor, ->(distributor) { - joins(:distributors).where('enterprises.id = ?', distributor) + joins(:distributors).where(enterprises: { id: distributor }) } scope :for_subscriptions, -> { where(type: Subscription::ALLOWED_PAYMENT_METHOD_TYPES) } diff --git a/app/models/spree/preference.rb b/app/models/spree/preference.rb index ea2c63688c..7465c12f2c 100644 --- a/app/models/spree/preference.rb +++ b/app/models/spree/preference.rb @@ -2,8 +2,7 @@ module Spree class Preference < ApplicationRecord - serialize :value - + serialize :value, coder: YAML validates :key, presence: true validates :value_type, presence: true @@ -17,9 +16,7 @@ module Spree def value if self[:value_type].present? case self[:value_type].to_sym - when :string, :text - self[:value].to_s - when :password + when :string, :text, :password self[:value].to_s when :decimal BigDecimal(self[:value].to_s, exception: false)&.round(2, BigDecimal::ROUND_HALF_UP) || diff --git a/app/models/spree/preferences/preferable.rb b/app/models/spree/preferences/preferable.rb index 40131daef3..e81a24aaf7 100644 --- a/app/models/spree/preferences/preferable.rb +++ b/app/models/spree/preferences/preferable.rb @@ -111,9 +111,7 @@ module Spree def convert_preference_value(value, type) case type - when :string, :text - value.to_s - when :password + when :string, :text, :password value.to_s when :decimal value = 0 if value.blank? diff --git a/app/models/spree/price.rb b/app/models/spree/price.rb index 710e4ef5c3..668f53b6b9 100644 --- a/app/models/spree/price.rb +++ b/app/models/spree/price.rb @@ -37,7 +37,7 @@ module Spree def check_price return unless currency.nil? - self.currency = Spree::Config[:currency] + self.currency = CurrentConfig.get(:currency) end # strips all non-price-like characters from the price, taking into account locale settings diff --git a/app/models/spree/product.rb b/app/models/spree/product.rb index 4c9840a8fb..4fd670f90e 100755 --- a/app/models/spree/product.rb +++ b/app/models/spree/product.rb @@ -28,16 +28,11 @@ module Spree acts_as_paranoid - after_create :ensure_standard_variant - around_destroy :destruction - after_save :update_units - - searchable_attributes :supplier_id, :primary_taxon_id, :meta_keywords, :sku - searchable_associations :supplier, :properties, :primary_taxon, :variants + searchable_attributes :supplier_id, :meta_keywords, :sku + searchable_associations :supplier, :properties, :variants searchable_scopes :active, :with_properties belongs_to :supplier, class_name: 'Enterprise', optional: false, touch: true - belongs_to :primary_taxon, class_name: 'Spree::Taxon', optional: false, touch: true has_one :image, class_name: "Spree::Image", as: :viewable, dependent: :destroy @@ -77,7 +72,11 @@ module Spree # Transient attributes used temporarily when creating a new product, # these values are persisted on the product's variant attr_accessor :price, :display_as, :unit_value, :unit_description, :tax_category_id, - :shipping_category_id + :shipping_category_id, :primary_taxon_id + + after_create :ensure_standard_variant + around_destroy :destruction + after_save :update_units scope :with_properties, ->(*property_ids) { left_outer_joins(:product_properties). @@ -160,7 +159,7 @@ module Spree scope :in_order_cycle, lambda { |order_cycle| with_order_cycles_inner. merge(Exchange.outgoing). - where('order_cycles.id = ?', order_cycle) + where(order_cycles: { id: order_cycle }) } scope :in_an_active_order_cycle, lambda { @@ -177,7 +176,7 @@ module Spree if user.has_spree_role?('admin') where(nil) else - where('supplier_id IN (?)', user.enterprises.select("enterprises.id")) + where(supplier_id: user.enterprises.select("enterprises.id")) end } @@ -188,10 +187,10 @@ module Spree .with_permission(:add_to_order_cycle) .where(enterprises: { is_primary_producer: true }) .pluck(:parent_id) - where('spree_products.supplier_id IN (?)', [enterprise.id] | permitted_producer_ids) + where(spree_products: { supplier_id: [enterprise.id] | permitted_producer_ids }) } - scope :active, lambda { where("spree_products.deleted_at IS NULL") } + scope :active, lambda { where(spree_products: { deleted_at: nil }) } def self.group_by_products_id group(column_names.map { |col_name| "#{table_name}.#{col_name}" }) @@ -266,8 +265,8 @@ module Spree touch_distributors ExchangeVariant. - where('exchange_variants.variant_id IN (?)', variants.with_deleted. - select(:id)).destroy_all + where(exchange_variants: { variant_id: variants.with_deleted. + select(:id) }).destroy_all yield end @@ -284,9 +283,26 @@ module Spree variant.unit_description = unit_description variant.tax_category_id = tax_category_id variant.shipping_category_id = shipping_category_id + variant.primary_taxon_id = primary_taxon_id variants << variant end + # Format as per WeightsAndMeasures (todo: re-orgnaise maybe after product/variant refactor) + def variant_unit_with_scale + scale_clean = ActiveSupport::NumberHelper.number_to_rounded(variant_unit_scale, + precision: nil, + strip_insignificant_zeros: true) + [variant_unit, scale_clean].compact_blank.join("_") + end + + def variant_unit_with_scale=(variant_unit_with_scale) + values = variant_unit_with_scale.split("_") + assign_attributes( + variant_unit: values[0], + variant_unit_scale: values[1] || nil + ) + end + private def update_units diff --git a/app/models/spree/return_authorization.rb b/app/models/spree/return_authorization.rb index ad291f2bf3..1b18b9ea4f 100644 --- a/app/models/spree/return_authorization.rb +++ b/app/models/spree/return_authorization.rb @@ -29,7 +29,7 @@ module Spree end def currency - order.nil? ? Spree::Config[:currency] : order.currency + order.nil? ? CurrentConfig.get(:currency) : order.currency end def display_amount diff --git a/app/models/spree/shipment.rb b/app/models/spree/shipment.rb index 0b060c727c..8e59029abc 100644 --- a/app/models/spree/shipment.rb +++ b/app/models/spree/shipment.rb @@ -163,7 +163,7 @@ module Spree end def currency - order ? order.currency : Spree::Config[:currency] + order ? order.currency : CurrentConfig.get(:currency) end def display_cost diff --git a/app/models/spree/shipping_method.rb b/app/models/spree/shipping_method.rb index 1f726a5d2a..68f2d19015 100644 --- a/app/models/spree/shipping_method.rb +++ b/app/models/spree/shipping_method.rb @@ -41,8 +41,7 @@ module Spree where(nil) else joins(:distributors). - where('distributors_shipping_methods.distributor_id IN (?)', - user.enterprises.select(&:id)). + where(distributors_shipping_methods: { distributor_id: user.enterprises.select(&:id) }). select('DISTINCT spree_shipping_methods.*') end } @@ -53,7 +52,7 @@ module Spree } scope :for_distributor, lambda { |distributor| joins(:distributors). - where('enterprises.id = ?', distributor) + where(enterprises: { id: distributor }) } scope :by_name, -> { order('spree_shipping_methods.name ASC') } diff --git a/app/models/spree/taxon.rb b/app/models/spree/taxon.rb index 2ed96f4d57..0ccb9e6499 100644 --- a/app/models/spree/taxon.rb +++ b/app/models/spree/taxon.rb @@ -7,9 +7,12 @@ module Spree acts_as_nested_set dependent: :destroy belongs_to :taxonomy, class_name: 'Spree::Taxonomy', touch: true - has_many :products, class_name: "Spree::Product", foreign_key: "primary_taxon_id", + + has_many :variants, class_name: "Spree::Variant", foreign_key: "primary_taxon_id", inverse_of: :primary_taxon, dependent: :restrict_with_error + has_many :products, through: :variants, dependent: nil + before_create :set_permalink validates :name, presence: true @@ -77,7 +80,7 @@ module Spree taxons = Spree::Taxon .select("DISTINCT spree_taxons.id, ents_and_vars.enterprise_id") - .joins(products: :variants) + .joins(:variants) .joins(" INNER JOIN (#{ents_and_vars.to_sql}) AS ents_and_vars ON spree_variants.id = ents_and_vars.variant_id") diff --git a/app/models/spree/variant.rb b/app/models/spree/variant.rb index d91498e310..c5f93e0de9 100644 --- a/app/models/spree/variant.rb +++ b/app/models/spree/variant.rb @@ -13,8 +13,8 @@ module Spree acts_as_paranoid - searchable_attributes :sku, :display_as, :display_name - searchable_associations :product, :default_price + searchable_attributes :sku, :display_as, :display_name, :primary_taxon_id + searchable_associations :product, :default_price, :primary_taxon searchable_scopes :active, :deleted NAME_FIELDS = ["display_name", "display_as", "weight", "unit_value", "unit_description"].freeze @@ -28,6 +28,7 @@ module Spree belongs_to :product, -> { with_deleted }, touch: true, class_name: 'Spree::Product' belongs_to :tax_category, class_name: 'Spree::TaxCategory' belongs_to :shipping_category, class_name: 'Spree::ShippingCategory', optional: false + belongs_to :primary_taxon, class_name: 'Spree::Taxon', touch: true, optional: false delegate :name, :name=, :description, :description=, :meta_keywords, to: :product @@ -42,7 +43,7 @@ module Spree accepts_nested_attributes_for :images has_one :default_price, - -> { with_deleted.where(currency: Spree::Config[:currency]) }, + -> { with_deleted.where(currency: CurrentConfig.get(:currency)) }, class_name: 'Spree::Price', dependent: :destroy has_many :prices, @@ -56,6 +57,7 @@ module Spree has_many :exchanges, through: :exchange_variants has_many :variant_overrides, dependent: :destroy has_many :inventory_items, dependent: :destroy + has_many :semantic_links, dependent: :delete_all localize_number :price, :weight @@ -81,6 +83,7 @@ module Spree before_validation :ensure_unit_value before_validation :update_weight_from_unit_value, if: ->(v) { v.product.present? } before_validation :convert_variant_weight_to_decimal + before_validation :assign_related_taxon, if: ->(v) { v.primary_taxon.blank? } before_save :assign_units, if: ->(variant) { variant.new_record? || variant.changed_attributes.keys.intersection(NAME_FIELDS).any? @@ -98,7 +101,7 @@ module Spree scope :in_order_cycle, lambda { |order_cycle| with_order_cycles_inner. merge(Exchange.outgoing). - where('order_cycles.id = ?', order_cycle). + where(order_cycles: { id: order_cycle }). select('DISTINCT spree_variants.*') } @@ -110,8 +113,8 @@ module Spree } scope :for_distribution, lambda { |order_cycle, distributor| - where('spree_variants.id IN (?)', order_cycle.variants_distributed_by(distributor). - select(&:id)) + where(spree_variants: { id: order_cycle.variants_distributed_by(distributor). + select(&:id) }) } scope :visible_for, lambda { |enterprise| @@ -158,12 +161,12 @@ module Spree def self.active(currency = nil) # "where(id:" is necessary so that the returned relation has no includes # The relation without includes will not be readonly and allow updates on it - where("spree_variants.id in (?)", joins(:prices). + where(spree_variants: { id: joins(:prices). where(deleted_at: nil). where('spree_prices.currency' => - currency || Spree::Config[:currency]). + currency || CurrentConfig.get(:currency)). where.not(spree_prices: { amount: nil }). - select("spree_variants.id")) + select("spree_variants.id") }) end def tax_category @@ -207,10 +210,14 @@ module Spree private + def assign_related_taxon + self.primary_taxon ||= product.variants.last&.primary_taxon + end + def check_currency return unless currency.nil? - self.currency = Spree::Config[:currency] + self.currency = CurrentConfig.get(:currency) end def save_default_price @@ -222,7 +229,7 @@ module Spree end def set_cost_currency - self.cost_currency = Spree::Config[:currency] if cost_currency.blank? + self.cost_currency = CurrentConfig.get(:currency) if cost_currency.blank? end def create_stock_items diff --git a/app/models/subscription.rb b/app/models/subscription.rb index 04e57d1a54..4509c1ac75 100644 --- a/app/models/subscription.rb +++ b/app/models/subscription.rb @@ -34,8 +34,8 @@ class Subscription < ApplicationRecord where('subscriptions.ends_at > (?) OR subscriptions.ends_at IS NULL', Time.zone.now) } - scope :not_canceled, -> { where('subscriptions.canceled_at IS NULL') } - scope :not_paused, -> { where('subscriptions.paused_at IS NULL') } + scope :not_canceled, -> { where(subscriptions: { canceled_at: nil }) } + scope :not_paused, -> { where(subscriptions: { paused_at: nil }) } scope :active, -> { not_canceled.not_ended.not_paused.where('subscriptions.begins_at <= (?)', Time.zone.now) diff --git a/app/queries/complete_orders_with_balance.rb b/app/queries/complete_orders_with_balance_query.rb similarity index 74% rename from app/queries/complete_orders_with_balance.rb rename to app/queries/complete_orders_with_balance_query.rb index 57223e5c6e..c6507f45bb 100644 --- a/app/queries/complete_orders_with_balance.rb +++ b/app/queries/complete_orders_with_balance_query.rb @@ -1,13 +1,13 @@ # frozen_string_literal: true # Fetches complete orders of the specified user including their balance as a computed column -class CompleteOrdersWithBalance +class CompleteOrdersWithBalanceQuery def initialize(user) @user = user end - def query - OutstandingBalance.new(sorted_finalized_orders).query + def call + OutstandingBalanceQuery.new(sorted_finalized_orders).call end private diff --git a/app/queries/complete_visible_orders.rb b/app/queries/complete_visible_orders_query.rb similarity index 83% rename from app/queries/complete_visible_orders.rb rename to app/queries/complete_visible_orders_query.rb index 10eabe4f6d..22e427fec6 100644 --- a/app/queries/complete_visible_orders.rb +++ b/app/queries/complete_visible_orders_query.rb @@ -1,11 +1,11 @@ # frozen_string_literal: true -class CompleteVisibleOrders +class CompleteVisibleOrdersQuery def initialize(order_permissions) @order_permissions = order_permissions end - def query + def call order_permissions.visible_orders.complete end diff --git a/app/queries/customers_with_balance.rb b/app/queries/customers_with_balance_query.rb similarity index 88% rename from app/queries/customers_with_balance.rb rename to app/queries/customers_with_balance_query.rb index 623190ff4c..47d0fabca9 100644 --- a/app/queries/customers_with_balance.rb +++ b/app/queries/customers_with_balance_query.rb @@ -2,12 +2,12 @@ # Adds an aggregated 'balance_value' to each customer based on their order history # -class CustomersWithBalance +class CustomersWithBalanceQuery def initialize(customers) @customers = customers end - def query + def call @customers. joins(left_join_complete_orders). group("customers.id"). @@ -20,7 +20,7 @@ class CustomersWithBalance # The resulting orders are in states that belong after the checkout. Only these can be considered # for a customer's balance. def left_join_complete_orders - <<~SQL + <<~SQL.squish LEFT JOIN spree_orders ON spree_orders.customer_id = customers.id AND #{finalized_states.to_sql} SQL @@ -32,6 +32,6 @@ class CustomersWithBalance end def outstanding_balance_sum - "SUM(#{OutstandingBalance.new.statement})::float" + "SUM(#{OutstandingBalanceQuery.new.statement})::float" end end diff --git a/app/queries/outstanding_balance.rb b/app/queries/outstanding_balance_query.rb similarity index 92% rename from app/queries/outstanding_balance.rb rename to app/queries/outstanding_balance_query.rb index 637451b25c..c7d37fd62f 100644 --- a/app/queries/outstanding_balance.rb +++ b/app/queries/outstanding_balance_query.rb @@ -7,11 +7,11 @@ # Alternatively, you can get the SQL by calling #statement, which is suitable for more complex # cases. # -# See CompleteOrdersWithBalance or CustomersWithBalance as examples. +# See CompleteOrdersWithBalanceQuery or CustomersWithBalanceQuery as examples. # # Note this query object and `app/models/concerns/balance.rb` should implement the same behavior # until we find a better way. If you change one, please, change the other too. -class OutstandingBalance +class OutstandingBalanceQuery # All the states of a finished order but that shouldn't count towards the balance (the customer # didn't get the order for whatever reason). Note it does not include complete FINALIZED_NON_SUCCESSFUL_STATES = %w(canceled returned).freeze @@ -22,14 +22,14 @@ class OutstandingBalance @relation = relation end - def query + def call relation.select("#{statement} AS balance_value") end # Arel doesn't support CASE statements until v7.1.0 so we'll have to wait with SQL literals # a little longer. See https://github.com/rails/arel/pull/400 for details. def statement - <<~SQL + <<~SQL.squish CASE WHEN "spree_orders"."state" IN #{non_fulfilled_states_group.to_sql} THEN "spree_orders"."payment_total" WHEN "spree_orders"."state" IS NOT NULL THEN "spree_orders"."payment_total" - "spree_orders"."total" ELSE 0 END diff --git a/app/queries/payments_requiring_action.rb b/app/queries/payments_requiring_action_query.rb similarity index 54% rename from app/queries/payments_requiring_action.rb rename to app/queries/payments_requiring_action_query.rb index ffe705e955..c8fe5eda23 100644 --- a/app/queries/payments_requiring_action.rb +++ b/app/queries/payments_requiring_action_query.rb @@ -1,12 +1,12 @@ # frozen_string_literal: true -class PaymentsRequiringAction +class PaymentsRequiringActionQuery def initialize(user) @user = user end - def query - Spree::Payment.joins(:order).where("spree_orders.user_id = ?", user.id). + def call + Spree::Payment.joins(:order).where(spree_orders: { user_id: user.id }). requires_authorization end diff --git a/app/queries/product_scope_query.rb b/app/queries/product_scope_query.rb index bc8b6953b2..00f4a401e8 100644 --- a/app/queries/product_scope_query.rb +++ b/app/queries/product_scope_query.rb @@ -20,7 +20,7 @@ class ProductScopeQuery product_query. ransack(query_params_with_defaults). - result + result(distinct: true) end def find_product diff --git a/app/reflexes/admin/orders_reflex.rb b/app/reflexes/admin/orders_reflex.rb index b3145214a1..b52136391e 100644 --- a/app/reflexes/admin/orders_reflex.rb +++ b/app/reflexes/admin/orders_reflex.rb @@ -5,7 +5,7 @@ module Admin before_reflex :authorize_order, only: [:capture, :ship] def capture - payment_capture = OrderCaptureService.new(@order) + payment_capture = Orders::CaptureService.new(@order) if payment_capture.call cable_ready.replace(selector: dom_id(@order), @@ -32,13 +32,32 @@ module Admin end def bulk_invoice(params) + visible_orders = editable_orders.invoiceable.where(id: params[:bulk_ids]) + + if Spree::Config.enterprise_number_required_on_invoices? + distributors_without_abn = Enterprise.where( + id: visible_orders.select(:distributor_id), + abn: nil, + ) + + if distributors_without_abn.exists? + render_business_number_required_error(distributors_without_abn) + return + end + end + cable_ready.append( selector: "#orders-index", html: render(partial: "spree/admin/orders/bulk/invoice_modal") ).broadcast + # Preserve order of bulk_ids. + # The ids are supplied in the sequence of the orders screen and may be + # sorted, for example by last name of the customer. + visible_order_ids = params[:bulk_ids].map(&:to_i) & visible_orders.pluck(:id) + BulkInvoiceJob.perform_later( - params[:bulk_ids], + visible_order_ids, "tmp/invoices/#{Time.zone.now.to_i}-#{SecureRandom.hex(2)}.pdf", channel: SessionChannel.for_request(request), current_user_id: current_user.id @@ -48,7 +67,7 @@ module Admin end def cancel_orders(params) - cancelled_orders = OrdersBulkCancelService.new(params, current_user).call + cancelled_orders = Orders::BulkCancelService.new(params, current_user).call cable_ready.dispatch_event(name: "modal:close") @@ -75,8 +94,8 @@ module Admin def send_invoices(params) count = 0 - editable_orders.where(id: params[:bulk_ids]).find_each do |o| - next unless o.distributor.can_invoice? && o.invoiceable? + editable_orders.invoiceable.where(id: params[:bulk_ids]).find_each do |o| + next unless o.distributor.can_invoice? Spree::OrderMailer.invoice_email(o.id, current_user_id: current_user.id).deliver_later count += 1 @@ -106,5 +125,13 @@ module Admin def set_param_for_controller params[:id] = @order.number end + + def render_business_number_required_error(distributors) + distributor_names = distributors.pluck(:name) + + flash[:error] = I18n.t(:must_have_valid_business_number, + enterprise_name: distributor_names.join(", ")) + morph_admin_flashes + end end end diff --git a/app/reflexes/products_reflex.rb b/app/reflexes/products_reflex.rb index e6dd59e41d..9cad290331 100644 --- a/app/reflexes/products_reflex.rb +++ b/app/reflexes/products_reflex.rb @@ -5,10 +5,6 @@ class ProductsReflex < ApplicationReflex before_reflex :init_filters_params, :init_pagination_params - def fetch - fetch_and_render_products_with_flash - end - def change_per_page @per_page = element.value.to_i @page = 1 @@ -16,12 +12,6 @@ class ProductsReflex < ApplicationReflex fetch_and_render_products_with_flash end - def filter - @page = 1 - - fetch_and_render_products_with_flash - end - def clear_search @search_term = nil @producer_id = nil @@ -31,21 +21,6 @@ class ProductsReflex < ApplicationReflex fetch_and_render_products_with_flash end - def bulk_update - product_set = product_set_from_params - - product_set.collection.each { |p| authorize! :update, p } - @products = product_set.collection # use instance variable mainly for testing - - if product_set.save - flash[:success] = I18n.t('admin.products_v3.bulk_update.success') - elsif product_set.errors.present? - @error_counts = { saved: product_set.saved_count, invalid: product_set.invalid.count } - end - - render_products_form_with_flash - end - def delete_product id = current_id_from_element(element) product = product_finder(id).find_product @@ -116,11 +91,11 @@ class ProductsReflex < ApplicationReflex producer_options: producers, producer_id: @producer_id, category_options: categories, category_id: @category_id, flashes: flash }) - ).broadcast + ) cable_ready.replace_state( url: current_url, - ).broadcast_later + ) morph :nothing end @@ -133,12 +108,11 @@ class ProductsReflex < ApplicationReflex cable_ready.replace( selector: "#products-form", html: render(partial: "admin/products_v3/table", locals:) - ).broadcast + ) morph :nothing - # dunno why this doesn't work. - # morph "#products-form", render(partial: "admin/products_v3/table", - # locals: { products: products }) + # dunno why this doesn't work. The HTML stops after the first `` element, wtf?! + # morph "#products-form", render(partial: "admin/products_v3/table", locals:) end def producers @@ -153,7 +127,7 @@ class ProductsReflex < ApplicationReflex def fetch_products product_query = OpenFoodNetwork::Permissions.new(current_user) - .editable_products.merge(product_scope).ransack(ransack_query).result + .editable_products.merge(product_scope).ransack(ransack_query).result(distinct: true) @pagy, @products = pagy(product_query.order(:name), items: @per_page, page: @page, size: [1, 2, 2, 1]) end @@ -174,7 +148,7 @@ class ProductsReflex < ApplicationReflex if @search_term.present? query.merge!(Spree::Variant::SEARCH_KEY => @search_term) end - query.merge!(primary_taxon_id_in: @category_id) if @category_id.present? + query.merge!(variants_primary_taxon_id_in: @category_id) if @category_id.present? query end diff --git a/app/serializers/api/admin/customer_with_balance_serializer.rb b/app/serializers/api/admin/customer_with_balance_serializer.rb index fb043dda76..6115d9efbe 100644 --- a/app/serializers/api/admin/customer_with_balance_serializer.rb +++ b/app/serializers/api/admin/customer_with_balance_serializer.rb @@ -3,8 +3,8 @@ module Api module Admin # This serializer relies on `object` to respond to `#balance_value`. That's done in - # `CustomersWithBalance` due to the fact that ActiveRecord maps the DB result set's columns to - # instance methods. This way, the `balance_value` alias on that class ends up being + # `CustomersWithBalanceQuery` due to the fact that ActiveRecord maps the DB result set's + # columns to instance methods. This way, the `balance_value` alias on that class ends up being # `object.balance_value` here. class CustomerWithBalanceSerializer < CustomerSerializer attributes :balance, :balance_status @@ -12,7 +12,7 @@ module Api delegate :balance_value, to: :object def balance - Spree::Money.new(balance_value, currency: Spree::Config[:currency]).to_s + Spree::Money.new(balance_value, currency: CurrentConfig.get(:currency)).to_s end def balance_status diff --git a/app/serializers/api/admin/product_serializer.rb b/app/serializers/api/admin/product_serializer.rb index b3eb0225e6..356c0debdf 100644 --- a/app/serializers/api/admin/product_serializer.rb +++ b/app/serializers/api/admin/product_serializer.rb @@ -8,7 +8,6 @@ module Api :thumb_url, :variants has_one :supplier, key: :producer_id, embed: :id - has_one :primary_taxon, key: :category_id, embed: :id def variants ActiveModel::ArraySerializer.new( diff --git a/app/serializers/api/admin/variant_serializer.rb b/app/serializers/api/admin/variant_serializer.rb index 23b5dbd1e3..06732aa7b5 100644 --- a/app/serializers/api/admin/variant_serializer.rb +++ b/app/serializers/api/admin/variant_serializer.rb @@ -8,6 +8,8 @@ module Api :display_as, :display_name, :name_to_display, :variant_overrides_count, :price, :on_demand, :on_hand, :in_stock, :stock_location_id, :stock_location_name + has_one :primary_taxon, key: :category_id, embed: :id + def name if object.full_name.present? "#{object.name} - #{object.full_name}" diff --git a/app/serializers/api/currency_config_serializer.rb b/app/serializers/api/currency_config_serializer.rb index a9b1bbd7f1..485b2022b0 100644 --- a/app/serializers/api/currency_config_serializer.rb +++ b/app/serializers/api/currency_config_serializer.rb @@ -4,22 +4,22 @@ class Api::CurrencyConfigSerializer < ActiveModel::Serializer attributes :currency, :display_currency, :symbol, :symbol_position, :hide_cents def currency - Spree::Config[:currency] + CurrentConfig.get(:currency) end def display_currency - Spree::Config[:display_currency] + CurrentConfig.get(:display_currency) end def symbol - ::Money.new(1, Spree::Config[:currency]).symbol + ::Money.new(1, CurrentConfig.get(:currency)).symbol end def symbol_position - Spree::Config[:currency_symbol_position] + CurrentConfig.get(:currency_symbol_position) end def hide_cents - Spree::Config[:hide_cents] + CurrentConfig.get(:hide_cents) end end diff --git a/app/serializers/api/enterprise_shopfront_serializer.rb b/app/serializers/api/enterprise_shopfront_serializer.rb index 7e2b4df3bc..613c9f1bdf 100644 --- a/app/serializers/api/enterprise_shopfront_serializer.rb +++ b/app/serializers/api/enterprise_shopfront_serializer.rb @@ -145,7 +145,7 @@ module Api require_shipping = type == :delivery ? 't' : 'f' Spree::ShippingMethod. joins(:distributor_shipping_methods). - where('distributors_shipping_methods.distributor_id = ?', enterprise.id). + where(distributors_shipping_methods: { distributor_id: enterprise.id }). where("spree_shipping_methods.require_ship_address = '#{require_shipping}'").exists? end end diff --git a/app/serializers/api/order_serializer.rb b/app/serializers/api/order_serializer.rb index 067d23b76d..b1acb825c4 100644 --- a/app/serializers/api/order_serializer.rb +++ b/app/serializers/api/order_serializer.rb @@ -9,14 +9,14 @@ module Api has_many :payments, serializer: Api::PaymentSerializer - # This method relies on `balance_value` as a computed DB column. See `CompleteOrdersWithBalance` - # for reference. + # This method relies on `balance_value` as a computed DB column. + # See `CompleteOrdersWithBalanceQuery` for reference. def outstanding_balance -object.balance_value end def payments - object.payments.joins(:payment_method).where('state IN (?)', %w(completed pending)) + object.payments.joins(:payment_method).where(state: %w(completed pending)) end def shop_id diff --git a/app/serializers/api/product_serializer.rb b/app/serializers/api/product_serializer.rb index 11f228c1e6..e25fdaf04a 100644 --- a/app/serializers/api/product_serializer.rb +++ b/app/serializers/api/product_serializer.rb @@ -9,8 +9,6 @@ class Api::ProductSerializer < ActiveModel::Serializer has_many :variants, serializer: Api::VariantSerializer - has_one :primary_taxon, serializer: Api::TaxonSerializer - has_one :image, serializer: Api::ImageSerializer has_one :supplier, serializer: Api::IdSerializer diff --git a/app/serializers/invoice/line_item_serializer.rb b/app/serializers/invoice/line_item_serializer.rb index 4031327f1f..50e566850d 100644 --- a/app/serializers/invoice/line_item_serializer.rb +++ b/app/serializers/invoice/line_item_serializer.rb @@ -6,7 +6,6 @@ class Invoice :variant_id, :unit_price_price_and_unit, :unit_presentation, :enterprise_fee_additional_tax, :enterprise_fee_included_tax has_one :variant, serializer: Invoice::VariantSerializer - has_many :tax_rates, serializer: Invoice::TaxRateSerializer def enterprise_fee_additional_tax EnterpriseFeeAdjustments.new(object.enterprise_fee_adjustments).total_additional_tax diff --git a/app/services/cap_quantity.rb b/app/services/cap_quantity.rb index c1bfefaf5a..27bb86302c 100644 --- a/app/services/cap_quantity.rb +++ b/app/services/cap_quantity.rb @@ -46,6 +46,7 @@ class CapQuantity end def available_variants_for - OrderCycleDistributedVariants.new(order.order_cycle, order.distributor).available_variants + OrderCycles::DistributedVariantsService.new(order.order_cycle, + order.distributor).available_variants end end diff --git a/app/services/cart_service.rb b/app/services/cart_service.rb index 97a53613b0..ce6bc85652 100644 --- a/app/services/cart_service.rb +++ b/app/services/cart_service.rb @@ -154,7 +154,7 @@ class CartService end def check_variant_available_under_distribution(variant) - return true if OrderCycleDistributedVariants.new(@order_cycle, @distributor) + return true if OrderCycles::DistributedVariantsService.new(@order_cycle, @distributor) .available_variants.include? variant errors.add(:base, I18n.t(:spree_order_populator_availability_error)) diff --git a/app/services/checkout/post_checkout_actions.rb b/app/services/checkout/post_checkout_actions.rb index 5e8071012d..5484a70c09 100644 --- a/app/services/checkout/post_checkout_actions.rb +++ b/app/services/checkout/post_checkout_actions.rb @@ -14,7 +14,7 @@ module Checkout def failure @order.updater.shipping_address_from_distributor - OrderCheckoutRestart.new(@order).call + Orders::CheckoutRestartService.new(@order).call end private diff --git a/app/services/create_order_cycle.rb b/app/services/create_order_cycle.rb deleted file mode 100644 index 50900f1c88..0000000000 --- a/app/services/create_order_cycle.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -# Creates an order cycle for the provided enterprise and selecting all the -# variants specified for both incoming and outgoing exchanges -class CreateOrderCycle - # Constructor - # - # @param enterprise [Enterprise] - # @param variants [Array] - def initialize(enterprise, variants) - @enterprise = enterprise - @variants = variants - end - - # Creates the order cycle - def call - incoming_exchange.order_cycle = order_cycle - incoming_exchange.variants << variants - - outgoing_exchange.order_cycle = order_cycle - outgoing_exchange.variants << variants - - order_cycle.exchanges << incoming_exchange - order_cycle.exchanges << outgoing_exchange - - order_cycle.save! - end - - private - - attr_reader :enterprise, :variants - - # Builds an order cycle for the next month, starting now - # - # @return [OrderCycle] - def order_cycle - @order_cycle ||= OrderCycle.new( - coordinator_id: enterprise.id, - name: 'Monthly order cycle', - orders_open_at: Time.zone.now, - orders_close_at: 1.month.from_now - ) - end - - # Builds an exchange with the enterprise both as sender and receiver - # - # @return [Exchange] - def incoming_exchange - @incoming_exchange ||= Exchange.new( - sender_id: enterprise.id, - receiver_id: enterprise.id, - incoming: true - ) - end - - # Builds an exchange with the enterprise both as sender and receiver - # - # @return [Exchange] - def outgoing_exchange - @outgoing_exchange ||= Exchange.new( - sender_id: enterprise.id, - receiver_id: enterprise.id, - pickup_time: '8 am', - incoming: false - ) - end -end diff --git a/app/services/customer_order_cancellation.rb b/app/services/customer_order_cancellation.rb deleted file mode 100644 index 2e3f51c6e6..0000000000 --- a/app/services/customer_order_cancellation.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class CustomerOrderCancellation - def initialize(order) - @order = order - end - - def call - return unless order.cancel - - Spree::OrderMailer.cancel_email_for_shop(order).deliver_later - end - - private - - attr_reader :order -end diff --git a/app/services/order_adjustments_fetcher.rb b/app/services/order_adjustments_fetcher.rb deleted file mode 100644 index 6f236074b9..0000000000 --- a/app/services/order_adjustments_fetcher.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -# This class allows orders with eager-loaded adjustment objects to calculate various adjustment -# types without triggering additional queries. -# -# For example; `order.adjustments.shipping.sum(:amount)` would normally trigger a new query -# regardless of whether or not adjustments have been preloaded, as `#shipping` is an adjustment -# scope, eg; `scope :shipping, where(originator_type: 'Spree::ShippingMethod')`. -# -# Here the adjustment scopes are moved to a shared module, and `adjustments.loaded?` is used to -# check if the objects have already been fetched and initialized. If they have, `order.adjustments` -# will be an Array, and we can select the required objects without hitting the database. If not, it -# will fetch the adjustments via their scopes as normal. - -class OrderAdjustmentsFetcher - include AdjustmentScopes - - def initialize(order) - @order = order - end - - def admin_and_handling_total - admin_and_handling_fees.map(&:amount).sum - end - - def payment_fee - sum_adjustments "payment_fee" - end - - def ship_total - sum_adjustments "shipping" - end - - private - - attr_reader :order - - def adjustments - order.all_adjustments - end - - def adjustments_eager_loaded? - adjustments.loaded? - end - - def sum_adjustments(scope) - collect_adjustments(scope).map(&:amount).sum - end - - def collect_adjustments(scope) - if adjustments_eager_loaded? - adjustment_scope = public_send("#{scope}_scope") - - # Adjustments are already loaded here, this block is using `Array#select` - adjustments.select do |adjustment| - match_by_scope(adjustment, adjustment_scope) && match_by_scope(adjustment, eligible_scope) - end - else - adjustments.where(nil).eligible.public_send scope - end - end - - def admin_and_handling_fees - if adjustments_eager_loaded? - adjustments.select do |adjustment| - match_by_scope(adjustment, eligible_scope) && - adjustment.originator_type == 'EnterpriseFee' && - adjustment.adjustable_type != 'Spree::LineItem' - end - else - adjustments.eligible. - where("originator_type = ? AND adjustable_type != ?", 'EnterpriseFee', 'Spree::LineItem') - end - end - - def match_by_scope(adjustment, scope) - adjustment.public_send(scope.keys.first) == scope.values.first - end -end diff --git a/app/services/order_available_payment_methods.rb b/app/services/order_available_payment_methods.rb deleted file mode 100644 index 84ea0f870f..0000000000 --- a/app/services/order_available_payment_methods.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -require 'open_food_network/tag_rule_applicator' - -class OrderAvailablePaymentMethods - attr_reader :order, :customer - - delegate :distributor, - :order_cycle, - to: :order - - def initialize(order, customer = nil) - @order, @customer = order, customer - end - - def to_a - return [] if distributor.blank? - - payment_methods = payment_methods_before_tag_rules_applied - - applicator = OpenFoodNetwork::TagRuleApplicator.new(distributor, - "FilterPaymentMethods", customer&.tag_list) - applicator.filter(payment_methods) - end - - private - - def payment_methods_before_tag_rules_applied - if order_cycle.nil? || order_cycle.simple? - distributor.payment_methods - else - distributor.payment_methods.where( - id: available_distributor_payment_methods_ids - ) - end.available.select(&:configured?).uniq - end - - def available_distributor_payment_methods_ids - order_cycle.distributor_payment_methods - .where(distributor_id: distributor.id) - .select(:payment_method_id) - end -end diff --git a/app/services/order_available_shipping_methods.rb b/app/services/order_available_shipping_methods.rb deleted file mode 100644 index 8cd30fd804..0000000000 --- a/app/services/order_available_shipping_methods.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -require 'open_food_network/tag_rule_applicator' - -class OrderAvailableShippingMethods - attr_reader :order, :customer - - delegate :distributor, :order_cycle, to: :order - - def initialize(order, customer = nil) - @order, @customer = order, customer - end - - def to_a - return [] if distributor.blank? - - filter_by_category(tag_rules.filter(shipping_methods)) - end - - private - - def filter_by_category(methods) - return methods unless OpenFoodNetwork::FeatureToggle.enabled?(:match_shipping_categories, - distributor&.owner) - - required_category_ids = order.variants.pluck(:shipping_category_id).to_set - return methods if required_category_ids.empty? - - methods.select do |method| - provided_category_ids = method.shipping_categories.pluck(:id).to_set - required_category_ids.subset?(provided_category_ids) - end - end - - def shipping_methods - if order_cycle.nil? || order_cycle.simple? - distributor.shipping_methods - else - distributor.shipping_methods.where( - id: available_distributor_shipping_methods_ids - ) - end.frontend.to_a.uniq - end - - def available_distributor_shipping_methods_ids - order_cycle.distributor_shipping_methods - .where(distributor_id: distributor.id) - .select(:shipping_method_id) - end - - def tag_rules - OpenFoodNetwork::TagRuleApplicator.new( - distributor, "FilterShippingMethods", customer&.tag_list - ) - end -end diff --git a/app/services/order_capture_service.rb b/app/services/order_capture_service.rb deleted file mode 100644 index 78e69c9a1d..0000000000 --- a/app/services/order_capture_service.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -# Use `authorize! :admin order` before calling this service - -class OrderCaptureService - attr_reader :gateway_error - - def initialize(order) - @order = order - @gateway_error = nil - end - - def call - return false unless @order.payment_required? - return false unless (pending_payment = @order.pending_payments.first) - - pending_payment.capture! - rescue Spree::Core::GatewayError => e - @gateway_error = e - false - end -end diff --git a/app/services/order_cart_reset.rb b/app/services/order_cart_reset.rb deleted file mode 100644 index e84fd67e88..0000000000 --- a/app/services/order_cart_reset.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: false - -# Resets an order by verifying it's state and fixing any issues -class OrderCartReset - def initialize(order, distributor_id) - @order = order - @distributor ||= Enterprise.is_distributor.find_by(permalink: distributor_id) || - Enterprise.is_distributor.find(distributor_id) - end - - def reset_distributor - if order.distributor && order.distributor != distributor - order.empty! - order.set_order_cycle! nil - end - order.distributor = distributor - end - - def reset_other!(current_user, current_customer) - reset_user_and_customer(current_user) - reset_order_cycle(current_customer) - order.save! - end - - private - - attr_reader :order, :distributor, :current_user - - def reset_user_and_customer(current_user) - return unless current_user - - order.associate_user!(current_user) if order.user.blank? || order.email.blank? - end - - def reset_order_cycle(current_customer) - listed_order_cycles = Shop::OrderCyclesList.active_for(distributor, current_customer) - - if order_cycle_not_listed?(order.order_cycle, listed_order_cycles) - order.order_cycle = nil - order.empty! - end - - select_default_order_cycle(order, listed_order_cycles) - end - - def order_cycle_not_listed?(order_cycle, listed_order_cycles) - order_cycle.present? && !listed_order_cycles.include?(order_cycle) - end - - # If no OC is selected and there is only one in the list of OCs, selects it - def select_default_order_cycle(order, listed_order_cycles) - return unless order.order_cycle.blank? && listed_order_cycles.size == 1 - - order.order_cycle = listed_order_cycles.first - end -end diff --git a/app/services/order_checkout_restart.rb b/app/services/order_checkout_restart.rb deleted file mode 100644 index f43380636f..0000000000 --- a/app/services/order_checkout_restart.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Resets the passed order to cart state while clearing associated payments and shipments -class OrderCheckoutRestart - def initialize(order) - @order = order - end - - def call - return if order.cart? - - reset_state_to_cart - clear_shipments - clear_payments - - order.reload.update_order! - end - - private - - attr_reader :order - - def reset_state_to_cart - order.restart_checkout! - end - - def clear_shipments - order.shipments.with_state(:pending).destroy_all - end - - def clear_payments - order.payments.with_state(:checkout).destroy_all - end -end diff --git a/app/services/order_cycle_clone.rb b/app/services/order_cycle_clone.rb deleted file mode 100644 index 2d349a4f29..0000000000 --- a/app/services/order_cycle_clone.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -class OrderCycleClone - def initialize(order_cycle) - @original_order_cycle = order_cycle - end - - def create - oc = @original_order_cycle.dup - oc.name = I18n.t("models.order_cycle.cloned_order_cycle_name", order_cycle: oc.name) - oc.orders_open_at = oc.orders_close_at = oc.mails_sent = oc.processed_at = nil - oc.coordinator_fee_ids = @original_order_cycle.coordinator_fee_ids - oc.preferred_product_selection_from_coordinator_inventory_only = - @original_order_cycle.preferred_product_selection_from_coordinator_inventory_only - oc.schedule_ids = @original_order_cycle.schedule_ids - oc.save! - @original_order_cycle.exchanges.each { |e| e.clone!(oc) } - oc.selected_distributor_payment_method_ids = selected_distributor_payment_method_ids - oc.selected_distributor_shipping_method_ids = selected_distributor_shipping_method_ids - sync_subscriptions - oc.reload - end - - private - - def selected_distributor_payment_method_ids - @original_order_cycle.attachable_distributor_payment_methods.map(&:id) & - @original_order_cycle.selected_distributor_payment_method_ids - end - - def selected_distributor_shipping_method_ids - @original_order_cycle.attachable_distributor_shipping_methods.map(&:id) & - @original_order_cycle.selected_distributor_shipping_method_ids - end - - def sync_subscriptions - return unless @original_order_cycle.schedule_ids.any? - - OrderManagement::Subscriptions::ProxyOrderSyncer.new( - Subscription.where(schedule_id: @original_order_cycle.schedule_ids) - ).sync! - end -end diff --git a/app/services/order_cycle_distributed_products.rb b/app/services/order_cycle_distributed_products.rb deleted file mode 100644 index afe47b6cf7..0000000000 --- a/app/services/order_cycle_distributed_products.rb +++ /dev/null @@ -1,83 +0,0 @@ -# frozen_string_literal: true - -# Returns a (paginatable) AR object for the products or variants in stock for a given shop and OC. -# The stock-checking includes on_demand and stock level overrides from variant_overrides. -class OrderCycleDistributedProducts - def initialize(distributor, order_cycle, customer) - @distributor = distributor - @order_cycle = order_cycle - @customer = customer - end - - def products_relation - Spree::Product.where(id: stocked_products).group("spree_products.id") - end - - def variants_relation - order_cycle. - variants_distributed_by(distributor). - merge(stocked_variants_and_overrides). - select("DISTINCT spree_variants.*") - end - - private - - attr_reader :distributor, :order_cycle, :customer - - def stocked_products - order_cycle. - variants_distributed_by(distributor). - merge(stocked_variants_and_overrides). - select("DISTINCT spree_variants.product_id") - end - - def stocked_variants_and_overrides - stocked_variants = Spree::Variant. - joins("LEFT OUTER JOIN variant_overrides ON variant_overrides.variant_id = spree_variants.id - AND variant_overrides.hub_id = #{distributor.id}"). - joins(:stock_items). - where(query_stock_with_overrides) - - ProductTagRulesFilterer.new(distributor, customer, stocked_variants).call - end - - def query_stock_with_overrides - "( #{variant_not_overriden} AND ( #{variant_on_demand} OR #{variant_in_stock} ) ) - OR ( #{variant_overriden} AND ( #{override_on_demand} OR #{override_in_stock} ) ) - OR ( #{variant_overriden} AND ( #{override_on_demand_null} AND #{variant_on_demand} ) ) - OR ( #{variant_overriden} AND ( #{override_on_demand_null} - AND #{variant_not_on_demand} AND #{variant_in_stock} ) )" - end - - def variant_not_overriden - "variant_overrides.id IS NULL" - end - - def variant_overriden - "variant_overrides.id IS NOT NULL" - end - - def variant_in_stock - "spree_stock_items.count_on_hand > 0" - end - - def variant_on_demand - "spree_stock_items.backorderable IS TRUE" - end - - def variant_not_on_demand - "spree_stock_items.backorderable IS FALSE" - end - - def override_on_demand - "variant_overrides.on_demand IS TRUE" - end - - def override_in_stock - "variant_overrides.count_on_hand > 0" - end - - def override_on_demand_null - "variant_overrides.on_demand IS NULL" - end -end diff --git a/app/services/order_cycle_distributed_variants.rb b/app/services/order_cycle_distributed_variants.rb deleted file mode 100644 index 1b5c64c83e..0000000000 --- a/app/services/order_cycle_distributed_variants.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class OrderCycleDistributedVariants - def initialize(order_cycle, distributor) - @order_cycle = order_cycle - @distributor = distributor - end - - def distributes_order_variants?(order) - unavailable_order_variants(order).empty? - end - - def unavailable_order_variants(order) - order.line_item_variants - available_variants - end - - def available_variants - return [] unless @order_cycle - - @order_cycle.variants_distributed_by(@distributor) - end -end diff --git a/app/services/order_cycle_form.rb b/app/services/order_cycle_form.rb deleted file mode 100644 index fbcfdf401d..0000000000 --- a/app/services/order_cycle_form.rb +++ /dev/null @@ -1,230 +0,0 @@ -# frozen_string_literal: true - -require 'open_food_network/permissions' -require 'open_food_network/order_cycle_form_applicator' - -class OrderCycleForm - def initialize(order_cycle, order_cycle_params, user) - @order_cycle = order_cycle - @order_cycle_params = order_cycle_params - @specified_params = order_cycle_params.keys - @user = user - @permissions = OpenFoodNetwork::Permissions.new(user) - @schedule_ids = order_cycle_params.delete(:schedule_ids) - @selected_distributor_payment_method_ids = order_cycle_params.delete( - :selected_distributor_payment_method_ids - ) - @selected_distributor_shipping_method_ids = order_cycle_params.delete( - :selected_distributor_shipping_method_ids - ) - end - - def save - schedule_ids = build_schedule_ids - order_cycle.assign_attributes(order_cycle_params) - return false unless order_cycle.valid? - - order_cycle.transaction do - order_cycle.save! - order_cycle.schedule_ids = schedule_ids if parameter_specified?(:schedule_ids) - order_cycle.save! - apply_exchange_changes - if can_update_selected_payment_or_shipping_methods? - attach_selected_distributor_payment_methods - attach_selected_distributor_shipping_methods - end - sync_subscriptions - true - end - rescue ActiveRecord::RecordInvalid => e - add_exception_to_order_cycle_errors(e) - false - end - - private - - attr_accessor :order_cycle, :order_cycle_params, :user, :permissions - - def add_exception_to_order_cycle_errors(exception) - error = exception.message.split(":").last.strip - order_cycle.errors.add(:base, error) if order_cycle.errors.to_a.exclude?(error) - end - - def apply_exchange_changes - return if exchanges_unchanged? - - OpenFoodNetwork::OrderCycleFormApplicator.new(order_cycle, user).go! - - # reload so outgoing exchanges are up-to-date for shipping/payment method validations - order_cycle.reload - end - - def attach_selected_distributor_payment_methods - return if @selected_distributor_payment_method_ids.nil? - - if distributor_only? - payment_method_ids = order_cycle.selected_distributor_payment_method_ids - payment_method_ids -= user_distributor_payment_method_ids - payment_method_ids += user_only_selected_distributor_payment_method_ids - order_cycle.selected_distributor_payment_method_ids = payment_method_ids - else - order_cycle.selected_distributor_payment_method_ids = selected_distributor_payment_method_ids - end - order_cycle.save! - end - - def attach_selected_distributor_shipping_methods - return if @selected_distributor_shipping_method_ids.nil? - - if distributor_only? - # A distributor can only update methods associated with their own - # enterprise, so we load all previously selected methods, and replace - # only the distributor's methods with their selection (not touching other - # distributor's methods). - shipping_method_ids = order_cycle.selected_distributor_shipping_method_ids - shipping_method_ids -= user_distributor_shipping_method_ids - shipping_method_ids += user_only_selected_distributor_shipping_method_ids - order_cycle.selected_distributor_shipping_method_ids = shipping_method_ids - else - order_cycle.selected_distributor_shipping_method_ids = - selected_distributor_shipping_method_ids - end - - order_cycle.save! - end - - def attachable_distributor_payment_method_ids - @attachable_distributor_payment_method_ids ||= - order_cycle.attachable_distributor_payment_methods.map(&:id) - end - - def attachable_distributor_shipping_method_ids - @attachable_distributor_shipping_method_ids ||= - order_cycle.attachable_distributor_shipping_methods.map(&:id) - end - - def exchanges_unchanged? - [:incoming_exchanges, :outgoing_exchanges].all? do |direction| - order_cycle_params[direction].nil? - end - end - - def selected_distributor_payment_method_ids - @selected_distributor_payment_method_ids = ( - attachable_distributor_payment_method_ids & - @selected_distributor_payment_method_ids.compact_blank.map(&:to_i) - ) - - if attachable_distributor_payment_method_ids.sort == - @selected_distributor_payment_method_ids.sort - @selected_distributor_payment_method_ids = [] - end - - @selected_distributor_payment_method_ids - end - - def user_only_selected_distributor_payment_method_ids - user_distributor_payment_method_ids.intersection(selected_distributor_payment_method_ids) - end - - def selected_distributor_shipping_method_ids - @selected_distributor_shipping_method_ids = ( - attachable_distributor_shipping_method_ids & - @selected_distributor_shipping_method_ids.compact_blank.map(&:to_i) - ) - - if attachable_distributor_shipping_method_ids.sort == - @selected_distributor_shipping_method_ids.sort - @selected_distributor_shipping_method_ids = [] - end - - @selected_distributor_shipping_method_ids - end - - def user_only_selected_distributor_shipping_method_ids - user_distributor_shipping_method_ids.intersection(selected_distributor_shipping_method_ids) - end - - def build_schedule_ids - return unless parameter_specified?(:schedule_ids) - - result = existing_schedule_ids - result |= (requested_schedule_ids & permitted_schedule_ids) # Add permitted and requested - # Remove permitted but not requested - result -= ((result & permitted_schedule_ids) - requested_schedule_ids) - result - end - - def sync_subscriptions - return unless parameter_specified?(:schedule_ids) - return unless schedule_sync_required? - - OrderManagement::Subscriptions::ProxyOrderSyncer.new(subscriptions_to_sync).sync! - end - - def schedule_sync_required? - removed_schedule_ids.any? || new_schedule_ids.any? - end - - def subscriptions_to_sync - Subscription.where(schedule_id: removed_schedule_ids + new_schedule_ids) - end - - def requested_schedule_ids - @schedule_ids.map(&:to_i) - end - - def parameter_specified?(key) - @specified_params.map(&:to_s).include?(key.to_s) - end - - def permitted_schedule_ids - Schedule.where(id: requested_schedule_ids | existing_schedule_ids) - .merge(permissions.editable_schedules).pluck(:id) - end - - def existing_schedule_ids - @existing_schedule_ids ||= order_cycle.persisted? ? order_cycle.schedule_ids : [] - end - - def removed_schedule_ids - existing_schedule_ids - order_cycle.schedule_ids - end - - def new_schedule_ids - @order_cycle.schedule_ids - existing_schedule_ids - end - - def can_update_selected_payment_or_shipping_methods? - @user.admin? || coordinator? || distributor? - end - - def coordinator? - @user.enterprises.include?(@order_cycle.coordinator) - end - - def distributor? - !user_distributors_ids.empty? - end - - def distributor_only? - distributor? && !@user.admin? && !coordinator? - end - - def user_distributors_ids - @user_distributors_ids ||= @user.enterprises.pluck(:id) - .intersection(@order_cycle.distributors.pluck(:id)) - end - - def user_distributor_payment_method_ids - @user_distributor_payment_method_ids ||= - DistributorPaymentMethod.where(distributor_id: user_distributors_ids) - .pluck(:id) - end - - def user_distributor_shipping_method_ids - @user_distributor_shipping_method_ids ||= - DistributorShippingMethod.where(distributor_id: user_distributors_ids) - .pluck(:id) - end -end diff --git a/app/services/order_cycle_warning.rb b/app/services/order_cycle_warning.rb deleted file mode 100644 index 7e7afad8d8..0000000000 --- a/app/services/order_cycle_warning.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class OrderCycleWarning - def initialize(current_user) - @current_user = current_user - end - - def call - distributors = active_distributors_not_ready_for_checkout - - return if distributors.empty? - - active_distributors_not_ready_for_checkout_message(distributors) - end - - private - - attr_reader :current_user - - def active_distributors_not_ready_for_checkout - ocs = OrderCycle.managed_by(current_user).active - distributors = ocs.includes(:distributors).map(&:distributors).flatten.uniq - Enterprise.where(id: distributors.map(&:id)).not_ready_for_checkout - end - - def active_distributors_not_ready_for_checkout_message(distributors) - distributor_names = distributors.map(&:name).join ', ' - - if distributors.count > 1 - I18n.t(:active_distributors_not_ready_for_checkout_message_plural, - distributor_names:) - else - I18n.t(:active_distributors_not_ready_for_checkout_message_singular, - distributor_names:) - end - end -end diff --git a/app/services/order_cycle_webhook_service.rb b/app/services/order_cycle_webhook_service.rb deleted file mode 100644 index f2d4df152a..0000000000 --- a/app/services/order_cycle_webhook_service.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Create a webhook payload for an order cycle event. -# The payload will be delivered asynchronously. -class OrderCycleWebhookService - def self.create_webhook_job(order_cycle, event) - webhook_payload = order_cycle - .slice(:id, :name, :orders_open_at, :orders_close_at, :coordinator_id) - .merge(coordinator_name: order_cycle.coordinator.name) - - # Endpoints for coordinator owner - webhook_endpoints = order_cycle.coordinator.owner.webhook_endpoints - - # Plus unique endpoints for distributor owners (ignore duplicates) - webhook_endpoints |= order_cycle.distributors.map(&:owner).flat_map(&:webhook_endpoints) - - webhook_endpoints.each do |endpoint| - WebhookDeliveryJob.perform_later(endpoint.url, event, webhook_payload) - end - end -end diff --git a/app/services/order_cycles/clone_service.rb b/app/services/order_cycles/clone_service.rb new file mode 100644 index 0000000000..56e8c79247 --- /dev/null +++ b/app/services/order_cycles/clone_service.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module OrderCycles + class CloneService + def initialize(order_cycle) + @original_order_cycle = order_cycle + end + + def create + oc = @original_order_cycle.dup + oc.name = I18n.t("models.order_cycle.cloned_order_cycle_name", order_cycle: oc.name) + oc.orders_open_at = oc.orders_close_at = oc.mails_sent = oc.processed_at = nil + oc.coordinator_fee_ids = @original_order_cycle.coordinator_fee_ids + oc.preferred_product_selection_from_coordinator_inventory_only = + @original_order_cycle.preferred_product_selection_from_coordinator_inventory_only + oc.schedule_ids = @original_order_cycle.schedule_ids + oc.save! + @original_order_cycle.exchanges.each { |e| e.clone!(oc) } + oc.selected_distributor_payment_method_ids = selected_distributor_payment_method_ids + oc.selected_distributor_shipping_method_ids = selected_distributor_shipping_method_ids + sync_subscriptions + oc.reload + end + + private + + def selected_distributor_payment_method_ids + @original_order_cycle.attachable_distributor_payment_methods.map(&:id) & + @original_order_cycle.selected_distributor_payment_method_ids + end + + def selected_distributor_shipping_method_ids + @original_order_cycle.attachable_distributor_shipping_methods.map(&:id) & + @original_order_cycle.selected_distributor_shipping_method_ids + end + + def sync_subscriptions + return unless @original_order_cycle.schedule_ids.any? + + OrderManagement::Subscriptions::ProxyOrderSyncer.new( + Subscription.where(schedule_id: @original_order_cycle.schedule_ids) + ).sync! + end + end +end diff --git a/app/services/order_cycles/distributed_products_service.rb b/app/services/order_cycles/distributed_products_service.rb new file mode 100644 index 0000000000..4da5039e26 --- /dev/null +++ b/app/services/order_cycles/distributed_products_service.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +# Returns a (paginatable) AR object for the products or variants in stock for a given shop and OC. +# The stock-checking includes on_demand and stock level overrides from variant_overrides. + +module OrderCycles + class DistributedProductsService + def initialize(distributor, order_cycle, customer) + @distributor = distributor + @order_cycle = order_cycle + @customer = customer + end + + def products_relation + Spree::Product.where(id: stocked_products).group("spree_products.id") + end + + # Joins on the first product variant to allow us to filter product by taxon. This is so + # enterprise can display product sorted by category in a custom order on their shopfront. + # + # Caveat, the category sorting won't work properly if there are multiple variant with different + # category for a given product. + # + def products_taxons_relation + Spree::Product.where(id: stocked_products). + joins("LEFT JOIN ( + SELECT DISTINCT ON(product_id) id, product_id, primary_taxon_id + FROM spree_variants WHERE deleted_at IS NULL + ) first_variant ON spree_products.id = first_variant.product_id"). + select("spree_products.*, first_variant.primary_taxon_id"). + group("spree_products.id, first_variant.primary_taxon_id") + end + + def variants_relation + order_cycle. + variants_distributed_by(distributor). + merge(stocked_variants_and_overrides). + select("DISTINCT spree_variants.*") + end + + private + + attr_reader :distributor, :order_cycle, :customer + + def stocked_products + order_cycle. + variants_distributed_by(distributor). + merge(stocked_variants_and_overrides). + select("DISTINCT spree_variants.product_id") + end + + def stocked_variants_and_overrides + stocked_variants = Spree::Variant. + joins("LEFT OUTER JOIN variant_overrides ON variant_overrides.variant_id = spree_variants.id + AND variant_overrides.hub_id = #{distributor.id}"). + joins(:stock_items). + where(query_stock_with_overrides) + + ProductTagRulesFilterer.new(distributor, customer, stocked_variants).call + end + + def query_stock_with_overrides + "( #{variant_not_overriden} AND ( #{variant_on_demand} OR #{variant_in_stock} ) ) + OR ( #{variant_overriden} AND ( #{override_on_demand} OR #{override_in_stock} ) ) + OR ( #{variant_overriden} AND ( #{override_on_demand_null} AND #{variant_on_demand} ) ) + OR ( #{variant_overriden} AND ( #{override_on_demand_null} + AND #{variant_not_on_demand} AND #{variant_in_stock} ) )" + end + + def variant_not_overriden + "variant_overrides.id IS NULL" + end + + def variant_overriden + "variant_overrides.id IS NOT NULL" + end + + def variant_in_stock + "spree_stock_items.count_on_hand > 0" + end + + def variant_on_demand + "spree_stock_items.backorderable IS TRUE" + end + + def variant_not_on_demand + "spree_stock_items.backorderable IS FALSE" + end + + def override_on_demand + "variant_overrides.on_demand IS TRUE" + end + + def override_in_stock + "variant_overrides.count_on_hand > 0" + end + + def override_on_demand_null + "variant_overrides.on_demand IS NULL" + end + end +end diff --git a/app/services/order_cycles/distributed_variants_service.rb b/app/services/order_cycles/distributed_variants_service.rb new file mode 100644 index 0000000000..cf4bb1c03f --- /dev/null +++ b/app/services/order_cycles/distributed_variants_service.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module OrderCycles + class DistributedVariantsService + def initialize(order_cycle, distributor) + @order_cycle = order_cycle + @distributor = distributor + end + + def distributes_order_variants?(order) + unavailable_order_variants(order).empty? + end + + def unavailable_order_variants(order) + order.line_item_variants - available_variants + end + + def available_variants + return [] unless @order_cycle + + @order_cycle.variants_distributed_by(@distributor) + end + end +end diff --git a/app/services/order_cycles/form_service.rb b/app/services/order_cycles/form_service.rb new file mode 100644 index 0000000000..0b2f62d988 --- /dev/null +++ b/app/services/order_cycles/form_service.rb @@ -0,0 +1,233 @@ +# frozen_string_literal: true + +require 'open_food_network/permissions' +require 'open_food_network/order_cycle_form_applicator' + +module OrderCycles + class FormService + def initialize(order_cycle, order_cycle_params, user) + @order_cycle = order_cycle + @order_cycle_params = order_cycle_params + @specified_params = order_cycle_params.keys + @user = user + @permissions = OpenFoodNetwork::Permissions.new(user) + @schedule_ids = order_cycle_params.delete(:schedule_ids) + @selected_distributor_payment_method_ids = order_cycle_params.delete( + :selected_distributor_payment_method_ids + ) + @selected_distributor_shipping_method_ids = order_cycle_params.delete( + :selected_distributor_shipping_method_ids + ) + end + + def save + schedule_ids = build_schedule_ids + order_cycle.assign_attributes(order_cycle_params) + return false unless order_cycle.valid? + + order_cycle.transaction do + order_cycle.save! + order_cycle.schedule_ids = schedule_ids if parameter_specified?(:schedule_ids) + order_cycle.save! + apply_exchange_changes + if can_update_selected_payment_or_shipping_methods? + attach_selected_distributor_payment_methods + attach_selected_distributor_shipping_methods + end + sync_subscriptions + true + end + rescue ActiveRecord::RecordInvalid => e + add_exception_to_order_cycle_errors(e) + false + end + + private + + attr_accessor :order_cycle, :order_cycle_params, :user, :permissions + + def add_exception_to_order_cycle_errors(exception) + error = exception.message.split(":").last.strip + order_cycle.errors.add(:base, error) if order_cycle.errors.to_a.exclude?(error) + end + + def apply_exchange_changes + return if exchanges_unchanged? + + OpenFoodNetwork::OrderCycleFormApplicator.new(order_cycle, user).go! + + # reload so outgoing exchanges are up-to-date for shipping/payment method validations + order_cycle.reload + end + + def attach_selected_distributor_payment_methods + return if @selected_distributor_payment_method_ids.nil? + + if distributor_only? + payment_method_ids = order_cycle.selected_distributor_payment_method_ids + payment_method_ids -= user_distributor_payment_method_ids + payment_method_ids += user_only_selected_distributor_payment_method_ids + order_cycle.selected_distributor_payment_method_ids = payment_method_ids + else + order_cycle + .selected_distributor_payment_method_ids = selected_distributor_payment_method_ids + end + order_cycle.save! + end + + def attach_selected_distributor_shipping_methods + return if @selected_distributor_shipping_method_ids.nil? + + if distributor_only? + # A distributor can only update methods associated with their own + # enterprise, so we load all previously selected methods, and replace + # only the distributor's methods with their selection (not touching other + # distributor's methods). + shipping_method_ids = order_cycle.selected_distributor_shipping_method_ids + shipping_method_ids -= user_distributor_shipping_method_ids + shipping_method_ids += user_only_selected_distributor_shipping_method_ids + order_cycle.selected_distributor_shipping_method_ids = shipping_method_ids + else + order_cycle.selected_distributor_shipping_method_ids = + selected_distributor_shipping_method_ids + end + + order_cycle.save! + end + + def attachable_distributor_payment_method_ids + @attachable_distributor_payment_method_ids ||= + order_cycle.attachable_distributor_payment_methods.map(&:id) + end + + def attachable_distributor_shipping_method_ids + @attachable_distributor_shipping_method_ids ||= + order_cycle.attachable_distributor_shipping_methods.map(&:id) + end + + def exchanges_unchanged? + [:incoming_exchanges, :outgoing_exchanges].all? do |direction| + order_cycle_params[direction].nil? + end + end + + def selected_distributor_payment_method_ids + @selected_distributor_payment_method_ids = ( + attachable_distributor_payment_method_ids & + @selected_distributor_payment_method_ids.compact_blank.map(&:to_i) + ) + + if attachable_distributor_payment_method_ids.sort == + @selected_distributor_payment_method_ids.sort + @selected_distributor_payment_method_ids = [] + end + + @selected_distributor_payment_method_ids + end + + def user_only_selected_distributor_payment_method_ids + user_distributor_payment_method_ids.intersection(selected_distributor_payment_method_ids) + end + + def selected_distributor_shipping_method_ids + @selected_distributor_shipping_method_ids = ( + attachable_distributor_shipping_method_ids & + @selected_distributor_shipping_method_ids.compact_blank.map(&:to_i) + ) + + if attachable_distributor_shipping_method_ids.sort == + @selected_distributor_shipping_method_ids.sort + @selected_distributor_shipping_method_ids = [] + end + + @selected_distributor_shipping_method_ids + end + + def user_only_selected_distributor_shipping_method_ids + user_distributor_shipping_method_ids.intersection(selected_distributor_shipping_method_ids) + end + + def build_schedule_ids + return unless parameter_specified?(:schedule_ids) + + result = existing_schedule_ids + result |= (requested_schedule_ids & permitted_schedule_ids) # Add permitted and requested + # Remove permitted but not requested + result -= ((result & permitted_schedule_ids) - requested_schedule_ids) + result + end + + def sync_subscriptions + return unless parameter_specified?(:schedule_ids) + return unless schedule_sync_required? + + OrderManagement::Subscriptions::ProxyOrderSyncer.new(subscriptions_to_sync).sync! + end + + def schedule_sync_required? + removed_schedule_ids.any? || new_schedule_ids.any? + end + + def subscriptions_to_sync + Subscription.where(schedule_id: removed_schedule_ids + new_schedule_ids) + end + + def requested_schedule_ids + @schedule_ids.map(&:to_i) + end + + def parameter_specified?(key) + @specified_params.map(&:to_s).include?(key.to_s) + end + + def permitted_schedule_ids + Schedule.where(id: requested_schedule_ids | existing_schedule_ids) + .merge(permissions.editable_schedules).pluck(:id) + end + + def existing_schedule_ids + @existing_schedule_ids ||= order_cycle.persisted? ? order_cycle.schedule_ids : [] + end + + def removed_schedule_ids + existing_schedule_ids - order_cycle.schedule_ids + end + + def new_schedule_ids + @order_cycle.schedule_ids - existing_schedule_ids + end + + def can_update_selected_payment_or_shipping_methods? + @user.admin? || coordinator? || distributor? + end + + def coordinator? + @user.enterprises.include?(@order_cycle.coordinator) + end + + def distributor? + !user_distributors_ids.empty? + end + + def distributor_only? + distributor? && !@user.admin? && !coordinator? + end + + def user_distributors_ids + @user_distributors_ids ||= @user.enterprises.pluck(:id) + .intersection(@order_cycle.distributors.pluck(:id)) + end + + def user_distributor_payment_method_ids + @user_distributor_payment_method_ids ||= + DistributorPaymentMethod.where(distributor_id: user_distributors_ids) + .pluck(:id) + end + + def user_distributor_shipping_method_ids + @user_distributor_shipping_method_ids ||= + DistributorShippingMethod.where(distributor_id: user_distributors_ids) + .pluck(:id) + end + end +end diff --git a/app/services/order_cycles/warning_service.rb b/app/services/order_cycles/warning_service.rb new file mode 100644 index 0000000000..35859424d0 --- /dev/null +++ b/app/services/order_cycles/warning_service.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module OrderCycles + class WarningService + def initialize(current_user) + @current_user = current_user + end + + def call + distributors = active_distributors_not_ready_for_checkout + + return if distributors.empty? + + active_distributors_not_ready_for_checkout_message(distributors) + end + + private + + attr_reader :current_user + + def active_distributors_not_ready_for_checkout + ocs = OrderCycle.managed_by(current_user).active + distributors = ocs.includes(:distributors).map(&:distributors).flatten.uniq + Enterprise.where(id: distributors.map(&:id)).not_ready_for_checkout + end + + def active_distributors_not_ready_for_checkout_message(distributors) + distributor_names = distributors.map(&:name).join ', ' + + if distributors.count > 1 + I18n.t(:active_distributors_not_ready_for_checkout_message_plural, + distributor_names:) + else + I18n.t(:active_distributors_not_ready_for_checkout_message_singular, + distributor_names:) + end + end + end +end diff --git a/app/services/order_cycles/webhook_service.rb b/app/services/order_cycles/webhook_service.rb new file mode 100644 index 0000000000..f12c94ea1b --- /dev/null +++ b/app/services/order_cycles/webhook_service.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# Create a webhook payload for an order cycle event. +# The payload will be delivered asynchronously. + +module OrderCycles + class WebhookService + def self.create_webhook_job(order_cycle, event) + webhook_payload = order_cycle + .slice(:id, :name, :orders_open_at, :orders_close_at, :coordinator_id) + .merge(coordinator_name: order_cycle.coordinator.name) + + # Endpoints for coordinator owner + webhook_endpoints = order_cycle.coordinator.owner.webhook_endpoints + + # Plus unique endpoints for distributor owners (ignore duplicates) + webhook_endpoints |= order_cycle.distributors.map(&:owner).flat_map(&:webhook_endpoints) + + webhook_endpoints.each do |endpoint| + WebhookDeliveryJob.perform_later(endpoint.url, event, webhook_payload) + end + end + end +end diff --git a/app/services/order_data_masker.rb b/app/services/order_data_masker.rb deleted file mode 100644 index e5ae198332..0000000000 --- a/app/services/order_data_masker.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -class OrderDataMasker - def initialize(order) - @order = order - end - - def call - mask_customer_names unless customer_names_allowed? - mask_contact_data - end - - private - - attr_accessor :order - - def customer_names_allowed? - order.distributor.show_customer_names_to_suppliers - end - - def mask_customer_names - order.bill_address&.assign_attributes(firstname: I18n.t('admin.reports.hidden'), - lastname: "") - order.ship_address&.assign_attributes(firstname: I18n.t('admin.reports.hidden'), - lastname: "") - end - - def mask_contact_data - order.bill_address&.assign_attributes(phone: "", address1: "", address2: "", - city: "", zipcode: "", state: nil) - order.ship_address&.assign_attributes(phone: "", address1: "", address2: "", - city: "", zipcode: "", state: nil) - order.assign_attributes(email: I18n.t('admin.reports.hidden')) - end -end diff --git a/app/services/order_factory.rb b/app/services/order_factory.rb deleted file mode 100644 index 077dbac288..0000000000 --- a/app/services/order_factory.rb +++ /dev/null @@ -1,97 +0,0 @@ -# frozen_string_literal: true - -require 'open_food_network/scope_variant_to_hub' - -# Builds orders based on a set of attributes -# There are some idiosyncracies in the order creation process, -# and it is nice to have them dealt with in one place. - -class OrderFactory - def initialize(attrs, opts = {}) - @attrs = attrs.with_indifferent_access - @opts = opts.with_indifferent_access - end - - def create - create_order - set_user - build_line_items - set_addresses - create_shipment - set_shipping_method - create_payment - - @order - end - - private - - attr_reader :attrs, :opts - - def customer - @customer ||= Customer.find(attrs[:customer_id]) - end - - def shop - @shop ||= Enterprise.find(attrs[:distributor_id]) - end - - def create_order - @order = Spree::Order.create!(create_attrs) - end - - def create_attrs - create_attrs = attrs.slice(:customer_id, :order_cycle_id, :distributor_id) - create_attrs[:email] = customer.email - create_attrs - end - - def build_line_items - attrs[:line_items].each do |li| - next unless variant = Spree::Variant.find_by(id: li[:variant_id]) - - scoper.scope(variant) - li[:quantity] = stock_limited_quantity(variant.on_demand, variant.on_hand, li[:quantity]) - li[:price] = variant.price - build_item_from(li) - end - end - - def build_item_from(attrs) - @order.line_items.build( - attrs.merge(skip_stock_check: opts[:skip_stock_check]) - ) - end - - def set_user - @order.update_attribute(:user_id, customer.user_id) - end - - def set_addresses - @order.update(attrs.slice(:bill_address_attributes, :ship_address_attributes)) - end - - def create_shipment - @order.create_proposed_shipments - end - - def set_shipping_method - @order.select_shipping_method(attrs[:shipping_method_id]) - end - - def create_payment - @order.recreate_all_fees! - @order.payments.create(payment_method_id: attrs[:payment_method_id], - amount: @order.reload.total) - end - - def stock_limited_quantity(variant_on_demand, variant_on_hand, requested) - return requested if opts[:skip_stock_check] || variant_on_demand - - [variant_on_hand, requested].min - end - - def scoper - @scoper ||= OpenFoodNetwork::ScopeVariantToHub.new(shop) - end -end diff --git a/app/services/order_fees_handler.rb b/app/services/order_fees_handler.rb deleted file mode 100644 index 47be2c9903..0000000000 --- a/app/services/order_fees_handler.rb +++ /dev/null @@ -1,68 +0,0 @@ -# frozen_string_literal: true - -class OrderFeesHandler - attr_reader :order - - delegate :distributor, :order_cycle, to: :order - - def initialize(order) - @order = order - end - - def recreate_all_fees! - # `with_lock` acquires an exclusive row lock on order so no other - # requests can update it until the transaction is commited. - # See https://github.com/rails/rails/blob/3-2-stable/activerecord/lib/active_record/locking/pessimistic.rb#L69 - # and https://www.postgresql.org/docs/current/static/sql-select.html#SQL-FOR-UPDATE-SHARE - order.with_lock do - EnterpriseFee.clear_all_adjustments order - - create_line_item_fees! - create_order_fees! - end - - tax_enterprise_fees! unless order.before_payment_state? - order.update_order! - end - - def create_line_item_fees! - order.line_items.includes(variant: :product).each do |line_item| - if provided_by_order_cycle? line_item - calculator.create_line_item_adjustments_for line_item - end - end - end - - def create_order_fees! - return unless order_cycle - - calculator.create_order_adjustments_for order - end - - def tax_enterprise_fees! - Spree::TaxRate.adjust(order, order.all_adjustments.enterprise_fee) - end - - def update_line_item_fees!(line_item) - line_item.adjustments.enterprise_fee.each do |fee| - fee.update_adjustment!(line_item, force: true) - end - end - - def update_order_fees! - order.adjustments.enterprise_fee.where(adjustable_type: 'Spree::Order').each do |fee| - fee.update_adjustment!(order, force: true) - end - end - - private - - def calculator - @calculator ||= OpenFoodNetwork::EnterpriseFeeCalculator.new(distributor, order_cycle) - end - - def provided_by_order_cycle?(line_item) - @order_cycle_variant_ids ||= order_cycle&.variants&.map(&:id) || [] - @order_cycle_variant_ids.include? line_item.variant_id - end -end diff --git a/app/services/order_invoice_comparator.rb b/app/services/order_invoice_comparator.rb deleted file mode 100644 index d306a972ce..0000000000 --- a/app/services/order_invoice_comparator.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true - -class OrderInvoiceComparator - attr_reader :order - - def initialize(order) - @order = order - end - - def can_generate_new_invoice? - return true if invoices.empty? - - # We'll use a recursive BFS algorithm to find if the invoice is outdated - # the root will be the order - # On each node, we'll a list of relevant attributes that will be used on the comparison - different?(current_state_invoice, latest_invoice, invoice_generation_selector) - end - - def can_update_latest_invoice? - return false if invoices.empty? - - different?(current_state_invoice, latest_invoice, invoice_update_selector) - end - - private - - def different?(node1, node2, attributes_selector) - simple_values1, presenters1 = attributes_selector.call(node1) - simple_values2, presenters2 = attributes_selector.call(node2) - return true if simple_values1 != simple_values2 - - return true if presenters1.size != presenters2.size - - presenters1.zip(presenters2).any? do |presenter1, presenter2| - different?(presenter1, presenter2, attributes_selector) - end - end - - def invoice_generation_selector - values_selector(:invoice_generation_values) - end - - def invoice_update_selector - values_selector(:invoice_update_values) - end - - def values_selector(attribute) - proc do |node| - return [[], []] unless node.respond_to?(attribute) - - grouped = node.public_send(attribute).group_by(&grouper) - [grouped[:simple] || [], grouped[:presenters]&.flatten || []] - end - end - - def grouper - proc do |value| - if value.is_a?(Array) || value.class.to_s.starts_with?("Invoice::DataPresenter") - :presenters - else - :simple - end - end - end - - def current_state_invoice - @current_state_invoice ||= Invoice.new( - order:, - data: serialize_for_invoice, - date: Time.zone.today, - number: invoices.count + 1 - ).presenter - end - - def invoices - order.invoices - end - - def latest_invoice - @latest_invoice ||= invoices.first.presenter - end - - def serialize_for_invoice - InvoiceDataGenerator.new(order).serialize_for_invoice - end -end diff --git a/app/services/order_invoice_generator.rb b/app/services/order_invoice_generator.rb deleted file mode 100644 index 1d91fec8da..0000000000 --- a/app/services/order_invoice_generator.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -class OrderInvoiceGenerator - def initialize(order) - @order = order - end - - def generate_or_update_latest_invoice - if comparator.can_generate_new_invoice? - order.invoices.create!( - date: Time.zone.today, - number: total_invoices_created_by_distributor + 1, - data: invoice_data - ) - elsif comparator.can_update_latest_invoice? - order.invoices.latest.update!( - date: Time.zone.today, - data: invoice_data - ) - end - end - - private - - attr_reader :order - - def comparator - @comparator ||= OrderInvoiceComparator.new(order) - end - - def invoice_data - @invoice_data ||= InvoiceDataGenerator.new(order).generate - end - - def total_invoices_created_by_distributor - Invoice.joins(:order).where(order: { distributor: order.distributor }).count - end -end diff --git a/app/services/order_payment_finder.rb b/app/services/order_payment_finder.rb deleted file mode 100644 index 54b19654a3..0000000000 --- a/app/services/order_payment_finder.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -class OrderPaymentFinder - def initialize(order) - @order = order - end - - def last_payment - last(@order.payments) - end - - def last_pending_payment - last(@order.pending_payments) - end - - private - - # `max_by` avoids additional database queries when payments are loaded - # already. There is usually only one payment and this shouldn't cause - # any overhead compared to `order(:created_at).last`. Using `last` - # without order is not deterministic. - # - # We are not using `updated_at` because all payments are touched when the - # order is updated and then all payments have the same `updated_at` value. - def last(payments) - payments.max_by(&:created_at) - end -end diff --git a/app/services/order_syncer.rb b/app/services/order_syncer.rb deleted file mode 100644 index 83ed767426..0000000000 --- a/app/services/order_syncer.rb +++ /dev/null @@ -1,138 +0,0 @@ -# frozen_string_literal: true - -# Responsible for ensuring that any updates to a Subscription are propagated to any -# orders belonging to that Subscription which have been instantiated -class OrderSyncer - attr_reader :order_update_issues - - def initialize(subscription) - @subscription = subscription - @order_update_issues = OrderUpdateIssues.new - @line_item_syncer = LineItemSyncer.new(subscription, order_update_issues) - end - - def sync! - orders_in_order_cycles_not_closed.all? do |order| - order.assign_attributes(customer_id:, email: customer&.email, - distributor_id: shop_id) - update_associations_for(order) - line_item_syncer.sync!(order) - order.update_order! - order.save - end - end - - private - - attr_reader :subscription, :line_item_syncer - - delegate :orders, :bill_address, :ship_address, :subscription_line_items, to: :subscription - delegate :shop_id, :customer, :customer_id, to: :subscription - delegate :shipping_method, :shipping_method_id, - :payment_method, :payment_method_id, to: :subscription - delegate :shipping_method_id_changed?, :shipping_method_id_was, to: :subscription - delegate :payment_method_id_changed?, :payment_method_id_was, to: :subscription - - def update_associations_for(order) - update_bill_address_for(order) if (bill_address.changes.keys & relevant_address_attrs).any? - update_shipment_for(order) if shipping_method_id_changed? - update_ship_address_for(order) - update_payment_for(order) if payment_method_id_changed? - end - - def orders_in_order_cycles_not_closed - return @orders_in_order_cycles_not_closed unless @orders_in_order_cycles_not_closed.nil? - - @orders_in_order_cycles_not_closed = orders.joins(:order_cycle). - merge(OrderCycle.not_closed).readonly(false) - end - - def update_bill_address_for(order) - unless addresses_match?(order.bill_address, bill_address) - return order_update_issues.add(order, I18n.t('bill_address')) - end - - order.bill_address.update(bill_address.attributes.slice(*relevant_address_attrs)) - end - - def update_payment_for(order) - payment = order.payments. - with_state('checkout').where(payment_method_id: payment_method_id_was).last - if payment - payment&.void_transaction! - order.payments.create(payment_method_id:, amount: order.reload.total) - else - unless order.payments.with_state('checkout').where(payment_method_id:).any? - order_update_issues.add(order, I18n.t('admin.payment_method')) - end - end - end - - def update_shipment_for(order) - return if pending_shipment_with?(order, shipping_method_id) # No need to do anything. - - if pending_shipment_with?(order, shipping_method_id_was) - order.select_shipping_method(shipping_method_id) - else - order_update_issues.add(order, I18n.t('admin.shipping_method')) - end - end - - def update_ship_address_for(order) - # The conditions here are to achieve the same behaviour in earlier versions of Spree, where - # switching from pick-up to delivery affects whether simultaneous changes to shipping address - # are ignored or not. - pickup_to_delivery = force_ship_address_required?(order) - if (!pickup_to_delivery || order.shipment.present?) && - (ship_address.changes.keys & relevant_address_attrs).any? - save_ship_address_in_order(order) - end - return unless !pickup_to_delivery || order.shipment.blank? - - order.updater.shipping_address_from_distributor - end - - def relevant_address_attrs - ["firstname", "lastname", "address1", "zipcode", "city", "state_id", "country_id", "phone"] - end - - def addresses_match?(order_address, subscription_address) - relevant_address_attrs.all? do |attr| - order_address[attr] == subscription_address.public_send("#{attr}_was") || - order_address[attr] == subscription_address[attr] - end - end - - def ship_address_updatable?(order) - return true if force_ship_address_required?(order) - return false unless order.shipping_method.require_ship_address? - return true if addresses_match?(order.ship_address, ship_address) - - order_update_issues.add(order, I18n.t('ship_address')) - false - end - - # This returns true when the shipping method on the subscription has changed - # to a delivery (ie. a shipping address is required) AND the existing shipping - # address on the order matches the shop's address - def force_ship_address_required?(order) - return false unless shipping_method.require_ship_address? - - distributor_address = order.address_from_distributor - relevant_address_attrs.all? do |attr| - order.ship_address[attr] == distributor_address[attr] - end - end - - def save_ship_address_in_order(order) - return unless ship_address_updatable?(order) - - order.ship_address.update(ship_address.attributes.slice(*relevant_address_attrs)) - end - - def pending_shipment_with?(order, shipping_method_id) - return false unless order.shipment.present? && order.shipment.state == "pending" - - order.shipping_method.id == shipping_method_id - end -end diff --git a/app/services/order_tax_adjustments_fetcher.rb b/app/services/order_tax_adjustments_fetcher.rb deleted file mode 100644 index 72a20a2257..0000000000 --- a/app/services/order_tax_adjustments_fetcher.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -# Collects Tax Adjustments related to an order, and returns a hash with a total for each rate. - -class OrderTaxAdjustmentsFetcher - def initialize(order) - @order = order - end - - def totals(tax_adjustments = order.all_adjustments.tax) - tax_adjustments.each_with_object({}) do |adjustment, hash| - tax_rate = adjustment.originator - hash[tax_rate] = hash[tax_rate].to_f + adjustment.amount - end - end - - private - - attr_reader :order -end diff --git a/app/services/order_update_issues.rb b/app/services/order_update_issues.rb deleted file mode 100644 index bcdf3c644e..0000000000 --- a/app/services/order_update_issues.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Wrapper for a hash of issues encountered by instances of OrderSyncer and LineItemSyncer -# Used to report issues to the user when they attempt to update a subscription - -class OrderUpdateIssues - def initialize - @issues = {} - end - - delegate :[], :keys, to: :issues - - def add(order, issue) - @issues[order.id] ||= [] - @issues[order.id] << issue - end - - private - - attr_reader :issues -end diff --git a/app/services/order_workflow.rb b/app/services/order_workflow.rb deleted file mode 100644 index 815f3e1ee4..0000000000 --- a/app/services/order_workflow.rb +++ /dev/null @@ -1,95 +0,0 @@ -# frozen_string_literal: true - -class OrderWorkflow - attr_reader :order - - def initialize(order) - @order = order - end - - def complete - advance_to_state("complete", advance_order_options) - end - - def complete! - advance_order!(advance_order_options) - end - - def next(options = {}) - result = advance_order_one_step - - after_transition_hook(options) - - result - end - - def advance_to_payment - return unless order.before_payment_state? - - advance_to_state("payment", advance_order_options) - end - - def advance_checkout(options = {}) - advance_to = order.before_payment_state? ? "payment" : "confirmation" - - advance_to_state(advance_to, advance_order_options.merge(options)) - end - - private - - def advance_order_options - shipping_method_id = order.shipping_method.id if order.shipping_method.present? - { "shipping_method_id" => shipping_method_id } - end - - def advance_to_state(target_state, options = {}) - until order.state == target_state - break unless order.next - - after_transition_hook(options) - end - - order.state == target_state - end - - def advance_order!(options) - until order.completed? - order.next! - after_transition_hook(options) - end - end - - def advance_order_one_step - tries ||= 3 - order.next - rescue ActiveRecord::StaleObjectError - retry unless (tries -= 1).zero? - false - end - - def after_transition_hook(options) - if order.state == "delivery" - order.select_shipping_method(options["shipping_method_id"]) - end - - persist_all_payments if order.state == "payment" - end - - # When a payment fails, the order state machine stays in 'payment' and rollbacks all transactions - # This rollback also reverts the payment state from 'failed', 'void' or 'invalid' to 'pending' - # Despite the rollback, the in-memory payment still has the correct state, so we persist it - def persist_all_payments - order.payments.each do |payment| - in_memory_payment_state = payment.state - if different_from_db_payment_state?(in_memory_payment_state, payment.id) - payment.reload.update(state: in_memory_payment_state) - end - end - end - - # Verifies if the in-memory payment state is different from the one stored in the database - # This is be done without reloading the payment so that in-memory data is not changed - def different_from_db_payment_state?(in_memory_payment_state, payment_id) - in_memory_payment_state != Spree::Payment.find(payment_id).state - end -end diff --git a/app/services/orders/available_payment_methods_service.rb b/app/services/orders/available_payment_methods_service.rb new file mode 100644 index 0000000000..86b58ffc14 --- /dev/null +++ b/app/services/orders/available_payment_methods_service.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +require 'open_food_network/tag_rule_applicator' + +module Orders + class AvailablePaymentMethodsService + attr_reader :order, :customer + + delegate :distributor, + :order_cycle, + to: :order + + def initialize(order, customer = nil) + @order, @customer = order, customer + end + + def to_a + return [] if distributor.blank? + + payment_methods = payment_methods_before_tag_rules_applied + + applicator = OpenFoodNetwork::TagRuleApplicator + .new(distributor, "FilterPaymentMethods", customer&.tag_list) + applicator.filter(payment_methods) + end + + private + + def payment_methods_before_tag_rules_applied + if order_cycle.nil? || order_cycle.simple? + distributor.payment_methods + else + distributor.payment_methods.where( + id: available_distributor_payment_methods_ids + ) + end.available.select(&:configured?).uniq + end + + def available_distributor_payment_methods_ids + order_cycle.distributor_payment_methods + .where(distributor_id: distributor.id) + .select(:payment_method_id) + end + end +end diff --git a/app/services/orders/available_shipping_methods_service.rb b/app/services/orders/available_shipping_methods_service.rb new file mode 100644 index 0000000000..f264c2cca6 --- /dev/null +++ b/app/services/orders/available_shipping_methods_service.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +require 'open_food_network/tag_rule_applicator' + +module Orders + class AvailableShippingMethodsService + attr_reader :order, :customer + + delegate :distributor, :order_cycle, to: :order + + def initialize(order, customer = nil) + @order, @customer = order, customer + end + + def to_a + return [] if distributor.blank? + + filter_by_category(tag_rules.filter(shipping_methods)) + end + + private + + def filter_by_category(methods) + return methods unless OpenFoodNetwork::FeatureToggle.enabled?(:match_shipping_categories, + distributor&.owner) + + required_category_ids = order.variants.pluck(:shipping_category_id).to_set + return methods if required_category_ids.empty? + + methods.select do |method| + provided_category_ids = method.shipping_categories.pluck(:id).to_set + required_category_ids.subset?(provided_category_ids) + end + end + + def shipping_methods + if order_cycle.nil? || order_cycle.simple? + distributor.shipping_methods + else + distributor.shipping_methods.where( + id: available_distributor_shipping_methods_ids + ) + end.frontend.to_a.uniq + end + + def available_distributor_shipping_methods_ids + order_cycle.distributor_shipping_methods + .where(distributor_id: distributor.id) + .select(:shipping_method_id) + end + + def tag_rules + OpenFoodNetwork::TagRuleApplicator.new( + distributor, "FilterShippingMethods", customer&.tag_list + ) + end + end +end diff --git a/app/services/orders/bulk_cancel_service.rb b/app/services/orders/bulk_cancel_service.rb new file mode 100644 index 0000000000..0469907bf8 --- /dev/null +++ b/app/services/orders/bulk_cancel_service.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Orders + class BulkCancelService + def initialize(params, current_user) + @order_ids = params[:bulk_ids] + @current_user = current_user + @send_cancellation_email = params[:send_cancellation_email] + @restock_items = params[:restock_items] + end + + def call + # rubocop:disable Rails/FindEach # .each returns an array, .find_each returns nil + editable_orders.where(id: @order_ids).each do |order| + order.send_cancellation_email = @send_cancellation_email + order.restock_items = @restock_items + order.cancel + end + # rubocop:enable Rails/FindEach + end + + private + + def editable_orders + Permissions::Order.new(@current_user).editable_orders + end + end +end diff --git a/app/services/orders/capture_service.rb b/app/services/orders/capture_service.rb new file mode 100644 index 0000000000..abdcbb9f0a --- /dev/null +++ b/app/services/orders/capture_service.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# Use `authorize! :admin order` before calling this service + +module Orders + class CaptureService + attr_reader :gateway_error + + def initialize(order) + @order = order + @gateway_error = nil + end + + def call + return false unless @order.payment_required? + return false unless (pending_payment = @order.pending_payments.first) + + pending_payment.capture! + rescue Spree::Core::GatewayError => e + @gateway_error = e + false + end + end +end diff --git a/app/services/orders/cart_reset_service.rb b/app/services/orders/cart_reset_service.rb new file mode 100644 index 0000000000..418b386aa7 --- /dev/null +++ b/app/services/orders/cart_reset_service.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: false + +# Resets an order by verifying it's state and fixing any issues + +module Orders + class CartResetService + def initialize(order, distributor_id) + @order = order + @distributor ||= Enterprise.is_distributor.find_by(permalink: distributor_id) || + Enterprise.is_distributor.find(distributor_id) + end + + def reset_distributor + if order.distributor && order.distributor != distributor + order.empty! + order.set_order_cycle! nil + end + order.distributor = distributor + end + + def reset_other!(current_user, current_customer) + reset_user_and_customer(current_user) + reset_order_cycle(current_customer) + order.save! + end + + private + + attr_reader :order, :distributor, :current_user + + def reset_user_and_customer(current_user) + return unless current_user + + order.associate_user!(current_user) if order.user.blank? || order.email.blank? + end + + def reset_order_cycle(current_customer) + listed_order_cycles = Shop::OrderCyclesList.active_for(distributor, current_customer) + + if order_cycle_not_listed?(order.order_cycle, listed_order_cycles) + order.order_cycle = nil + order.empty! + end + + select_default_order_cycle(order, listed_order_cycles) + end + + def order_cycle_not_listed?(order_cycle, listed_order_cycles) + order_cycle.present? && listed_order_cycles.exclude?(order_cycle) + end + + # If no OC is selected and there is only one in the list of OCs, selects it + def select_default_order_cycle(order, listed_order_cycles) + return unless order.order_cycle.blank? && listed_order_cycles.size == 1 + + order.order_cycle = listed_order_cycles.first + end + end +end diff --git a/app/services/orders/checkout_restart_service.rb b/app/services/orders/checkout_restart_service.rb new file mode 100644 index 0000000000..793d8a7efe --- /dev/null +++ b/app/services/orders/checkout_restart_service.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Resets the passed order to cart state while clearing associated payments and shipments + +module Orders + class CheckoutRestartService + def initialize(order) + @order = order + end + + def call + return if order.cart? + + reset_state_to_cart + clear_shipments + clear_payments + + order.reload.update_order! + end + + private + + attr_reader :order + + def reset_state_to_cart + order.restart_checkout! + end + + def clear_shipments + order.shipments.with_state(:pending).destroy_all + end + + def clear_payments + order.payments.with_state(:checkout).destroy_all + end + end +end diff --git a/app/services/orders/compare_invoice_service.rb b/app/services/orders/compare_invoice_service.rb new file mode 100644 index 0000000000..797506d21c --- /dev/null +++ b/app/services/orders/compare_invoice_service.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +module Orders + class CompareInvoiceService + attr_reader :order + + def initialize(order) + @order = order + end + + def can_generate_new_invoice? + return true if invoices.empty? + + # We'll use a recursive BFS algorithm to find if the invoice is outdated + # the root will be the order + # On each node, we'll a list of relevant attributes that will be used on the comparison + different?(current_state_invoice, latest_invoice, invoice_generation_selector) + end + + def can_update_latest_invoice? + return false if invoices.empty? + + different?(current_state_invoice, latest_invoice, invoice_update_selector) + end + + private + + def different?(node1, node2, attributes_selector) + simple_values1, presenters1 = attributes_selector.call(node1) + simple_values2, presenters2 = attributes_selector.call(node2) + return true if simple_values1 != simple_values2 + + return true if presenters1.size != presenters2.size + + presenters1.zip(presenters2).any? do |presenter1, presenter2| + different?(presenter1, presenter2, attributes_selector) + end + end + + def invoice_generation_selector + values_selector(:invoice_generation_values) + end + + def invoice_update_selector + values_selector(:invoice_update_values) + end + + def values_selector(attribute) + proc do |node| + return [[], []] unless node.respond_to?(attribute) + + grouped = node.public_send(attribute).group_by(&grouper) + [grouped[:simple] || [], grouped[:presenters]&.flatten || []] + end + end + + def grouper + proc do |value| + if value.is_a?(Array) || value.class.to_s.starts_with?("Invoice::DataPresenter") + :presenters + else + :simple + end + end + end + + def current_state_invoice + @current_state_invoice ||= Invoice.new( + order:, + data: serialize_for_invoice, + date: Time.zone.today, + number: invoices.count + 1 + ).presenter + end + + def invoices + order.invoices + end + + def latest_invoice + @latest_invoice ||= invoices.first.presenter + end + + def serialize_for_invoice + InvoiceDataGenerator.new(order).serialize_for_invoice + end + end +end diff --git a/app/services/orders/customer_cancellation_service.rb b/app/services/orders/customer_cancellation_service.rb new file mode 100644 index 0000000000..7385139db0 --- /dev/null +++ b/app/services/orders/customer_cancellation_service.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Orders + class CustomerCancellationService + def initialize(order) + @order = order + end + + def call + return unless order.cancel + + Spree::OrderMailer.cancel_email_for_shop(order).deliver_later + end + + private + + attr_reader :order + end +end diff --git a/app/services/orders/factory_service.rb b/app/services/orders/factory_service.rb new file mode 100644 index 0000000000..eef377734b --- /dev/null +++ b/app/services/orders/factory_service.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +require 'open_food_network/scope_variant_to_hub' + +# Builds orders based on a set of attributes +# There are some idiosyncracies in the order creation process, +# and it is nice to have them dealt with in one place. + +module Orders + class FactoryService + def initialize(attrs, opts = {}) + @attrs = attrs.with_indifferent_access + @opts = opts.with_indifferent_access + end + + def create + create_order + set_user + build_line_items + set_addresses + create_shipment + set_shipping_method + create_payment + + @order + end + + private + + attr_reader :attrs, :opts + + def customer + @customer ||= Customer.find(attrs[:customer_id]) + end + + def shop + @shop ||= Enterprise.find(attrs[:distributor_id]) + end + + def create_order + @order = Spree::Order.create!(create_attrs) + end + + def create_attrs + create_attrs = attrs.slice(:customer_id, :order_cycle_id, :distributor_id) + create_attrs[:email] = customer.email + create_attrs + end + + def build_line_items + attrs[:line_items].each do |li| + next unless variant = Spree::Variant.find_by(id: li[:variant_id]) + + scoper.scope(variant) + li[:quantity] = stock_limited_quantity(variant.on_demand, variant.on_hand, li[:quantity]) + li[:price] = variant.price + build_item_from(li) + end + end + + def build_item_from(attrs) + @order.line_items.build( + attrs.merge(skip_stock_check: opts[:skip_stock_check]) + ) + end + + def set_user + @order.update_attribute(:user_id, customer.user_id) + end + + def set_addresses + @order.update(attrs.slice(:bill_address_attributes, :ship_address_attributes)) + end + + def create_shipment + @order.create_proposed_shipments + end + + def set_shipping_method + @order.select_shipping_method(attrs[:shipping_method_id]) + end + + def create_payment + @order.recreate_all_fees! + @order.payments.create(payment_method_id: attrs[:payment_method_id], + amount: @order.reload.total) + end + + def stock_limited_quantity(variant_on_demand, variant_on_hand, requested) + return requested if opts[:skip_stock_check] || variant_on_demand + + [variant_on_hand, requested].min + end + + def scoper + @scoper ||= OpenFoodNetwork::ScopeVariantToHub.new(shop) + end + end +end diff --git a/app/services/orders/fetch_adjustments_service.rb b/app/services/orders/fetch_adjustments_service.rb new file mode 100644 index 0000000000..8cb3d76c41 --- /dev/null +++ b/app/services/orders/fetch_adjustments_service.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +# This service allows orders with eager-loaded adjustment objects to calculate various adjustment +# types without triggering additional queries. +# +# For example; `order.adjustments.shipping.sum(:amount)` would normally trigger a new query +# regardless of whether or not adjustments have been preloaded, as `#shipping` is an adjustment +# scope, eg; `scope :shipping, where(originator_type: 'Spree::ShippingMethod')`. +# +# Here the adjustment scopes are moved to a shared module, and `adjustments.loaded?` is used to +# check if the objects have already been fetched and initialized. If they have, `order.adjustments` +# will be an Array, and we can select the required objects without hitting the database. If not, it +# will fetch the adjustments via their scopes as normal. + +module Orders + class FetchAdjustmentsService + include AdjustmentScopes + + def initialize(order) + @order = order + end + + def admin_and_handling_total + admin_and_handling_fees.map(&:amount).sum + end + + def payment_fee + sum_adjustments "payment_fee" + end + + def ship_total + sum_adjustments "shipping" + end + + private + + attr_reader :order + + def adjustments + order.all_adjustments + end + + def adjustments_eager_loaded? + adjustments.loaded? + end + + def sum_adjustments(scope) + collect_adjustments(scope).map(&:amount).sum + end + + def collect_adjustments(scope) + if adjustments_eager_loaded? + adjustment_scope = public_send("#{scope}_scope") + + # Adjustments are already loaded here, this block is using `Array#select` + adjustments.select do |adjustment| + match_by_scope(adjustment, adjustment_scope) && match_by_scope(adjustment, eligible_scope) + end + else + adjustments.where(nil).eligible.public_send scope + end + end + + def admin_and_handling_fees + if adjustments_eager_loaded? + adjustments.select do |adjustment| + match_by_scope(adjustment, eligible_scope) && + adjustment.originator_type == 'EnterpriseFee' && + adjustment.adjustable_type != 'Spree::LineItem' + end + else + adjustments.eligible. + where("originator_type = ? AND adjustable_type != ?", 'EnterpriseFee', 'Spree::LineItem') + end + end + + def match_by_scope(adjustment, scope) + adjustment.public_send(scope.keys.first) == scope.values.first + end + end +end diff --git a/app/services/orders/fetch_tax_adjustments_service.rb b/app/services/orders/fetch_tax_adjustments_service.rb new file mode 100644 index 0000000000..0aef4cc319 --- /dev/null +++ b/app/services/orders/fetch_tax_adjustments_service.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# Collects Tax Adjustments related to an order, and returns a hash with a total for each rate. + +module Orders + class FetchTaxAdjustmentsService + def initialize(order) + @order = order + end + + def totals(tax_adjustments = order.all_adjustments.tax) + tax_adjustments.each_with_object({}) do |adjustment, hash| + tax_rate = adjustment.originator + hash[tax_rate] = hash[tax_rate].to_f + adjustment.amount + end + end + + private + + attr_reader :order + end +end diff --git a/app/services/orders/find_payment_service.rb b/app/services/orders/find_payment_service.rb new file mode 100644 index 0000000000..fe8eac2b5a --- /dev/null +++ b/app/services/orders/find_payment_service.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Orders + class FindPaymentService + def initialize(order) + @order = order + end + + def last_payment + last(@order.payments) + end + + def last_pending_payment + last(@order.pending_payments) + end + + private + + # `max_by` avoids additional database queries when payments are loaded + # already. There is usually only one payment and this shouldn't cause + # any overhead compared to `order(:created_at).last`. Using `last` + # without order is not deterministic. + # + # We are not using `updated_at` because all payments are touched when the + # order is updated and then all payments have the same `updated_at` value. + def last(payments) + payments.max_by(&:created_at) + end + end +end diff --git a/app/services/orders/generate_invoice_service.rb b/app/services/orders/generate_invoice_service.rb new file mode 100644 index 0000000000..99cf17f781 --- /dev/null +++ b/app/services/orders/generate_invoice_service.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Orders + class GenerateInvoiceService + def initialize(order) + @order = order + end + + def generate_or_update_latest_invoice + if comparator.can_generate_new_invoice? + order.invoices.create!( + date: Time.zone.today, + number: total_invoices_created_by_distributor + 1, + data: invoice_data + ) + elsif comparator.can_update_latest_invoice? + order.invoices.latest.update!( + date: Time.zone.today, + data: invoice_data + ) + end + end + + private + + attr_reader :order + + def comparator + @comparator ||= Orders::CompareInvoiceService.new(order) + end + + def invoice_data + @invoice_data ||= InvoiceDataGenerator.new(order).generate + end + + def total_invoices_created_by_distributor + Invoice.joins(:order).where(order: { distributor: order.distributor }).count + end + end +end diff --git a/app/services/orders/handle_fees_service.rb b/app/services/orders/handle_fees_service.rb new file mode 100644 index 0000000000..09ee04f1a2 --- /dev/null +++ b/app/services/orders/handle_fees_service.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +module Orders + class HandleFeesService + attr_reader :order + + delegate :distributor, :order_cycle, to: :order + + def initialize(order) + @order = order + end + + def recreate_all_fees! + # `with_lock` acquires an exclusive row lock on order so no other + # requests can update it until the transaction is commited. + # See https://github.com/rails/rails/blob/3-2-stable/activerecord/lib/active_record/locking/pessimistic.rb#L69 + # and https://www.postgresql.org/docs/current/static/sql-select.html#SQL-FOR-UPDATE-SHARE + order.with_lock do + EnterpriseFee.clear_all_adjustments order + + create_line_item_fees! + create_order_fees! + end + + tax_enterprise_fees! unless order.before_payment_state? + order.update_order! + end + + def create_line_item_fees! + order.line_items.includes(variant: :product).each do |line_item| + if provided_by_order_cycle? line_item + calculator.create_line_item_adjustments_for line_item + end + end + end + + def create_order_fees! + return unless order_cycle + + calculator.create_order_adjustments_for order + end + + def tax_enterprise_fees! + Spree::TaxRate.adjust(order, order.all_adjustments.enterprise_fee) + end + + def update_line_item_fees!(line_item) + line_item.adjustments.enterprise_fee.each do |fee| + fee.update_adjustment!(line_item, force: true) + end + end + + def update_order_fees! + order.adjustments.enterprise_fee.where(adjustable_type: 'Spree::Order').each do |fee| + fee.update_adjustment!(order, force: true) + end + end + + private + + def calculator + @calculator ||= OpenFoodNetwork::EnterpriseFeeCalculator.new(distributor, order_cycle) + end + + def provided_by_order_cycle?(line_item) + @order_cycle_variant_ids ||= order_cycle&.variants&.map(&:id) || [] + @order_cycle_variant_ids.include? line_item.variant_id + end + end +end diff --git a/app/services/orders/mask_data_service.rb b/app/services/orders/mask_data_service.rb new file mode 100644 index 0000000000..35cbc7482b --- /dev/null +++ b/app/services/orders/mask_data_service.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Orders + class MaskDataService + def initialize(order) + @order = order + end + + def call + mask_customer_names unless customer_names_allowed? + mask_contact_data + end + + private + + attr_accessor :order + + def customer_names_allowed? + order.distributor.show_customer_names_to_suppliers + end + + def mask_customer_names + order.bill_address&.assign_attributes(firstname: I18n.t('admin.reports.hidden'), + lastname: "") + order.ship_address&.assign_attributes(firstname: I18n.t('admin.reports.hidden'), + lastname: "") + end + + def mask_contact_data + order.bill_address&.assign_attributes(phone: "", address1: "", address2: "", + city: "", zipcode: "", state: nil) + order.ship_address&.assign_attributes(phone: "", address1: "", address2: "", + city: "", zipcode: "", state: nil) + order.assign_attributes(email: I18n.t('admin.reports.hidden')) + end + end +end diff --git a/app/services/orders/sync_service.rb b/app/services/orders/sync_service.rb new file mode 100644 index 0000000000..590e622209 --- /dev/null +++ b/app/services/orders/sync_service.rb @@ -0,0 +1,141 @@ +# frozen_string_literal: true + +# Responsible for ensuring that any updates to a Subscription are propagated to any +# orders belonging to that Subscription which have been instantiated + +module Orders + class SyncService + attr_reader :order_update_issues + + def initialize(subscription) + @subscription = subscription + @order_update_issues = Orders::UpdateIssuesService.new + @line_item_syncer = LineItemSyncer.new(subscription, order_update_issues) + end + + def sync! + orders_in_order_cycles_not_closed.all? do |order| + order.assign_attributes(customer_id:, email: customer&.email, + distributor_id: shop_id) + update_associations_for(order) + line_item_syncer.sync!(order) + order.update_order! + order.save + end + end + + private + + attr_reader :subscription, :line_item_syncer + + delegate :orders, :bill_address, :ship_address, :subscription_line_items, to: :subscription + delegate :shop_id, :customer, :customer_id, to: :subscription + delegate :shipping_method, :shipping_method_id, + :payment_method, :payment_method_id, to: :subscription + delegate :shipping_method_id_changed?, :shipping_method_id_was, to: :subscription + delegate :payment_method_id_changed?, :payment_method_id_was, to: :subscription + + def update_associations_for(order) + update_bill_address_for(order) if bill_address.changes.keys.intersect?(relevant_address_attrs) + update_shipment_for(order) if shipping_method_id_changed? + update_ship_address_for(order) + update_payment_for(order) if payment_method_id_changed? + end + + def orders_in_order_cycles_not_closed + return @orders_in_order_cycles_not_closed unless @orders_in_order_cycles_not_closed.nil? + + @orders_in_order_cycles_not_closed = orders.joins(:order_cycle). + merge(OrderCycle.not_closed).readonly(false) + end + + def update_bill_address_for(order) + unless addresses_match?(order.bill_address, bill_address) + return order_update_issues.add(order, I18n.t('bill_address')) + end + + order.bill_address.update(bill_address.attributes.slice(*relevant_address_attrs)) + end + + def update_payment_for(order) + payment = order.payments. + with_state('checkout').where(payment_method_id: payment_method_id_was).last + if payment + payment&.void_transaction! + order.payments.create(payment_method_id:, amount: order.reload.total) + else + unless order.payments.with_state('checkout').where(payment_method_id:).any? + order_update_issues.add(order, I18n.t('admin.payment_method')) + end + end + end + + def update_shipment_for(order) + return if pending_shipment_with?(order, shipping_method_id) # No need to do anything. + + if pending_shipment_with?(order, shipping_method_id_was) + order.select_shipping_method(shipping_method_id) + else + order_update_issues.add(order, I18n.t('admin.shipping_method')) + end + end + + def update_ship_address_for(order) + # The conditions here are to achieve the same behaviour in earlier versions of Spree, where + # switching from pick-up to delivery affects whether simultaneous changes to shipping address + # are ignored or not. + pickup_to_delivery = force_ship_address_required?(order) + if (!pickup_to_delivery || order.shipment.present?) && + ship_address.changes.keys.intersect?(relevant_address_attrs) + save_ship_address_in_order(order) + end + return unless !pickup_to_delivery || order.shipment.blank? + + order.updater.shipping_address_from_distributor + end + + def relevant_address_attrs + ["firstname", "lastname", "address1", "zipcode", "city", "state_id", "country_id", "phone"] + end + + def addresses_match?(order_address, subscription_address) + relevant_address_attrs.all? do |attr| + order_address[attr] == subscription_address.public_send("#{attr}_was") || + order_address[attr] == subscription_address[attr] + end + end + + def ship_address_updatable?(order) + return true if force_ship_address_required?(order) + return false unless order.shipping_method.require_ship_address? + return true if addresses_match?(order.ship_address, ship_address) + + order_update_issues.add(order, I18n.t('ship_address')) + false + end + + # This returns true when the shipping method on the subscription has changed + # to a delivery (ie. a shipping address is required) AND the existing shipping + # address on the order matches the shop's address + def force_ship_address_required?(order) + return false unless shipping_method.require_ship_address? + + distributor_address = order.address_from_distributor + relevant_address_attrs.all? do |attr| + order.ship_address[attr] == distributor_address[attr] + end + end + + def save_ship_address_in_order(order) + return unless ship_address_updatable?(order) + + order.ship_address.update(ship_address.attributes.slice(*relevant_address_attrs)) + end + + def pending_shipment_with?(order, shipping_method_id) + return false unless order.shipment.present? && order.shipment.state == "pending" + + order.shipping_method.id == shipping_method_id + end + end +end diff --git a/app/services/orders/update_issues_service.rb b/app/services/orders/update_issues_service.rb new file mode 100644 index 0000000000..0f0eba5277 --- /dev/null +++ b/app/services/orders/update_issues_service.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +# Wrapper for a hash of issues encountered by instances of Orders::SyncService and LineItemSyncer +# Used to report issues to the user when they attempt to update a subscription + +module Orders + class UpdateIssuesService + def initialize + @issues = {} + end + + delegate :[], :keys, to: :issues + + def add(order, issue) + @issues[order.id] ||= [] + @issues[order.id] << issue + end + + private + + attr_reader :issues + end +end diff --git a/app/services/orders/workflow_service.rb b/app/services/orders/workflow_service.rb new file mode 100644 index 0000000000..99eec1bd17 --- /dev/null +++ b/app/services/orders/workflow_service.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +module Orders + class WorkflowService + attr_reader :order + + def initialize(order) + @order = order + end + + def complete + advance_to_state("complete", advance_order_options) + end + + def complete! + advance_order!(advance_order_options) + end + + def next(options = {}) + result = advance_order_one_step + + after_transition_hook(options) + + result + end + + def advance_to_payment + return unless order.before_payment_state? + + advance_to_state("payment", advance_order_options) + end + + def advance_checkout(options = {}) + advance_to = order.before_payment_state? ? "payment" : "confirmation" + + advance_to_state(advance_to, advance_order_options.merge(options)) + end + + private + + def advance_order_options + shipping_method_id = order.shipping_method.id if order.shipping_method.present? + { "shipping_method_id" => shipping_method_id } + end + + def advance_to_state(target_state, options = {}) + until order.state == target_state + break unless order.next + + after_transition_hook(options) + end + + order.state == target_state + end + + def advance_order!(options) + until order.completed? + order.next! + after_transition_hook(options) + end + end + + def advance_order_one_step + tries ||= 3 + order.next + rescue ActiveRecord::StaleObjectError + retry unless (tries -= 1).zero? + false + end + + def after_transition_hook(options) + if order.state == "delivery" + order.select_shipping_method(options["shipping_method_id"]) + end + + persist_all_payments if order.state == "payment" + end + + # When a payment fails, the order state machine stays in 'payment' + # and rollbacks all transactions + # This rollback also reverts the payment state from 'failed', 'void' or 'invalid' to 'pending' + # Despite the rollback, the in-memory payment still has the correct state, so we persist it + def persist_all_payments + order.payments.each do |payment| + in_memory_payment_state = payment.state + if different_from_db_payment_state?(in_memory_payment_state, payment.id) + payment.reload.update(state: in_memory_payment_state) + end + end + end + + # Verifies if the in-memory payment state is different from the one stored in the database + # This is be done without reloading the payment so that in-memory data is not changed + def different_from_db_payment_state?(in_memory_payment_state, payment_id) + in_memory_payment_state != Spree::Payment.find(payment_id).state + end + end +end diff --git a/app/services/orders_bulk_cancel_service.rb b/app/services/orders_bulk_cancel_service.rb deleted file mode 100644 index a788183ffc..0000000000 --- a/app/services/orders_bulk_cancel_service.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class OrdersBulkCancelService - def initialize(params, current_user) - @order_ids = params[:bulk_ids] - @current_user = current_user - @send_cancellation_email = params[:send_cancellation_email] - @restock_items = params[:restock_items] - end - - def call - editable_orders.where(id: @order_ids).each do |order| - order.send_cancellation_email = @send_cancellation_email - order.restock_items = @restock_items - order.cancel - end - end - - private - - def editable_orders - Permissions::Order.new(@current_user).editable_orders - end -end diff --git a/app/services/permitted_attributes/product.rb b/app/services/permitted_attributes/product.rb index 96b9e18cf8..1adc8ff7d9 100644 --- a/app/services/permitted_attributes/product.rb +++ b/app/services/permitted_attributes/product.rb @@ -5,7 +5,8 @@ module PermittedAttributes def self.attributes [ :id, :name, :description, :supplier_id, :price, - :variant_unit, :variant_unit_scale, :unit_value, :unit_description, :variant_unit_name, + :variant_unit, :variant_unit_scale, :variant_unit_with_scale, :unit_value, + :unit_description, :variant_unit_name, :display_as, :sku, :group_buy, :group_buy_unit_size, :taxon_ids, :primary_taxon_id, :tax_category_id, :meta_keywords, :notes, :inherits_properties, diff --git a/app/services/permitted_attributes/variant.rb b/app/services/permitted_attributes/variant.rb index 47e4481e5b..21f0f997b8 100644 --- a/app/services/permitted_attributes/variant.rb +++ b/app/services/permitted_attributes/variant.rb @@ -7,7 +7,7 @@ module PermittedAttributes :id, :sku, :on_hand, :on_demand, :shipping_category_id, :price, :unit_value, :unit_description, :display_name, :display_as, :tax_category_id, - :weight, :height, :width, :depth + :weight, :height, :width, :depth, :taxon_ids, :primary_taxon_id ] end end diff --git a/app/services/place_proxy_order.rb b/app/services/place_proxy_order.rb index aaa88f620d..03bd379d9d 100644 --- a/app/services/place_proxy_order.rb +++ b/app/services/place_proxy_order.rb @@ -87,7 +87,7 @@ class PlaceProxyOrder end def move_to_completion - OrderWorkflow.new(order).complete! + Orders::WorkflowService.new(order).complete! end def send_placement_email diff --git a/app/services/process_payment_intent.rb b/app/services/process_payment_intent.rb index be6d4f233f..eb4429edbb 100644 --- a/app/services/process_payment_intent.rb +++ b/app/services/process_payment_intent.rb @@ -58,7 +58,7 @@ class ProcessPaymentIntent def process_payment return unless order.process_payments! - OrderWorkflow.new(order).complete + Orders::WorkflowService.new(order).complete end def ready_for_capture? diff --git a/app/services/products_renderer.rb b/app/services/products_renderer.rb index 99745ca451..d7296e9fa1 100644 --- a/app/services/products_renderer.rb +++ b/app/services/products_renderer.rb @@ -35,7 +35,7 @@ class ProductsRenderer @products ||= begin results = distributed_products. - products_relation. + products_taxons_relation. order(Arel.sql(products_order)) filter_and_paginate(results). @@ -54,7 +54,7 @@ class ProductsRenderer def filter_and_paginate(query) results = query.ransack(args[:q]).result - _pagy, paginated_results = pagy( + _pagy, paginated_results = pagy_arel( results, page: args[:page] || 1, items: args[:per_page] || DEFAULT_PER_PAGE @@ -64,7 +64,7 @@ class ProductsRenderer end def distributed_products - OrderCycleDistributedProducts.new(distributor, order_cycle, customer) + OrderCycles::DistributedProductsService.new(distributor, order_cycle, customer) end def products_order @@ -78,7 +78,7 @@ class ProductsRenderer distributor.preferred_shopfront_taxon_order.present? distributor .preferred_shopfront_taxon_order - .split(",").map { |id| "spree_products.primary_taxon_id=#{id} DESC" } + .split(",").map { |id| "first_variant.primary_taxon_id=#{id} DESC" } .join(", ") + ", spree_products.name ASC, spree_products.id ASC" else "spree_products.name ASC, spree_products.id" @@ -89,10 +89,12 @@ class ProductsRenderer @variants_for_shop ||= begin scoper = OpenFoodNetwork::ScopeVariantToHub.new(distributor) + # rubocop:disable Rails/FindEach # .each returns an array, .find_each returns nil distributed_products.variants_relation. includes(:default_price, :stock_locations, :product). where(product_id: products). each { |v| scoper.scope(v) } # Scope results with variant_overrides + # rubocop:enable Rails/FindEach end end diff --git a/app/services/sets/product_set.rb b/app/services/sets/product_set.rb index 1adcdcb579..ba3fb40240 100644 --- a/app/services/sets/product_set.rb +++ b/app/services/sets/product_set.rb @@ -46,18 +46,12 @@ module Sets # variant.update( { price: xx.x } ) # def update_product_attributes(attributes) - split_taxon_ids!(attributes) - product = find_model(@collection, attributes[:id]) return if product.nil? update_product(product, attributes) end - def split_taxon_ids!(attributes) - attributes[:taxon_ids] = attributes[:taxon_ids].split(',') if attributes[:taxon_ids].present? - end - def update_product(product, attributes) return false unless update_product_only_attributes(product, attributes) diff --git a/app/services/shop/order_cycles_list.rb b/app/services/shop/order_cycles_list.rb index 5b0a6930cd..dd505c569e 100644 --- a/app/services/shop/order_cycles_list.rb +++ b/app/services/shop/order_cycles_list.rb @@ -12,8 +12,8 @@ module Shop def self.ready_for_checkout_for(distributor, customer) new(distributor, customer).call.select do |order_cycle| order = Spree::Order.new(distributor:, order_cycle:) - OrderAvailablePaymentMethods.new(order, customer).to_a.any? && - OrderAvailableShippingMethods.new(order, customer).to_a.any? + Orders::AvailablePaymentMethodsService.new(order, customer).to_a.any? && + Orders::AvailableShippingMethodsService.new(order, customer).to_a.any? end end diff --git a/app/services/weights_and_measures.rb b/app/services/weights_and_measures.rb index 7fd8528fe7..1cb70b4752 100644 --- a/app/services/weights_and_measures.rb +++ b/app/services/weights_and_measures.rb @@ -20,6 +20,44 @@ class WeightsAndMeasures scales[product_scale.to_f]['system'] end + # @returns enumerable with label and value for select + def self.variant_unit_options + available_units_sorted.flat_map do |measurement, measurement_info| + measurement_info.filter_map do |scale, unit_info| + scale_clean = + ActiveSupport::NumberHelper.number_to_rounded(scale, precision: nil, + strip_insignificant_zeros: true) + [ + "#{I18n.t(measurement)} (#{unit_info['name']})", # Label (eg "Weight (g)") + "#{measurement}_#{scale_clean}", # Scale ID (eg "weight_1") + ] + end + end << + [ + I18n.t('items'), + 'items' + ] + end + + def self.available_units + CurrentConfig.get(:available_units).split(",") + end + + def self.available_units_sorted + self::UNITS.transform_values do |measurement_info| + # Filter to only include available units + measurement_info.filter do |_scale, unit_info| + available_units.include?(unit_info['name']) + end. + # Remove duplicates by name + uniq do |_scale, unit_info| + unit_info['name'] + end. + # Sort by unit number + sort.to_h + end + end + private UNITS = { @@ -29,10 +67,10 @@ class WeightsAndMeasures 1000.0 => { 'name' => 'kg', 'system' => 'metric' }, 1_000_000.0 => { 'name' => 'T', 'system' => 'metric' }, - 28.349523125 => { 'name' => 'oz', 'system' => 'imperial' }, 28.35 => { 'name' => 'oz', 'system' => 'imperial' }, - 453.59237 => { 'name' => 'lb', 'system' => 'imperial' }, + 28.349523125 => { 'name' => 'oz', 'system' => 'imperial' }, 453.6 => { 'name' => 'lb', 'system' => 'imperial' }, + 453.59237 => { 'name' => 'lb', 'system' => 'imperial' }, }, 'volume' => { 0.001 => { 'name' => 'mL', 'system' => 'metric' }, @@ -49,7 +87,7 @@ class WeightsAndMeasures return @units[@variant.product.variant_unit] if ignore_available_units @units[@variant.product.variant_unit]&.reject { |_scale, unit_info| - available_units.exclude?(unit_info['name']) + self.class.available_units.exclude?(unit_info['name']) } end @@ -67,8 +105,4 @@ class WeightsAndMeasures largest_unit end - - def available_units - Spree::Config.available_units.split(",") - end end diff --git a/app/views/admin/customers/index.html.haml b/app/views/admin/customers/index.html.haml index a463b2e0ed..ea65c31108 100644 --- a/app/views/admin/customers/index.html.haml +++ b/app/views/admin/customers/index.html.haml @@ -14,22 +14,22 @@ = admin_inject_shops(@shops, module: 'admin.customers') = admin_inject_available_countries(module: 'admin.customers') -%div{ ng: { controller: 'customersCtrl' } } +%div{ "ng-controller": 'customersCtrl' } .row.filters .sixteen.columns.alpha.omega .filter_select.five.columns.alpha - %label{ :for => 'quick_search', ng: {class: '{disabled: !shop_id}'} }=t('admin.quick_search') + %label{ for: 'quick_search', "ng-class": '{disabled: !shop_id}' }=t('admin.quick_search') %br - %input.fullwidth{ :type => "text", :id => 'quick_search', ng: { model: 'quickSearch', disabled: '!shop_id' }, :placeholder => t('.search_by_email') } + %input.fullwidth{ type: "text", id: 'quick_search', placeholder: t('.search_by_email'), "ng-model": 'quickSearch', "ng-disabled": '!shop_id' } .filter_select.four.columns - %label{ :for => 'hub_id', ng: { bind: "shop_id ? '#{t('admin.shop')}' : '#{t('admin.variant_overrides.index.select_a_shop')}'" } } + %label{ for: 'hub_id', "ng-bind": "shop_id ? '#{t('admin.shop')}' : '#{t('admin.variant_overrides.index.select_a_shop')}'" } %br - %input.ofn-select2.fullwidth#shop_id{ 'ng-model' => 'shop_id', name: 'shop_id', data: 'shops', on: { selecting: 'confirmRefresh' } } + %input.ofn-select2.fullwidth#shop_id{ "ng-model": 'shop_id', name: 'shop_id', data: 'shops', "on-selecting": 'confirmRefresh' } .seven.columns.omega   - %hr.divider{ ng: { show: "!RequestMonitor.loading && filteredCustomers.length > 0" } } + %hr.divider{ "ng-show": "!RequestMonitor.loading && filteredCustomers.length > 0" } - .row.controls{ ng: { show: "!RequestMonitor.loading && filteredCustomers.length > 0" } } + .row.controls{ "ng-show": "!RequestMonitor.loading && filteredCustomers.length > 0" } .thirteen.columns.alpha   %columns-dropdown{ action: "#{controller_name}_#{action_name}" } @@ -39,13 +39,13 @@ %h1 = t :loading_customers - .row.margin-bottom-50{ ng: { show: "!RequestMonitor.loading" } } + .row.margin-bottom-50{ "ng-show": "!RequestMonitor.loading" } %form{ name: "customers_form" } %h1#no_results{ 'ng-show' => '!RequestMonitor.loading && filteredCustomers.length == 0' } =t :no_customers_found %save-bar{ dirty: "customers_form.$dirty", persist: "false" } - %input.red{ type: "button", value: t(:save_changes), ng: { click: "submitAll(customers_form)" } } + %input.red{ type: "button", value: t(:save_changes), "ng-click": "submitAll(customers_form)" } %table.index#customers{ 'ng-show' => '!RequestMonitor.loading && filteredCustomers.length > 0' } %col.email{ width: "20%", 'ng-show' => 'columns.email.visible' } @@ -58,7 +58,7 @@ %col.balance{ width: "10%", 'ng-show' => 'columns.balance.visible' } %col.actions{ width: "10%"} %thead - %tr{ ng: { controller: "ColumnsCtrl" } } + %tr{ "ng-controller": "ColumnsCtrl" } -# %th.bulk -# %input{ :type => "checkbox", :name => 'toggle_bulk', 'ng-click' => 'toggleAllCheckboxes()', 'ng-checked' => "allBoxesChecked()" } %th.email{ 'ng-show' => 'columns.email.visible' } @@ -81,12 +81,12 @@ %span{ 'ng-bind' => '::customer.email' } %span.guest-label{ 'ng-show' => 'customer.user_id == null' }= t('.guest_label') %td.first_name{ 'ng-show' => 'columns.first_name.visible'} - %input{ type: 'text', name: 'first_name', ng: { model: 'customer.first_name' }, 'obj-for-update' => 'customer', 'attr-for-update' => 'first_name'} + %input{ type: 'text', name: 'first_name', "obj-for-update": 'customer', "attr-for-update": 'first_name', "ng-model": 'customer.first_name' } %td.last_name{ 'ng-show' => 'columns.last_name.visible'} - %input{ type: 'text', name: 'last_name', ng: { model: 'customer.last_name' }, 'obj-for-update' => 'customer', 'attr-for-update' => 'last_name'} + %input{ type: 'text', name: 'last_name', "obj-for-update": 'customer', "attr-for-update": 'last_name', "ng-model": 'customer.last_name' } %td.code{ 'ng-show' => 'columns.code.visible' } - %input{ type: 'text', name: 'code', ng: {model: 'customer.code', change: 'checkForDuplicateCodes()'}, "obj-for-update" => "customer", "attr-for-update" => "code" } - %i.icon-warning-sign{ ng: {if: 'duplicate'} } + %input{ type: 'text', name: 'code', "obj-for-update": "customer", "attr-for-update": "code", "ng-model": 'customer.code', "ng-change": 'checkForDuplicateCodes()' } + %i.icon-warning-sign{ "ng-if": 'duplicate' } = t('.duplicate_code') %td.tags{ 'ng-show' => 'columns.tags.visible' } .tag_watcher{ 'obj-for-update' => "customer", "attr-for-update" => "tag_list"} @@ -101,6 +101,6 @@ %td.actions %a{ 'ng-click' => "deleteCustomer(customer)", :class => "delete-customer icon-trash no-text" } - %div.text-center{ ng: { show: "filteredCustomers.length > customerLimit" } } - %input{ type: 'button', value: t(:show_more), ng: { click: 'customerLimit = customerLimit + 20' } } - %input{ type: 'button', value: t(:show_all_with_more, num: '{{ filteredCustomers.length - customerLimit }}'), ng: { click: 'customerLimit = filteredCustomers.length' } } + %div.text-center{ "ng-show": "filteredCustomers.length > customerLimit" } + %input{ type: 'button', value: t(:show_more), "ng-click": 'customerLimit = customerLimit + 20' } + %input{ type: 'button', value: t(:show_all_with_more, num: '{{ filteredCustomers.length - customerLimit }}'), "ng-click": 'customerLimit = filteredCustomers.length' } diff --git a/app/views/admin/dfc_product_imports/index.html.haml b/app/views/admin/dfc_product_imports/index.html.haml new file mode 100644 index 0000000000..60a3f7a05a --- /dev/null +++ b/app/views/admin/dfc_product_imports/index.html.haml @@ -0,0 +1,7 @@ +- content_for :page_title do + #{t(".title")} + += render partial: 'spree/admin/shared/product_sub_menu' + +%p= t(".imported_products") += @count diff --git a/app/views/admin/enterprise_fees/index.html.haml b/app/views/admin/enterprise_fees/index.html.haml index e237704243..27b8c64403 100644 --- a/app/views/admin/enterprise_fees/index.html.haml +++ b/app/views/admin/enterprise_fees/index.html.haml @@ -29,20 +29,20 @@ %th.actions %tbody = enterprise_fee_set_form.ng_fields_for :collection do |f| - %tr{ ng: { repeat: 'enterprise_fee in enterprise_fees | filter:query' } } + %tr{ "ng-repeat": 'enterprise_fee in enterprise_fees | filter:query' } %td = f.ng_hidden_field :id - %ofn-select{ :id => angular_id(:enterprise_id), data: 'enterprises', ng: { model: 'enterprise_fee.enterprise_id' }, style: "width: 90%" } - %input{ type: "hidden", name: angular_name(:enterprise_id), ng: { value: "enterprise_fee.enterprise_id" } } + %ofn-select{ id: angular_id(:enterprise_id), data: 'enterprises', style: "width: 90%", "ng-model": 'enterprise_fee.enterprise_id' } + %input{ type: "hidden", name: angular_name(:enterprise_id), "ng-value": "enterprise_fee.enterprise_id" } %td= f.ng_select :fee_type, enterprise_fee_type_options, 'enterprise_fee.fee_type' %td= f.ng_text_field :name, { placeholder: t('.name_placeholder') } %td - %ofn-select{ :id => angular_id(:tax_category_id), data: 'tax_categories', include_blank: true, ng: { model: 'enterprise_fee.tax_category_id' } } + %ofn-select{ id: angular_id(:tax_category_id), data: 'tax_categories', include_blank: true, "ng-model": 'enterprise_fee.tax_category_id' } %input{ type: "hidden", name: angular_name(:tax_category_id), 'watch-tax-category' => true } - %input{ type: "hidden", name: angular_name(:inherits_tax_category), ng: { value: "enterprise_fee.inherits_tax_category" } } + %input{ type: "hidden", name: angular_name(:inherits_tax_category), "ng-value": "enterprise_fee.inherits_tax_category" } %td - %ofn-select.calculator_type{ :id => angular_id(:calculator_type), ng: { model: 'enterprise_fee.calculator_type' }, value_attr: 'name', text_attr: 'description', data: 'calculators', 'spree-ensure-calculator-preferences-match-type' => true } - %input{ type: "hidden", name: angular_name(:calculator_type), ng: { value: "enterprise_fee.calculator_type" } } + %ofn-select.calculator_type{ id: angular_id(:calculator_type), value_attr: 'name', text_attr: 'description', data: 'calculators', "spree-ensure-calculator-preferences-match-type": true, "ng-model": 'enterprise_fee.calculator_type' } + %input{ type: "hidden", name: angular_name(:calculator_type), "ng-value": "enterprise_fee.calculator_type" } %td{'ng-bind-html-unsafe-compiled' => 'enterprise_fee.calculator_settings'} %td.actions{'spree-delete-resource' => "1"} diff --git a/app/views/admin/enterprise_groups/_form.html.haml b/app/views/admin/enterprise_groups/_form.html.haml index 9e95a39879..a5a80a9871 100644 --- a/app/views/admin/enterprise_groups/_form.html.haml +++ b/app/views/admin/enterprise_groups/_form.html.haml @@ -1,7 +1,7 @@ = render 'spree/shared/error_messages', target: @enterprise = form_for [main_app, :admin, @enterprise_group] do |f| - .row{ ng: {app: 'admin.enterprise_groups', controller: 'enterpriseGroupCtrl'}, data: { controller: 'tabs-and-panels', "tabs-and-panels-class-name-value": "selected" } } + .row{ data: { controller: 'tabs-and-panels', "tabs-and-panels-class-name-value": "selected" }, "ng-app": 'admin.enterprise_groups', "ng-controller": 'enterpriseGroupCtrl' } .sixteen.columns.alpha .four.columns.alpha = render 'admin/shared/side_menu' diff --git a/app/views/admin/enterprise_relationships/_form.html.haml b/app/views/admin/enterprise_relationships/_form.html.haml index e79da0b144..484bfe0cf4 100644 --- a/app/views/admin/enterprise_relationships/_form.html.haml +++ b/app/views/admin/enterprise_relationships/_form.html.haml @@ -8,7 +8,7 @@ %select.select2.fullwidth{id: "enterprise_relationship_child_id", "ng-model" => "child_id", "ng-options" => "e.id as e.name for e in Enterprises.all_enterprises"} %td %label - %input{type: "checkbox", ng: {checked: "allPermissionsChecked()", click: "checkAllPermissions()"}} + %input{ type: "checkbox", "ng-checked": "allPermissionsChecked()", "ng-click": "checkAllPermissions()" } = t 'admin_enterprise_relationships_everything' %div{"ng-repeat" => "permission in EnterpriseRelationships.all_permissions"} %label diff --git a/app/views/admin/enterprise_relationships/_search_input.html.haml b/app/views/admin/enterprise_relationships/_search_input.html.haml index a85f201b91..b7f60be8c6 100644 --- a/app/views/admin/enterprise_relationships/_search_input.html.haml +++ b/app/views/admin/enterprise_relationships/_search_input.html.haml @@ -1,5 +1,5 @@ %input.search{"ng-model" => "query", "placeholder" => t(:admin_enterprise_relationships_seach_placeholder)} -%label{ng: {repeat: "permission in EnterpriseRelationships.all_permissions"}} - %input{type: "checkbox", ng: {click: "$parent.query = toggleKeyword($parent.query, permission)"}} +%label{ "ng-repeat": "permission in EnterpriseRelationships.all_permissions" } + %input{ type: "checkbox", "ng-click": "$parent.query = toggleKeyword($parent.query, permission)" } {{ EnterpriseRelationships.permission_presentation(permission) }} diff --git a/app/views/admin/enterprises/_change_type_form.html.haml b/app/views/admin/enterprises/_change_type_form.html.haml index 5a71a1bb45..685ac3980d 100644 --- a/app/views/admin/enterprises/_change_type_form.html.haml +++ b/app/views/admin/enterprises/_change_type_form.html.haml @@ -3,13 +3,13 @@ = form_for @enterprise, url: main_app.register_admin_enterprise_path(@enterprise), html: { name: "change_type", id: "change_type", novalidate: true, "ng-app" => "admin.enterprises", "ng-controller"=> 'changeTypeFormCtrl' } do |change_type_form| -# Have to use hidden:'true' on this input rather than type:'hidden' as the latter seems to break ngPattern and therefore validation - %input{ hidden: "true", name: "sells", ng: { required: true, pattern: "/^(none|own|any)$/", model: 'sells', value: "sells"} } + %input{ hidden: "true", name: "sells", "ng-required": true, "ng-pattern": "/^(none|own|any)$/", "ng-model": 'sells', "ng-value": "sells" } .row .options.container - if @enterprise.is_primary_producer .basic_producer.option.six.columns.alpha - %a.full-width.button.selector{ ng: { click: "sells='none'", class: "{selected: sells=='none'}" } } + %a.full-width.button.selector{ "ng-click": "sells='none'", "ng-class": "{selected: sells=='none'}" } .top %h3= t('.producer_profile') %p= t('.connect_ofn') @@ -18,7 +18,7 @@ = t('.producer_description_text') .producer_shop.option.six.columns - %a.full-width.button.selector{ ng: { click: "sells='own'", class: "{selected: sells=='own'}" } } + %a.full-width.button.selector{ "ng-click": "sells='own'", "ng-class": "{selected: sells=='own'}" } .top %h3= t('.producer_shop') %p= t('.sell_your_produce') @@ -29,7 +29,7 @@ = t('.producer_shop_description_text2') .full_hub.option.six.columns.omega - %a.full-width.button.selector{ ng: { click: "sells='any'", class: "{selected: sells=='any'}" } } + %a.full-width.button.selector{ "ng-click": "sells='any'", "ng-class": "{selected: sells=='any'}" } .top %h3= t('.producer_hub') %p= t('.producer_hub_text') @@ -40,7 +40,7 @@ .two.columns.alpha   .shop_profile.option.six.columns - %a.full-width.button.selector{ ng: { click: "sells='none'", class: "{selected: sells=='none'}" } } + %a.full-width.button.selector{ "ng-click": "sells='none'", "ng-class": "{selected: sells=='none'}" } .top %h3= t('.profile') %p= t('.get_listing') @@ -49,7 +49,7 @@ = t('.profile_description_text') .full_hub.option.six.columns - %a.full-width.button.selector{ ng: { click: "sells='any'", class: "{selected: sells=='any'}" } } + %a.full-width.button.selector{ "ng-click": "sells='any'", "ng-class": "{selected: sells=='any'}" } .top %h3= t('.hub_shop') %p= t('.hub_shop_text') @@ -60,11 +60,11 @@ .row .sixteen.columns.alpha - %span.error{ ng: { show: "(change_type.sells.$error.required || change_type.sells.$error.pattern) && submitted" } } + %span.error{ "ng-show": "(change_type.sells.$error.required || change_type.sells.$error.pattern) && submitted" } = t('.choose_option') - if @enterprise.sells == 'unspecified' - %input.button.big{ type: 'submit', value: t(:select_continue), ng: { click: "submit(change_type)" } } + %input.button.big{ type: 'submit', value: t(:select_continue), "ng-click": "submit(change_type)" } - else - %input.button.big{ type: 'submit', value: t('.change_now'), ng: { click: "submit(change_type)" } } + %input.button.big{ type: 'submit', value: t('.change_now'), "ng-click": "submit(change_type)" } %br   %hr diff --git a/app/views/admin/enterprises/_enterprise_user_index.html.haml b/app/views/admin/enterprises/_enterprise_user_index.html.haml index 46090da6af..030bc07de1 100644 --- a/app/views/admin/enterprises/_enterprise_user_index.html.haml +++ b/app/views/admin/enterprises/_enterprise_user_index.html.haml @@ -1,4 +1,4 @@ -%div{ ng: { controller: 'enterprisesCtrl' } } +%div{ "ng-controller": 'enterprisesCtrl' } .row{ 'ng-hide' => '!loaded' } .controls{ :class => "sixteen columns alpha", :style => "margin-bottom: 15px;" } .four.columns.alpha @@ -15,32 +15,32 @@ .row{ :class => "sixteen columns alpha", 'ng-show' => 'loaded && filteredEnterprises.length == 0'} %h1#no_results= t('.no_enterprises_found') - .row{ ng: { show: "loaded && filteredEnterprises.length > 0" } } + .row{ "ng-show": "loaded && filteredEnterprises.length > 0" } %table.index#enterprises - %col.name{ width: "28%", ng: { show: 'columns.name.visible' } } - %col.producer{ width: "18%", ng: { show: 'columns.producer.visible' }} - %col.package{ width: "18%", ng: { show: 'columns.package.visible' }} - %col.status{ width: "18%", ng: { show: 'columns.status.visible' }} - %col.manage{ width: "18%", ng: { show: 'columns.manage.visible' }} + %col.name{ width: "28%", "ng-show": 'columns.name.visible' } + %col.producer{ width: "18%", "ng-show": 'columns.producer.visible' } + %col.package{ width: "18%", "ng-show": 'columns.package.visible' } + %col.status{ width: "18%", "ng-show": 'columns.status.visible' } + %col.manage{ width: "18%", "ng-show": 'columns.manage.visible' } %thead - %tr{ ng: { controller: "ColumnsCtrl" } } - %th.name{ ng: { show: 'columns.name.visible' } }=t('admin.name') - %th.producer{ ng: { show: 'columns.producer.visible' } }=t('.producer?') - %th.package{ ng: { show: 'columns.package.visible' } }=t('.package') - %th.status{ ng: { show: 'columns.status.visible' } }=t('.status') - %th.manage{ ng: { show: 'columns.manage.visible' } }=t('.manage') - %tbody.panel-ctrl{ :id => "e_{{enterprise.id}}", object: "enterprise", ng: { repeat: "enterprise in filteredEnterprises = ( allEnterprises | filter:{ name: quickSearch } )" } } - %tr.enterprise{ ng: { class: { even: "'even'", odd: "'odd'"} } } - %td.name{ ng: { show: 'columns.name.visible' } } - %span{ ng: { bind: "::enterprise.name" } } - %td.producer.panel-toggle.text-center{ ng: { show: 'columns.producer.visible', class: "{error: enterprise.producerError}" }, name: "producer" } - %h5{ ng: { bind: "enterprise.producer" } } - %td.package.panel-toggle.text-center{ ng: { show: 'columns.package.visible', class: "{error: enterprise.packageError}" }, name: "package" } - %h5{ ng: { bind: "enterprise.package" } } - %td.status.panel-toggle.text-center{ ng: { show: 'columns.status.visible' }, name: "status" } - %i.icon-status{ ng: { class: "enterprise.status" } } - %td.manage{ ng: { show: 'columns.manage.visible' } } - %a.button.fullwidth{ ng: { href: '{{::enterprise.edit_path}}' } } + %tr{ "ng-controller": "ColumnsCtrl" } + %th.name{ "ng-show": 'columns.name.visible' }=t('admin.name') + %th.producer{ "ng-show": 'columns.producer.visible' }=t('.producer?') + %th.package{ "ng-show": 'columns.package.visible' }=t('.package') + %th.status{ "ng-show": 'columns.status.visible' }=t('.status') + %th.manage{ "ng-show": 'columns.manage.visible' }=t('.manage') + %tbody.panel-ctrl{ id: "e_{{enterprise.id}}", object: "enterprise", "ng-repeat": "enterprise in filteredEnterprises = ( allEnterprises | filter:{ name: quickSearch } )" } + %tr.enterprise{ "ng-class-even": "'even'", "ng-class-odd": "'odd'" } + %td.name{ "ng-show": 'columns.name.visible' } + %span{ "ng-bind": "::enterprise.name" } + %td.producer.panel-toggle.text-center{ name: "producer", "ng-show": 'columns.producer.visible', "ng-class": "{error: enterprise.producerError}" } + %h5{ "ng-bind": "enterprise.producer" } + %td.package.panel-toggle.text-center{ name: "package", "ng-show": 'columns.package.visible', "ng-class": "{error: enterprise.packageError}" } + %h5{ "ng-bind": "enterprise.package" } + %td.status.panel-toggle.text-center{ name: "status", "ng-show": 'columns.status.visible' } + %i.icon-status{ "ng-class": "enterprise.status" } + %td.manage{ "ng-show": 'columns.manage.visible' } + %a.button.fullwidth{ "ng-href": '{{::enterprise.edit_path}}' } = t('.manage_link') %i.icon-arrow-right diff --git a/app/views/admin/enterprises/_ng_form.html.haml b/app/views/admin/enterprises/_ng_form.html.haml index 18f29a5701..3ea83f8fbd 100644 --- a/app/views/admin/enterprises/_ng_form.html.haml +++ b/app/views/admin/enterprises/_ng_form.html.haml @@ -8,8 +8,8 @@ "ng-cloak" => true } do |f| %save-bar{ dirty: "enterprise_form.$dirty", persist: "true" } - %input.red{ type: "button", value: t(:update), ng: { click: "submit()", disabled: "!enterprise_form.$dirty" } } - %input{ type: "button", ng: { value: "enterprise_form.$dirty ? '#{t(:cancel)}' : '#{t(:close)}'", click: "cancel('#{main_app.admin_enterprises_path}')" } } + %input.red{ type: "button", value: t(:update), "ng-click": "submit()", "ng-disabled": "!enterprise_form.$dirty" } + %input{ type: "button", "ng-value": "enterprise_form.$dirty ? '#{t(:cancel)}' : '#{t(:close)}'", "ng-click": "cancel('#{main_app.admin_enterprises_path}')" } .row{ data: { controller: "tabs-and-panels", "tabs-and-panels-class-name-value": "selected" }} diff --git a/app/views/admin/enterprises/form/_images.html.haml b/app/views/admin/enterprises/form/_images.html.haml index a5340b4a60..de1ab19c9f 100644 --- a/app/views/admin/enterprises/form/_images.html.haml +++ b/app/views/admin/enterprises/form/_images.html.haml @@ -4,10 +4,10 @@ %br = t('.logo_size') .omega.eight.columns - %img{ class: 'image-field-group__preview-image', ng: { src: '{{ Enterprise.logo.thumb }}', if: 'Enterprise.logo' } } + %img{ class: 'image-field-group__preview-image', "ng-src": '{{ Enterprise.logo.thumb }}', "ng-if": 'Enterprise.logo' } %br = f.file_field :logo - %a.button.red{ href: '', ng: {click: 'removeLogo()', if: 'Enterprise.logo'} } + %a.button.red{ href: '', "ng-click": 'removeLogo()', "ng-if": 'Enterprise.logo' } = t('.remove_logo') .row.page-admin-enterprises-form__promo-image-field-group.image-field-group @@ -21,7 +21,7 @@ = t('.promo_image_note3') .omega.eight.columns - %img{ class: 'image-field-group__preview-image', ng: { src: '{{ Enterprise.promo_image.large }}', if: 'Enterprise.promo_image' } } + %img{ class: 'image-field-group__preview-image', "ng-src": '{{ Enterprise.promo_image.large }}', "ng-if": 'Enterprise.promo_image' } = f.file_field :promo_image - %a.button.red{ href: '', ng: {click: 'removePromoImage()', if: 'Enterprise.promo_image'} } + %a.button.red{ href: '', "ng-click": 'removePromoImage()', "ng-if": 'Enterprise.promo_image' } = t('.remove_promo_image') diff --git a/app/views/admin/enterprises/form/_shop_preferences.html.haml b/app/views/admin/enterprises/form/_shop_preferences.html.haml index be2d5d2045..616d631509 100644 --- a/app/views/admin/enterprises/form/_shop_preferences.html.haml +++ b/app/views/admin/enterprises/form/_shop_preferences.html.haml @@ -23,17 +23,13 @@ = radio_button :enterprise, :preferred_shopfront_product_sorting_method, :by_category, { 'ng-model' => 'Enterprise.preferred_shopfront_product_sorting_method' } = label :enterprise, :preferred_shopfront_product_sorting_method_by_category, t('.shopfront_sort_by_category') .eight.columns.omega - %textarea.fullwidth{ id: 'enterprise_preferred_shopfront_taxon_order', name: 'enterprise[preferred_shopfront_taxon_order]', rows: 6, - 'ofn-taxon-autocomplete' => '', 'multiple-selection' => 'true', placeholder: t('.shopfront_sort_by_category_placeholder'), - ng: { model: 'Enterprise.preferred_shopfront_taxon_order', readonly: "Enterprise.preferred_shopfront_product_sorting_method != 'by_category'" }} + %textarea.fullwidth{ id: 'enterprise_preferred_shopfront_taxon_order', name: 'enterprise[preferred_shopfront_taxon_order]', rows: 6, "ofn-taxon-autocomplete": '', "multiple-selection": 'true', placeholder: t('.shopfront_sort_by_category_placeholder'), "ng-model": 'Enterprise.preferred_shopfront_taxon_order', "ng-readonly": "Enterprise.preferred_shopfront_product_sorting_method != 'by_category'" } .row .three.columns.alpha = radio_button :enterprise, :preferred_shopfront_product_sorting_method, :by_producer, { 'ng-model' => 'Enterprise.preferred_shopfront_product_sorting_method' } = label :enterprise, :preferred_shopfront_product_sorting_method_by_producer, t('.shopfront_sort_by_producer') .eight.columns.omega - %textarea.fullwidth{ id: 'enterprise_preferred_shopfront_producer_order', name: 'enterprise[preferred_shopfront_producer_order]', rows: 6, - 'ofn-producer-autocomplete' => '', 'multiple-selection' => 'true', placeholder: t('.shopfront_sort_by_producer_placeholder'), - ng: { model: 'Enterprise.preferred_shopfront_producer_order', readonly: "Enterprise.preferred_shopfront_product_sorting_method != 'by_producer'" }} + %textarea.fullwidth{ id: 'enterprise_preferred_shopfront_producer_order', name: 'enterprise[preferred_shopfront_producer_order]', rows: 6, "ofn-producer-autocomplete": '', "multiple-selection": 'true', placeholder: t('.shopfront_sort_by_producer_placeholder'), "ng-model": 'Enterprise.preferred_shopfront_producer_order', "ng-readonly": "Enterprise.preferred_shopfront_product_sorting_method != 'by_producer'" } .row .three.columns.alpha @@ -56,7 +52,7 @@ = f.radio_button :require_login, true, "ng-model" => "Enterprise.require_login", "ng-value" => "true" = f.label :require_login, t('.shopfront_requires_login_true'), value: :true -.row{ng: {if: "!Enterprise.require_login"}} +.row{ "ng-if": "!Enterprise.require_login" } .three.columns.alpha %label= t '.allow_guest_orders' %div{'ofn-with-tip' => t('.allow_guest_orders_tip')} @@ -67,7 +63,7 @@ .five.columns.omega = f.radio_button :allow_guest_orders, false, "ng-model" => "Enterprise.allow_guest_orders", "ng-value" => "false" = f.label :allow_guest_orders, t('.allow_guest_orders_false'), value: :false - .row.warning{ng: {show: 'Enterprise.allow_guest_orders && Enterprise.allow_order_changes'}} + .row.warning{ "ng-show": 'Enterprise.allow_guest_orders && Enterprise.allow_order_changes' } .eight.columns.alpha.omega %i.icon-warning-sign = t '.recommend_require_login' diff --git a/app/views/admin/enterprises/form/_tag_rules.html.haml b/app/views/admin/enterprises/form/_tag_rules.html.haml index 822ea3f1ff..875d09a8b8 100644 --- a/app/views/admin/enterprises/form/_tag_rules.html.haml +++ b/app/views/admin/enterprises/form/_tag_rules.html.haml @@ -1,11 +1,11 @@ -.row{ ng: { controller: "TagRulesCtrl" } } +.row{ "ng-controller": "TagRulesCtrl" } .eleven.columns.alpha.omega - %ofn-sortable{ axis: "y", handle: ".header", items: '.customer_tag', position: "tagGroup.position", after: { sort: "updateRuleCounts()" } } - .no_tags{ ng: { show: "tagGroups.length == 0" } } + %ofn-sortable{ axis: "y", handle: ".header", items: '.customer_tag', position: "tagGroup.position", "after-sort": "updateRuleCounts()" } + .no_tags{ "ng-show": "tagGroups.length == 0" } = t('.no_tags_yet') = render 'admin/enterprises/form/tag_rules/default_rules' -# = render 'customer_tags' - .customer_tag{ id: "tg_{{tagGroup.position}}", ng: { repeat: "tagGroup in tagGroups" } } + .customer_tag{ id: "tg_{{tagGroup.position}}", "ng-repeat": "tagGroup in tagGroups" } .header %table %colgroup @@ -16,12 +16,12 @@ %h5 = t('.for_customers_tagged') %td - %tags-with-translation{ object: "tagGroup", max: 1, on: { tag: { added: "updateTagsRulesFor(tagGroup)", removed: "updateTagsRulesFor(tagGroup)" } } } + %tags-with-translation{ object: "tagGroup", max: 1, "on-tag-added": "updateTagsRulesFor(tagGroup)", "on-tag-removed": "updateTagsRulesFor(tagGroup)" } - .no_rules{ ng: { show: "tagGroup.rules.length == 0" } } + .no_rules{ "ng-show": "tagGroup.rules.length == 0" } = t('.no_rules_yet') - .tag_rule{ ng: { repeat: "rule in tagGroup.rules" } } + .tag_rule{ "ng-repeat": "rule in tagGroup.rules" } .add_rule.text-center %input.button.icon-plus{ type: 'button', value: t('.add_new_rule'), "add-new-rule-to" => "addNewRuleTo", "tag-group" => "tagGroup", "new-tag-rule-dialog" => true } .add_tag - %input.button.red.icon-plus{ type: 'button', value: t('.add_new_tag'), ng: { click: 'addNewTag()' } } + %input.button.red.icon-plus{ type: 'button', value: t('.add_new_tag'), "ng-click": 'addNewTag()' } diff --git a/app/views/admin/enterprises/form/_users.html.haml b/app/views/admin/enterprises/form/_users.html.haml index 8d33a27132..4951d09f8e 100644 --- a/app/views/admin/enterprises/form/_users.html.haml +++ b/app/views/admin/enterprises/form/_users.html.haml @@ -21,8 +21,8 @@ = render partial: 'admin/shared/whats_this_tooltip', locals: {tooltip_text: t('.contact_tip')} .eight.columns.omega - if full_permissions - %select.select2.fullwidth{id: 'receives_notifications_dropdown', name: 'receives_notifications', ng: {model: 'receivesNotifications', init: "receivesNotifications = '#{@enterprise.contact.id}'"}} - %option{ng: {repeat: 'user in Enterprise.users', selected: "user.id == #{@enterprise.contact.id}", hide: '!user.confirmed'}, value: '{{user.id}}'} + %select.select2.fullwidth{ id: 'receives_notifications_dropdown', name: 'receives_notifications', "ng-model": 'receivesNotifications', "ng-init": "receivesNotifications = '#{@enterprise.contact.id}'" } + %option{ value: '{{user.id}}', "ng-repeat": 'user in Enterprise.users', "ng-selected": "user.id == #{@enterprise.contact.id}", "ng-hide": '!user.confirmed' } {{user.email}} - else = @enterprise.contact.email @@ -41,16 +41,16 @@ - # Ignore this input in the submit = hidden_field_tag :ignored, nil, class: "select2 fullwidth", 'user-select' => 'newManager', 'ng-model' => 'newManager' %td.actions - %tr.animate-repeat{ id: "manager-{{manager.id}}", ng: { repeat: 'manager in Enterprise.users' }} + %tr.animate-repeat{ id: "manager-{{manager.id}}", "ng-repeat": 'manager in Enterprise.users' } %td = hidden_field_tag "enterprise[user_ids][]", nil, multiple: true, 'ng-value' => 'manager.id' {{ manager.email }} - %i.confirmation.confirmed.fa.fa-check-circle{ 'ofn-with-tip' => t('.email_confirmed'), ng: {show: 'manager.confirmed'} } - %i.confirmation.unconfirmed.fa.fa-exclamation-triangle{ 'ofn-with-tip' => t('.email_not_confirmed'), ng: {show: '!manager.confirmed'} } - %i.role.contact.fa.fa-envelope-o{ 'ofn-with-tip' => t('.contact'), ng: {show: 'manager.id == receivesNotifications'} } - %i.role.owner.fa.fa-star{ 'ofn-with-tip' => t('.owner'), ng: {show: 'manager.id == Enterprise.owner.id'} } + %i.confirmation.confirmed.fa.fa-check-circle{ "ofn-with-tip": t('.email_confirmed'), "ng-show": 'manager.confirmed' } + %i.confirmation.unconfirmed.fa.fa-exclamation-triangle{ "ofn-with-tip": t('.email_not_confirmed'), "ng-show": '!manager.confirmed' } + %i.role.contact.fa.fa-envelope-o{ "ofn-with-tip": t('.contact'), "ng-show": 'manager.id == receivesNotifications' } + %i.role.owner.fa.fa-star{ "ofn-with-tip": t('.owner'), "ng-show": 'manager.id == Enterprise.owner.id' } %td.actions - %a{ ng: {click: 'removeManager(manager)', class: "{disabled: manager.id == Enterprise.owner.id || manager.id == receivesNotifications}"}, :class => "icon-trash no-text" } + %a{ class: "icon-trash no-text", "ng-click": 'removeManager(manager)', "ng-class": "{disabled: manager.id == Enterprise.owner.id || manager.id == receivesNotifications}" } - else - @enterprise.users.each do |manager| diff --git a/app/views/admin/enterprises/form/tag_rules/_default_rules.html.haml b/app/views/admin/enterprises/form/tag_rules/_default_rules.html.haml index a58a71d8de..9bdb7570c6 100644 --- a/app/views/admin/enterprises/form/tag_rules/_default_rules.html.haml +++ b/app/views/admin/enterprises/form/tag_rules/_default_rules.html.haml @@ -8,9 +8,9 @@ %h5 = t('.by_default') %i.text-big.icon-question-sign{ "data-controller": "help-modal-link", "data-action": "click->help-modal-link#open", "data-help-modal-link-target-value": "tag_rule_help_modal" } - .no_rules{ ng: { show: "defaultTagGroup.rules.length == 0" } } + .no_rules{ "ng-show": "defaultTagGroup.rules.length == 0" } = t('.no_rules_yet') - .tag_rule{ ng: { repeat: "rule in defaultTagGroup.rules" } } + .tag_rule{ "ng-repeat": "rule in defaultTagGroup.rules" } .add_rule.text-center %input.button.icon-plus{ type: 'button', value: t('.add_new_button'), "add-new-rule-to" => "addNewRuleTo", "tag-group" => "defaultTagGroup", "new-tag-rule-dialog" => true } diff --git a/app/views/admin/enterprises/new.html.haml b/app/views/admin/enterprises/new.html.haml index 26a34ad45f..a035288a55 100644 --- a/app/views/admin/enterprises/new.html.haml +++ b/app/views/admin/enterprises/new.html.haml @@ -16,5 +16,5 @@ = form_for [main_app, :admin, @enterprise], html: { "nav-check" => '', "nav-callback" => '' } do |f| .row - .twelve.columns.fullwidth_inputs{ ng: { controller: "NewEnterpriseController" } } + .twelve.columns.fullwidth_inputs{ "ng-controller": "NewEnterpriseController" } = render 'new_form', f: f, scope: 'admin.enterprises.form' diff --git a/app/views/admin/invoice_settings/edit.html.haml b/app/views/admin/invoice_settings/edit.html.haml index 0647c38920..ec5e7e6e65 100644 --- a/app/views/admin/invoice_settings/edit.html.haml +++ b/app/views/admin/invoice_settings/edit.html.haml @@ -10,10 +10,11 @@ = check_box_tag 'preferences[enable_invoices?]', '1', Spree::Config[:enable_invoices?] = label_tag nil, t('.enable_invoices?') - .field.align-center - = hidden_field_tag 'preferences[invoice_style2?]', '0' - = check_box_tag 'preferences[invoice_style2?]', '1', Spree::Config[:invoice_style2?] - = label_tag nil, t('.invoice_style2?') + - if ! OpenFoodNetwork::FeatureToggle.enabled?(:invoices, spree_current_user) + .field.align-center + = hidden_field_tag 'preferences[invoice_style2?]', '0' + = check_box_tag 'preferences[invoice_style2?]', '1', Spree::Config[:invoice_style2?] + = label_tag nil, t('.invoice_style2?') .field.align-center = hidden_field_tag 'preferences[enterprise_number_required_on_invoices?]', '0' diff --git a/app/views/admin/order_cycles/_exchange_form.html.haml b/app/views/admin/order_cycles/_exchange_form.html.haml index 94481b1f13..2eba9bc1ae 100644 --- a/app/views/admin/order_cycles/_exchange_form.html.haml +++ b/app/views/admin/order_cycles/_exchange_form.html.haml @@ -1,4 +1,4 @@ -%tr{ ng: { class: "'#{type} #{type}-{{ exchange.enterprise_id }}'" } } +%tr{ "ng-class": "'#{type} #{type}-{{ exchange.enterprise_id }}'" } %td{:class => "#{type}_name"} {{ enterprises[exchange.enterprise_id].name }} %td.products.panel-toggle.text-center{ name: "products" } {{ exchangeSelectedVariants(exchange) }} / {{ exchangeTotalVariants(exchange) }} @@ -7,7 +7,7 @@ %td.receival-details = text_field_tag 'order_cycle_incoming_exchange_{{ $index }}_receival_instructions', '', 'id' => 'order_cycle_incoming_exchange_{{ $index }}_receival_instructions', 'placeholder' => t('.receival_instructions_placeholder'), 'ng-model' => 'exchange.receival_instructions' - if type == 'distributor' - %td.tags.panel-toggle.text-center{ name: "tags", ng: { if: 'enterprises[exchange.enterprise_id].managed || order_cycle.viewing_as_coordinator' } } + %td.tags.panel-toggle.text-center{ name: "tags", "ng-if": 'enterprises[exchange.enterprise_id].managed || order_cycle.viewing_as_coordinator' } {{ exchange.tags.length }} %td.collection-details = text_field_tag 'order_cycle_outgoing_exchange_{{ $index }}_pickup_time', '', 'ng-init' => 'setPickupTimeFieldDirty($index, exchange.pickup_time)', 'id' => 'order_cycle_outgoing_exchange_{{ $index }}_pickup_time', 'required' => 'required', 'placeholder' => t('.pickup_time_placeholder'), 'ng-model' => 'exchange.pickup_time', 'ng-disabled' => '!enterprises[exchange.enterprise_id].managed && !order_cycle.viewing_as_coordinator', 'maxlength' => 35 @@ -16,7 +16,7 @@ = text_field_tag 'order_cycle_outgoing_exchange_{{ $index }}_pickup_instructions', '', 'id' => 'order_cycle_outgoing_exchange_{{ $index }}_pickup_instructions', 'placeholder' => t('.pickup_instructions_placeholder'), 'ng-model' => 'exchange.pickup_instructions', 'ng-disabled' => '!enterprises[exchange.enterprise_id].managed && !order_cycle.viewing_as_coordinator' %span.icon-question-sign{'ofn-with-tip' => t('.pickup_instructions_tip')} %td.fees - %ol{ ng: { show: 'enterprises[exchange.enterprise_id].managed || order_cycle.viewing_as_coordinator' } } + %ol{ "ng-show": 'enterprises[exchange.enterprise_id].managed || order_cycle.viewing_as_coordinator' } %li{'ng-repeat' => 'enterprise_fee in exchange.enterprise_fees'} = select_tag 'order_cycle_{{ exchangeDirection(exchange) }}_exchange_{{ $parent.$index }}_enterprise_fees_{{ $index }}_enterprise_id', nil, {'id' => 'order_cycle_{{ exchangeDirection(exchange) }}_exchange_{{ $parent.$index }}_enterprise_fees_{{ $index }}_enterprise_id', 'ng-model' => 'enterprise_fee.enterprise_id', 'ng-options' => 'enterprise.id as enterprise.name for enterprise in enterprisesWithFees()'} diff --git a/app/views/admin/order_cycles/_filters.html.haml b/app/views/admin/order_cycles/_filters.html.haml index a798f0ebe4..2013aed9f3 100644 --- a/app/views/admin/order_cycles/_filters.html.haml +++ b/app/views/admin/order_cycles/_filters.html.haml @@ -2,20 +2,20 @@ .filter.four.columns.alpha %label{ :for => 'query' }=t('admin.quick_search') %br - %input.fullwidth{ :type => "text", :id => 'query', ng: { model: 'query' }, placeholder: t(".search_by_order_cycle_name") } + %input.fullwidth{ type: "text", id: 'query', placeholder: t(".search_by_order_cycle_name"), "ng-model": 'query' } .filter_select.four.columns %label{ :for => 'involving_filter' }=t('.involving') %br - %input.ofn-select2.fullwidth{ id: 'involving_filter', type: 'number', blank: "{id: 0, name: '#{j t(".any_enterprise")}'}", data: 'enterprises', ng: { model: 'involvingFilter' } } + %input.ofn-select2.fullwidth{ id: 'involving_filter', type: 'number', blank: "{id: 0, name: '#{j t(".any_enterprise")}'}", data: 'enterprises', "ng-model": 'involvingFilter' } - if subscriptions_enabled? .filter_select.four.columns %label{ :for => 'schedule_filter' }=t('admin.order_cycles.index.schedule') %br - %input.ofn-select2.fullwidth{ id: 'schedule_filter', type: 'number', blank: "{id: 0, name: '#{j t(".any_schedule")}'}", data: 'schedules', ng: { model: 'scheduleFilter' } } + %input.ofn-select2.fullwidth{ id: 'schedule_filter', type: 'number', blank: "{id: 0, name: '#{j t(".any_schedule")}'}", data: 'schedules', "ng-model": 'scheduleFilter' } .one.columns   - else .five.columns   .filter_clear.three.columns.omega %label{ :for => 'clear_all_filters' } %br - %input.red.fullwidth{ :type => 'button', :id => 'clear_all_filters', :value => "#{t('admin.clear_all')}", ng: { click: "resetSelectFilters()" } } + %input.red.fullwidth{ type: 'button', id: 'clear_all_filters', value: "#{t('admin.clear_all')}", "ng-click": "resetSelectFilters()" } diff --git a/app/views/admin/order_cycles/_header.html.haml b/app/views/admin/order_cycles/_header.html.haml index 0d3f9fba8e..981726f631 100644 --- a/app/views/admin/order_cycles/_header.html.haml +++ b/app/views/admin/order_cycles/_header.html.haml @@ -1,35 +1,35 @@ %colgroup - %col{ ng: { show: 'columns.name.visible' } } - %col{ ng: { show: 'columns.schedules.visible' } } - %col{ ng: { show: 'columns.open.visible' }, style: 'width: 20%;' } - %col{ ng: { show: 'columns.close.visible' }, style: 'width: 20%;' } + %col{ "ng-show": 'columns.name.visible' } + %col{ "ng-show": 'columns.schedules.visible' } + %col{ style: 'width: 20%;', "ng-show": 'columns.open.visible' } + %col{ style: 'width: 20%;', "ng-show": 'columns.close.visible' } - unless simple_index - %col{ ng: { show: 'columns.producers.visible' } } - %col{ ng: { show: 'columns.coordinator.visible' } } - %col{ ng: { show: 'columns.shops.visible' } } - %col{ ng: { show: 'columns.products.visible' } } + %col{ "ng-show": 'columns.producers.visible' } + %col{ "ng-show": 'columns.coordinator.visible' } + %col{ "ng-show": 'columns.shops.visible' } + %col{ "ng-show": 'columns.products.visible' } %col{ style: 'width: 5%;' } %col{ style: 'width: 5%;' } %col{ style: 'width: 5%;' } %thead %tr - %th{ ng: { show: 'columns.name.visible' } } + %th{ "ng-show": 'columns.name.visible' } =t :name - %th{ ng: { show: 'columns.schedules.visible' } } + %th{ "ng-show": 'columns.schedules.visible' } =t('admin.order_cycles.index.schedules') - %th{ ng: { show: 'columns.open.visible' } } + %th{ "ng-show": 'columns.open.visible' } =t :open - %th{ ng: { show: 'columns.close.visible' } } + %th{ "ng-show": 'columns.close.visible' } =t :close - unless simple_index - %th{ ng: { show: 'columns.producers.visible' } } + %th{ "ng-show": 'columns.producers.visible' } =t :label_producers - %th{ ng: { show: 'columns.coordinator.visible' } } + %th{ "ng-show": 'columns.coordinator.visible' } =t :coordinator - %th{ ng: { show: 'columns.shops.visible' } } + %th{ "ng-show": 'columns.shops.visible' } =t :label_shops - %th{ ng: { show: 'columns.products.visible' } } + %th{ "ng-show": 'columns.products.visible' } =t :products %th.actions %th.actions diff --git a/app/views/admin/order_cycles/_loading_flash.html.haml b/app/views/admin/order_cycles/_loading_flash.html.haml index 64689ffe29..8d670b5d6e 100644 --- a/app/views/admin/order_cycles/_loading_flash.html.haml +++ b/app/views/admin/order_cycles/_loading_flash.html.haml @@ -1,6 +1,6 @@ -%div.sixteen.columns.alpha.omega#loading{ ng: { cloak: true, if: 'RequestMonitor.loading' } } +%div.sixteen.columns.alpha.omega#loading{ "ng-cloak": true, "ng-if": 'RequestMonitor.loading' } = render partial: "components/admin_spinner" - %h1{ ng: { hide: 'orderCycles.length > 0' } } + %h1{ "ng-hide": 'orderCycles.length > 0' } = t('.loading_order_cycles') - %h1{ ng: { show: 'orderCycles.length > 0' } } + %h1{ "ng-show": 'orderCycles.length > 0' } = t('.loading') diff --git a/app/views/admin/order_cycles/_name_and_timing_form.html.haml b/app/views/admin/order_cycles/_name_and_timing_form.html.haml index 172a5763e2..e3bc8df191 100644 --- a/app/views/admin/order_cycles/_name_and_timing_form.html.haml +++ b/app/views/admin/order_cycles/_name_and_timing_form.html.haml @@ -35,11 +35,6 @@ = f.label :schedule_ids, t('admin.order_cycles.index.schedules') .six.columns - if viewing_as_coordinator_of?(@order_cycle) - %input.fullwidth.ofn-select2#schedule_ids{ name: 'order_cycle[schedule_ids]', - data: 'schedules', - multiple: 'true', - placeholder: t('admin.please_select'), - filter: '{viewing_as_coordinator: true}', - ng: { model: 'order_cycle.schedule_ids' } } + %input.fullwidth.ofn-select2#schedule_ids{ name: 'order_cycle[schedule_ids]', data: 'schedules', multiple: 'true', placeholder: t('admin.please_select'), filter: '{viewing_as_coordinator: true}', "ng-model": 'order_cycle.schedule_ids' } - else %schedule-list{ 'order-cycle' => 'order_cycle' } diff --git a/app/views/admin/order_cycles/_row.html.haml b/app/views/admin/order_cycles/_row.html.haml index 4508858a1d..f331e4ca83 100644 --- a/app/views/admin/order_cycles/_row.html.haml +++ b/app/views/admin/order_cycles/_row.html.haml @@ -1,39 +1,39 @@ -%tr{ class: "order-cycle-{{orderCycle.id}} {{orderCycle.status}}", ng: { repeat: 'orderCycle in orderCycles | schedule:scheduleFilter | involving:involvingFilter | filter:{name: query} track by orderCycle.id' } } - %td.name{ ng: { show: 'columns.name.visible' } } - %input{ id: 'oc{{::orderCycle.id}}_name', name: 'oc{{::orderCycle.id}}[name]', type: 'text', ng: { model: 'orderCycle.name', disabled: '!orderCycle.viewing_as_coordinator' } } - %td.schedules{ ng: { show: 'columns.schedules.visible' } } - %span{ ng: { repeat: 'schedule in orderCycle.schedules'} } +%tr{ class: "order-cycle-{{orderCycle.id}} {{orderCycle.status}}", "ng-repeat": 'orderCycle in orderCycles | schedule:scheduleFilter | involving:involvingFilter | filter:{name: query} track by orderCycle.id' } + %td.name{ "ng-show": 'columns.name.visible' } + %input{ id: 'oc{{::orderCycle.id}}_name', name: 'oc{{::orderCycle.id}}[name]', type: 'text', "ng-model": 'orderCycle.name', "ng-disabled": '!orderCycle.viewing_as_coordinator' } + %td.schedules{ "ng-show": 'columns.schedules.visible' } + %span{ "ng-repeat": 'schedule in orderCycle.schedules' } %a{ 'schedule-dialog' => true, 'schedule-id' => '{{schedule.id}}' } {{ schedule.name + ($last ? '' : ',') }} - %span{ ng: { show: 'orderCycle.schedules.length == 0'}} None - %td.orders_open_at{ ng: { show: 'columns.open.visible' } } - %input.datetimepicker{ id: 'oc{{::orderCycle.id}}_orders_open_at', name: 'oc{{::orderCycle.id}}[orders_open_at]', type: 'text', ng: { if: 'orderCycle.viewing_as_coordinator', model: 'orderCycle.orders_open_at' }, data: { controller: "flatpickr", "flatpickr-enable-time-value": true }, 'change-warning' => 'orderCycle' } - %input{ id: 'oc{{::orderCycle.id}}_orders_open_at', name: 'oc{{::orderCycle.id}}[orders_open_at]', type: 'text', ng: { if: '!orderCycle.viewing_as_coordinator', model: 'orderCycle.orders_open_at'}, disabled: true } - %td.orders_close_at{ ng: { show: 'columns.close.visible' } } - %input.datetimepicker{ id: 'oc{{::orderCycle.id}}_orders_close_at', name: 'oc{{::orderCycle.id}}[orders_close_at]', type: 'text', ng: { if: 'orderCycle.viewing_as_coordinator', model: 'orderCycle.orders_close_at' }, data: { controller: "flatpickr", "flatpickr-enable-time-value": true }, 'change-warning' => 'orderCycle' } - %input{ id: 'oc{{::orderCycle.id}}_orders_close_at', name: 'oc{{::orderCycle.id}}[orders_close_at]', type: 'text', ng: { if: '!orderCycle.viewing_as_coordinator', model: 'orderCycle.orders_close_at'}, disabled: true } + %span{ "ng-show": 'orderCycle.schedules.length == 0' } None + %td.orders_open_at{ "ng-show": 'columns.open.visible' } + %input.datetimepicker{ id: 'oc{{::orderCycle.id}}_orders_open_at', name: 'oc{{::orderCycle.id}}[orders_open_at]', type: 'text', data: { controller: "flatpickr", "flatpickr-enable-time-value": true }, "change-warning": 'orderCycle', "ng-if": 'orderCycle.viewing_as_coordinator', "ng-model": 'orderCycle.orders_open_at' } + %input{ id: 'oc{{::orderCycle.id}}_orders_open_at', name: 'oc{{::orderCycle.id}}[orders_open_at]', type: 'text', disabled: true, "ng-if": '!orderCycle.viewing_as_coordinator', "ng-model": 'orderCycle.orders_open_at' } + %td.orders_close_at{ "ng-show": 'columns.close.visible' } + %input.datetimepicker{ id: 'oc{{::orderCycle.id}}_orders_close_at', name: 'oc{{::orderCycle.id}}[orders_close_at]', type: 'text', data: { controller: "flatpickr", "flatpickr-enable-time-value": true }, "change-warning": 'orderCycle', "ng-if": 'orderCycle.viewing_as_coordinator', "ng-model": 'orderCycle.orders_close_at' } + %input{ id: 'oc{{::orderCycle.id}}_orders_close_at', name: 'oc{{::orderCycle.id}}[orders_close_at]', type: 'text', disabled: true, "ng-if": '!orderCycle.viewing_as_coordinator', "ng-model": 'orderCycle.orders_close_at' } - unless simple_index - %td.producers{ ng: { show: 'columns.producers.visible' } } - %span{'ofn-with-tip' => '{{ orderCycle.producerNames }}', ng: { show: 'orderCycle.producers.length > 3' } } + %td.producers{ "ng-show": 'columns.producers.visible' } + %span{ "ofn-with-tip": '{{ orderCycle.producerNames }}', "ng-show": 'orderCycle.producers.length > 3' } {{ orderCycle.producers.length }} = t('.suppliers') - %span{ ng: { hide: 'orderCycle.producers.length > 3', bind: 'orderCycle.producerNames' } } - %td.coordinator{ ng: { show: 'columns.coordinator.visible', bind: { html: 'orderCycle.coordinator.name'} } } - %td.shops{ ng: { show: 'columns.shops.visible' } } - %span{'ofn-with-tip' => '{{ orderCycle.shopNames }}', ng: { show: 'orderCycle.shops.length > 3' } } + %span{ "ng-hide": 'orderCycle.producers.length > 3', "ng-bind": 'orderCycle.producerNames' } + %td.coordinator{ "ng-show": 'columns.coordinator.visible', "ng-bind-html": 'orderCycle.coordinator.name' } + %td.shops{ "ng-show": 'columns.shops.visible' } + %span{ "ofn-with-tip": '{{ orderCycle.shopNames }}', "ng-show": 'orderCycle.shops.length > 3' } {{ orderCycle.shops.length }} = t('.distributors') - %span{ ng: { hide: 'orderCycle.shops.length > 3', bind: 'orderCycle.shopNames' } } + %span{ "ng-hide": 'orderCycle.shops.length > 3', "ng-bind": 'orderCycle.shopNames' } - %td.products{ ng: { show: 'columns.products.visible' } } + %td.products{ "ng-show": 'columns.products.visible' } %span {{orderCycle.variant_count}} = t('.variants') %td.actions - %a.edit-order-cycle.icon-edit.no-text{ ng: { href: '{{orderCycle.edit_path}}'}, 'ofn-with-tip' => t(:edit) } - %td.actions{ ng: { if: 'orderCycle.viewing_as_coordinator' } } - %a.clone-order-cycle.icon-copy.no-text{ ng: { href: '{{orderCycle.clone_path}}'}, 'ofn-with-tip' => t(:clone) } - %td.actions{ ng: { if: 'orderCycle.deletable && orderCycle.viewing_as_coordinator' }} - %a.delete-order-cycle.icon-trash.no-text{ ng: { href: '{{orderCycle.delete_path}}'}, data: { method: 'delete', confirm: t(:are_you_sure), "ujs-navigate": "false" }, 'ofn-with-tip' => t(:remove) } + %a.edit-order-cycle.icon-edit.no-text{ "ofn-with-tip": t(:edit), "ng-href": '{{orderCycle.edit_path}}' } + %td.actions{ "ng-if": 'orderCycle.viewing_as_coordinator' } + %a.clone-order-cycle.icon-copy.no-text{ "ofn-with-tip": t(:clone), "ng-href": '{{orderCycle.clone_path}}' } + %td.actions{ "ng-if": 'orderCycle.deletable && orderCycle.viewing_as_coordinator' } + %a.delete-order-cycle.icon-trash.no-text{ data: { method: 'delete', confirm: t(:are_you_sure), "ujs-navigate": "false" }, "ofn-with-tip": t(:remove), "ng-href": '{{orderCycle.delete_path}}' } diff --git a/app/views/admin/order_cycles/_show_more.html.haml b/app/views/admin/order_cycles/_show_more.html.haml index 22191c4e38..80b7de3628 100644 --- a/app/views/admin/order_cycles/_show_more.html.haml +++ b/app/views/admin/order_cycles/_show_more.html.haml @@ -1,4 +1,4 @@ -.text-center.margin-bottom-50{ ng: { hide: "RequestMonitor.loading" } } - %input{ type: 'button', value: "#{t('admin.show_n_more', num: '30')} #{t(:days)}", ng: { click: 'showMore(30)' } } +.text-center.margin-bottom-50{ "ng-hide": "RequestMonitor.loading" } + %input{ type: 'button', value: "#{t('admin.show_n_more', num: '30')} #{t(:days)}", "ng-click": 'showMore(30)' } - %input{ type: 'button', value: "#{t('admin.show_n_more', num: '90')} #{t(:days)}", ng: { click: 'showMore(90)' } } + %input{ type: 'button', value: "#{t('admin.show_n_more', num: '90')} #{t(:days)}", "ng-click": 'showMore(90)' } diff --git a/app/views/admin/order_cycles/_simple_form.html.haml b/app/views/admin/order_cycles/_simple_form.html.haml index 8b8ac6f200..ff3fa25c6f 100644 --- a/app/views/admin/order_cycles/_simple_form.html.haml +++ b/app/views/admin/order_cycles/_simple_form.html.haml @@ -15,9 +15,9 @@ = label_tag t('.products') %table.exchanges - %tbody{ng: {repeat: "exchange in order_cycle.incoming_exchanges"}} + %tbody{ "ng-repeat": "exchange in order_cycle.incoming_exchanges" } %tr.products - %td{ ng: { include: "'admin/panels/exchange_products_simple.html'" } } + %td{ "ng-include": "'admin/panels/exchange_products_simple.html'" } %br = label_tag t('.tags') diff --git a/app/views/admin/order_cycles/edit.html.haml b/app/views/admin/order_cycles/edit.html.haml index 3a67c072bd..f6f3bc6f49 100644 --- a/app/views/admin/order_cycles/edit.html.haml +++ b/app/views/admin/order_cycles/edit.html.haml @@ -19,13 +19,13 @@ = form_for [main_app, :admin, @order_cycle], :url => '', :html => {:class => 'ng order_cycle', 'ng-app' => 'admin.orderCycles', 'ng-controller' => ng_controller, name: 'order_cycle_form'} do |f| %save-bar{ dirty: "order_cycle_form.$dirty", persist: "true" } - %input.red{ type: "button", value: t('.save'), ng: { click: "submit($event, null)", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } } + %input.red{ type: "button", value: t('.save'), "ng-click": "submit($event, null)", "ng-disabled": "!order_cycle_form.$dirty || order_cycle_form.$invalid" } - if @order_cycle.simple? - %input.red{ type: "button", value: t('.save_and_back_to_list'), ng: { click: "submit($event, '#{main_app.admin_order_cycles_path}')", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } } + %input.red{ type: "button", value: t('.save_and_back_to_list'), "ng-click": "submit($event, '#{main_app.admin_order_cycles_path}')", "ng-disabled": "!order_cycle_form.$dirty || order_cycle_form.$invalid" } - else - %input.red{ type: "button", value: t('.save_and_next'), ng: { click: "submit($event, '#{main_app.admin_order_cycle_incoming_path(@order_cycle)}')", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } } - %input{ type: "button", value: t('.next'), ng: { click: "cancel('#{main_app.admin_order_cycle_incoming_path(@order_cycle)}')", disabled: "order_cycle_form.$dirty" } } - %input{ type: "button", ng: { value: "order_cycle_form.$dirty ? '#{t('.cancel')}' : '#{t('.back_to_list')}'", click: "cancel('#{main_app.admin_order_cycles_path}')" } } + %input.red{ type: "button", value: t('.save_and_next'), "ng-click": "submit($event, '#{main_app.admin_order_cycle_incoming_path(@order_cycle)}')", "ng-disabled": "!order_cycle_form.$dirty || order_cycle_form.$invalid" } + %input{ type: "button", value: t('.next'), "ng-click": "cancel('#{main_app.admin_order_cycle_incoming_path(@order_cycle)}')", "ng-disabled": "order_cycle_form.$dirty" } + %input{ type: "button", "ng-value": "order_cycle_form.$dirty ? '#{t('.cancel')}' : '#{t('.back_to_list')}'", "ng-click": "cancel('#{main_app.admin_order_cycles_path}')" } - if @order_cycle.simple? = render 'simple_form', f: f diff --git a/app/views/admin/order_cycles/incoming.html.haml b/app/views/admin/order_cycles/incoming.html.haml index c9f40b9322..d4dbc1806b 100644 --- a/app/views/admin/order_cycles/incoming.html.haml +++ b/app/views/admin/order_cycles/incoming.html.haml @@ -9,10 +9,10 @@ = render 'wizard_progress' %save-bar{ dirty: "order_cycle_form.$dirty", persist: "true" } - %input.red{ type: "button", value: t('.save'), ng: { click: "submit($event, null)", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } } - %input.red{ type: "button", value: t('.save_and_next'), ng: { click: "submit($event, '#{main_app.admin_order_cycle_outgoing_path(@order_cycle)}')", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } } - %input{ type: "button", value: t('.next'), ng: { click: "cancel('#{main_app.admin_order_cycle_outgoing_path(@order_cycle)}')", disabled: "order_cycle_form.$dirty" } } - %input{ type: "button", ng: { value: "order_cycle_form.$dirty ? '#{t('.cancel')}' : '#{t('.back_to_list')}'", click: "cancel('#{main_app.admin_order_cycles_path}')" } } + %input.red{ type: "button", value: t('.save'), "ng-click": "submit($event, null)", "ng-disabled": "!order_cycle_form.$dirty || order_cycle_form.$invalid" } + %input.red{ type: "button", value: t('.save_and_next'), "ng-click": "submit($event, '#{main_app.admin_order_cycle_outgoing_path(@order_cycle)}')", "ng-disabled": "!order_cycle_form.$dirty || order_cycle_form.$invalid" } + %input{ type: "button", value: t('.next'), "ng-click": "cancel('#{main_app.admin_order_cycle_outgoing_path(@order_cycle)}')", "ng-disabled": "order_cycle_form.$dirty" } + %input{ type: "button", "ng-value": "order_cycle_form.$dirty ? '#{t('.cancel')}' : '#{t('.back_to_list')}'", "ng-click": "cancel('#{main_app.admin_order_cycles_path}')" } %fieldset.no-border-bottom %legend{ align: 'center'}= t('.incoming') diff --git a/app/views/admin/order_cycles/index.html.haml b/app/views/admin/order_cycles/index.html.haml index ed53a56ea3..db6c544286 100644 --- a/app/views/admin/order_cycles/index.html.haml +++ b/app/views/admin/order_cycles/index.html.haml @@ -14,19 +14,19 @@ = admin_inject_column_preferences module: 'admin.orderCycles' -%div{ ng: { controller: 'OrderCyclesCtrl' } } +%div{ "ng-controller": 'OrderCyclesCtrl' } = render 'admin/order_cycles/filters' %hr.divider - .row.controls{ ng: { show: "orderCycles.length > 0" } } + .row.controls{ "ng-show": "orderCycles.length > 0" } .thirteen.columns.alpha   %columns-dropdown{ action: "#{controller_name}_#{action_name}" } %form{ name: 'order_cycles_form' } %save-bar{ dirty: "order_cycles_form.$dirty", persist: "false" } - %input.red{ type: "button", value: t(:save_changes), ng: { click: "saveAll()", disabled: "!order_cycles_form.$dirty" } } - %table.index#listing_order_cycles{ ng: { show: 'orderCycles.length > 0' } } + %input.red{ type: "button", value: t(:save_changes), "ng-click": "saveAll()", "ng-disabled": "!order_cycles_form.$dirty" } + %table.index#listing_order_cycles{ "ng-show": 'orderCycles.length > 0' } = render 'admin/order_cycles/header' #, simple_index: simple_index %tbody = render 'admin/order_cycles/row' #, simple_index: simple_index diff --git a/app/views/admin/order_cycles/new.html.haml b/app/views/admin/order_cycles/new.html.haml index 6c35515d2f..6dd1c0b22b 100644 --- a/app/views/admin/order_cycles/new.html.haml +++ b/app/views/admin/order_cycles/new.html.haml @@ -9,8 +9,8 @@ %save-bar{ dirty: "order_cycle_form.$dirty", persist: "true" } - if @order_cycle.simple? - custom_redirect_path = main_app.admin_order_cycles_path - %input.red{ type: "button", value: t('.create'), ng: { click: "submit($event, '#{custom_redirect_path}')", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } } - %input{ type: "button", ng: { value: "order_cycle_form.$dirty ? '#{t('.cancel')}' : '#{t('.back_to_list')}'", click: "cancel('#{main_app.admin_order_cycles_path}')" } } + %input.red{ type: "button", value: t('.create'), "ng-click": "submit($event, '#{custom_redirect_path}')", "ng-disabled": "!order_cycle_form.$dirty || order_cycle_form.$invalid" } + %input{ type: "button", "ng-value": "order_cycle_form.$dirty ? '#{t('.cancel')}' : '#{t('.back_to_list')}'", "ng-click": "cancel('#{main_app.admin_order_cycles_path}')" } - if @order_cycle.simple? = render 'simple_form', f: f diff --git a/app/views/admin/order_cycles/outgoing.html.haml b/app/views/admin/order_cycles/outgoing.html.haml index d5b148f1cc..4812d36f7d 100644 --- a/app/views/admin/order_cycles/outgoing.html.haml +++ b/app/views/admin/order_cycles/outgoing.html.haml @@ -9,10 +9,10 @@ = render 'wizard_progress' %save-bar{ dirty: "order_cycle_form.$dirty", persist: "true" } - %input.red{ type: "button", value: t('.save'), ng: { click: "submit($event, null)", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } } - %input.red{ type: "button", value: t('.save_and_next'), ng: { click: "submit($event, '#{main_app.admin_order_cycle_checkout_options_path(@order_cycle)}')", disabled: "!order_cycle_form.$dirty || order_cycle_form.$invalid" } } - %input{ type: "button", value: t('.next'), ng: { click: "cancel('#{main_app.admin_order_cycle_checkout_options_path(@order_cycle)}')", disabled: "order_cycle_form.$dirty" } } - %input{ type: "button", ng: { value: "order_cycle_form.$dirty ? '#{t('.cancel')}' : '#{t('.back_to_list')}'", click: "cancel('#{main_app.admin_order_cycles_path}')" } } + %input.red{ type: "button", value: t('.save'), "ng-click": "submit($event, null)", "ng-disabled": "!order_cycle_form.$dirty || order_cycle_form.$invalid" } + %input.red{ type: "button", value: t('.save_and_next'), "ng-click": "submit($event, '#{main_app.admin_order_cycle_checkout_options_path(@order_cycle)}')", "ng-disabled": "!order_cycle_form.$dirty || order_cycle_form.$invalid" } + %input{ type: "button", value: t('.next'), "ng-click": "cancel('#{main_app.admin_order_cycle_checkout_options_path(@order_cycle)}')", "ng-disabled": "order_cycle_form.$dirty" } + %input{ type: "button", "ng-value": "order_cycle_form.$dirty ? '#{t('.cancel')}' : '#{t('.back_to_list')}'", "ng-click": "cancel('#{main_app.admin_order_cycles_path}')" } %fieldset.no-border-bottom %legend{ align: 'center'}= t('.outgoing') @@ -27,7 +27,7 @@ %a{href: '#', 'ng-click' => "OrderCycle.toggleAllProducts('outgoing')"} %span{'ng-show' => "OrderCycle.showProducts['outgoing']"}= t(:collapse_all) %span{'ng-hide' => "OrderCycle.showProducts['outgoing']"}= t(:expand_all) - %th{ ng: { if: 'enterprises[exchange.enterprise_id].managed || order_cycle.viewing_as_coordinator' } } + %th{ "ng-if": 'enterprises[exchange.enterprise_id].managed || order_cycle.viewing_as_coordinator' } = t('.tags') %th= t('.delivery_details') %th= t('.fees') diff --git a/app/views/admin/product_import/_dfc_import_form.html.haml b/app/views/admin/product_import/_dfc_import_form.html.haml new file mode 100644 index 0000000000..3416a943e5 --- /dev/null +++ b/app/views/admin/product_import/_dfc_import_form.html.haml @@ -0,0 +1,16 @@ +%h3= t(".title") +%br + += form_with url: main_app.admin_dfc_product_imports_path, method: :get do |form| + = form.label :enterprise_id, t(".enterprise") + %span.required * + %br + = form.select :enterprise_id, options_from_collection_for_select(@producers, :id, :name, @producers.first&.id), { "data-controller": "tom-select", class: "primary" } + %br + %br + = form.label :catalog_url, t(".catalog_url") + %br + = form.text_field :catalog_url, size: 60 + %br + %br + = form.submit t(".import") diff --git a/app/views/admin/product_import/_entries_table.html.haml b/app/views/admin/product_import/_entries_table.html.haml index 6b0dcfdf6e..09be2df666 100644 --- a/app/views/admin/product_import/_entries_table.html.haml +++ b/app/views/admin/product_import/_entries_table.html.haml @@ -5,10 +5,10 @@ %th #{t('admin.product_import.import.line')} - @importer.table_headings.each do |heading| %th= heading - %tr{ng: {repeat: "(line_number, entry) in (entries | entriesFilterValid:'#{entries}')"}} + %tr{ "ng-repeat": "(line_number, entry) in (entries | entriesFilterValid:'#{entries}')" } %td - %i{ng: {class: "{'fa fa-warning error': (count(entry.errors) > 0), 'fa fa-check-circle success': (count(entry.errors) == 0)}"}} + %i{ "ng-class": "{'fa fa-warning error': (count(entry.errors) > 0), 'fa fa-check-circle success': (count(entry.errors) == 0)}" } %td {{line_number}} - %td{ng: {repeat: "(attribute, value) in entry.attributes", class: "{'invalid': attribute_invalid(attribute, line_number)}"}} + %td{ "ng-repeat": "(attribute, value) in entry.attributes", "ng-class": "{'invalid': attribute_invalid(attribute, line_number)}" } {{value}} diff --git a/app/views/admin/product_import/_errors_list.html.haml b/app/views/admin/product_import/_errors_list.html.haml index 787aabe76b..644f798bb1 100644 --- a/app/views/admin/product_import/_errors_list.html.haml +++ b/app/views/admin/product_import/_errors_list.html.haml @@ -1,9 +1,9 @@ -%div.import-errors{ng: {controller: 'ImportFeedbackCtrl', repeat: "(line_number, entry ) in (entries | entriesFilterValid:'invalid')"}} +%div.import-errors{ "ng-controller": 'ImportFeedbackCtrl', "ng-repeat": "(line_number, entry ) in (entries | entriesFilterValid:'invalid')" } %p.line %strong #{t('admin.product_import.import.item_line')} {{line_number}}: %span {{entry.attributes.name}} - %span{ng: {if: "entry.attributes.display_name"}} + %span{ "ng-if": "entry.attributes.display_name" } ( {{entry.attributes.display_name}} ) - %p.error{ng: {repeat: "(attribute, error) in entry.errors", show: "ignore_fields.indexOf(attribute) < 0" }} + %p.error{ "ng-repeat": "(attribute, error) in entry.errors", "ng-show": "ignore_fields.indexOf(attribute) < 0" }  -  {{error}} diff --git a/app/views/admin/product_import/_import_options.html.haml b/app/views/admin/product_import/_import_options.html.haml index c5c3e32c38..6e6144ffc9 100644 --- a/app/views/admin/product_import/_import_options.html.haml +++ b/app/views/admin/product_import/_import_options.html.haml @@ -4,7 +4,7 @@ - @importer.enterprises_index.each do |name, attrs| - if name and attrs[:id] and @importer.permission_by_id?(attrs[:id]) %div.panel-section.import-settings - %div.panel-header{ng: {click: 'togglePanel()', class: '{active: active}'}} + %div.panel-header{ "ng-click": 'togglePanel()', "ng-class": '{active: active}' } %div.header-icon.success %i.fa.fa-check-circle %div.header-description diff --git a/app/views/admin/product_import/_import_review.html.haml b/app/views/admin/product_import/_import_review.html.haml index 90d8de9577..c6ff771a60 100644 --- a/app/views/admin/product_import/_import_review.html.haml +++ b/app/views/admin/product_import/_import_review.html.haml @@ -1,7 +1,7 @@ %h5= t('admin.product_import.import.validation_overview') %br -%div{ng: {controller: 'ImportFeedbackCtrl'}} +%div{ "ng-controller": 'ImportFeedbackCtrl' } - if @importer.product_field_errors? .alert-box.warning @@ -9,10 +9,10 @@ %em= @non_updatable_fields.keys.join(', ') + "." = t('.fields_ignored') - %div.panel-section{ng: {controller: 'DropdownPanelsCtrl'}} - %div.panel-header{ng: {click: 'togglePanel()', class: '{active: active && count((entries | entriesFilterValid:"all"))}'}} + %div.panel-section{ "ng-controller": 'DropdownPanelsCtrl' } + %div.panel-header{ "ng-click": 'togglePanel()', "ng-class": '{active: active && count((entries | entriesFilterValid:"all"))}' } %div.header-caret - %i{ng: {class: "{'icon-chevron-down': active, 'icon-chevron-right': !active}", hide: 'count((entries | entriesFilterValid:"all")) == 0'}} + %i{ "ng-class": "{'icon-chevron-down': active, 'icon-chevron-right': !active}", "ng-hide": 'count((entries | entriesFilterValid:"all")) == 0' } %div.header-icon.success %i.fa.fa-info-circle.info %div.header-count @@ -20,13 +20,13 @@ {{ count((entries | entriesFilterValid:"all")) }} %div.header-description = t('admin.product_import.import.entries_found') - %div.panel-content{ng: {hide: '!active || count((entries | entriesFilterValid:"all")) == 0'}} + %div.panel-content{ "ng-hide": '!active || count((entries | entriesFilterValid:"all")) == 0' } = render 'entries_table', entries: 'all' - %div.panel-section{ng: {controller: 'DropdownPanelsCtrl', hide: 'count((entries | entriesFilterValid:"invalid")) == 0'}} - %div.panel-header{ng: {click: 'togglePanel()', class: '{active: active && count((entries | entriesFilterValid:"invalid"))}'}} + %div.panel-section{ "ng-controller": 'DropdownPanelsCtrl', "ng-hide": 'count((entries | entriesFilterValid:"invalid")) == 0' } + %div.panel-header{ "ng-click": 'togglePanel()', "ng-class": '{active: active && count((entries | entriesFilterValid:"invalid"))}' } %div.header-caret - %i{ng: {class: "{'icon-chevron-down': active, 'icon-chevron-right': !active}", hide: 'count((entries | entriesFilterValid:"invalid")) == 0'}} + %i{ "ng-class": "{'icon-chevron-down': active, 'icon-chevron-right': !active}", "ng-hide": 'count((entries | entriesFilterValid:"invalid")) == 0' } %div.header-icon.error %i.fa.fa-warning %div.header-count @@ -34,15 +34,15 @@ {{ count((entries | entriesFilterValid:"invalid")) }} %div.header-description = t('admin.product_import.import.entries_with_errors') - %div.panel-content{ng: {hide: '!active || count((entries | entriesFilterValid:"invalid")) == 0'}} + %div.panel-content{ "ng-hide": '!active || count((entries | entriesFilterValid:"invalid")) == 0' } = render 'errors_list' %br = render 'entries_table', entries: 'invalid' - %div.panel-section{ng: {controller: 'DropdownPanelsCtrl', hide: 'count((entries | entriesFilterValid:"create_product")) == 0'}} - %div.panel-header{ng: {click: 'togglePanel()', class: '{active: active && count((entries | entriesFilterValid:"create_product"))}'}} + %div.panel-section{ "ng-controller": 'DropdownPanelsCtrl', "ng-hide": 'count((entries | entriesFilterValid:"create_product")) == 0' } + %div.panel-header{ "ng-click": 'togglePanel()', "ng-class": '{active: active && count((entries | entriesFilterValid:"create_product"))}' } %div.header-caret - %i{ng: {class: "{'icon-chevron-down': active, 'icon-chevron-right': !active}", hide: 'count((entries | entriesFilterValid:"create_product")) == 0'}} + %i{ "ng-class": "{'icon-chevron-down': active, 'icon-chevron-right': !active}", "ng-hide": 'count((entries | entriesFilterValid:"create_product")) == 0' } %div.header-icon.success %i.fa.fa-check-circle %div.header-count @@ -50,13 +50,13 @@ {{ count((entries | entriesFilterValid:"create_product")) }} %div.header-description = t('admin.product_import.import.products_to_create') - %div.panel-content{ng: {hide: '!active || count((entries | entriesFilterValid:"create_product")) == 0'}} + %div.panel-content{ "ng-hide": '!active || count((entries | entriesFilterValid:"create_product")) == 0' } = render 'entries_table', entries: 'create_product' - %div.panel-section{ng: {controller: 'DropdownPanelsCtrl', hide: 'count((entries | entriesFilterValid:"update_product")) == 0'}} - %div.panel-header{ng: {click: 'togglePanel()', class: '{active: active && count((entries | entriesFilterValid:"update_product"))}'}} + %div.panel-section{ "ng-controller": 'DropdownPanelsCtrl', "ng-hide": 'count((entries | entriesFilterValid:"update_product")) == 0' } + %div.panel-header{ "ng-click": 'togglePanel()', "ng-class": '{active: active && count((entries | entriesFilterValid:"update_product"))}' } %div.header-caret - %i{ng: {class: "{'icon-chevron-down': active, 'icon-chevron-right': !active}", hide: 'count((entries | entriesFilterValid:"update_product")) == 0'}} + %i{ "ng-class": "{'icon-chevron-down': active, 'icon-chevron-right': !active}", "ng-hide": 'count((entries | entriesFilterValid:"update_product")) == 0' } %div.header-icon.success %i.fa.fa-check-circle %div.header-count @@ -64,13 +64,13 @@ {{ count((entries | entriesFilterValid:"update_product")) }} %div.header-description = t('admin.product_import.import.products_to_update') - %div.panel-content{ng: {hide: '!active || count((entries | entriesFilterValid:"update_product")) == 0'}} + %div.panel-content{ "ng-hide": '!active || count((entries | entriesFilterValid:"update_product")) == 0' } = render 'entries_table', entries: 'update_product' - %div.panel-section{ng: {controller: 'DropdownPanelsCtrl', hide: 'count((entries | entriesFilterValid:"create_inventory")) == 0'}} - %div.panel-header{ng: {click: 'togglePanel()', class: '{active: active && count((entries | entriesFilterValid:"create_inventory"))}'}} + %div.panel-section{ "ng-controller": 'DropdownPanelsCtrl', "ng-hide": 'count((entries | entriesFilterValid:"create_inventory")) == 0' } + %div.panel-header{ "ng-click": 'togglePanel()', "ng-class": '{active: active && count((entries | entriesFilterValid:"create_inventory"))}' } %div.header-caret - %i{ng: {class: "{'icon-chevron-down': active, 'icon-chevron-right': !active}", hide: 'count((entries | entriesFilterValid:"create_inventory")) == 0'}} + %i{ "ng-class": "{'icon-chevron-down': active, 'icon-chevron-right': !active}", "ng-hide": 'count((entries | entriesFilterValid:"create_inventory")) == 0' } %div.header-icon.success %i.fa.fa-check-circle %div.header-count @@ -78,13 +78,13 @@ {{ count((entries | entriesFilterValid:"create_inventory")) }} %div.header-description = t('admin.product_import.import.inventory_to_create') - %div.panel-content{ng: {hide: '!active || count((entries | entriesFilterValid:"create_inventory")) == 0'}} + %div.panel-content{ "ng-hide": '!active || count((entries | entriesFilterValid:"create_inventory")) == 0' } = render 'entries_table', entries: 'create_inventory' - %div.panel-section{ng: {controller: 'DropdownPanelsCtrl', hide: 'count((entries | entriesFilterValid:"update_inventory")) == 0'}} - %div.panel-header{ng: {click: 'togglePanel()', class: '{active: active && count((entries | entriesFilterValid:"update_inventory"))}'}} + %div.panel-section{ "ng-controller": 'DropdownPanelsCtrl', "ng-hide": 'count((entries | entriesFilterValid:"update_inventory")) == 0' } + %div.panel-header{ "ng-click": 'togglePanel()', "ng-class": '{active: active && count((entries | entriesFilterValid:"update_inventory"))}' } %div.header-caret - %i{ng: {class: "{'icon-chevron-down': active, 'icon-chevron-right': !active}", hide: 'count((entries | entriesFilterValid:"update_inventory")) == 0'}} + %i{ "ng-class": "{'icon-chevron-down': active, 'icon-chevron-right': !active}", "ng-hide": 'count((entries | entriesFilterValid:"update_inventory")) == 0' } %div.header-icon.success %i.fa.fa-check-circle %div.header-count @@ -92,10 +92,10 @@ {{ count((entries | entriesFilterValid:"update_inventory")) }} %div.header-description = t('admin.product_import.import.inventory_to_update') - %div.panel-content{ng: {hide: '!active || count((entries | entriesFilterValid:"update_inventory")) == 0'}} + %div.panel-content{ "ng-hide": '!active || count((entries | entriesFilterValid:"update_inventory")) == 0' } = render 'entries_table', entries: 'update_inventory' - %div.panel-section{ng: {controller: 'ImportOptionsFormCtrl', hide: 'resetTotal == 0'}} + %div.panel-section{ "ng-controller": 'ImportOptionsFormCtrl', "ng-hide": 'resetTotal == 0' } %div.panel-header %div.header-caret %div.header-icon.info diff --git a/app/views/admin/product_import/_save_results.html.haml b/app/views/admin/product_import/_save_results.html.haml index 90cf847468..87af4141cf 100644 --- a/app/views/admin/product_import/_save_results.html.haml +++ b/app/views/admin/product_import/_save_results.html.haml @@ -4,31 +4,31 @@ %div.post-save-results - %p{ng: {show: 'updates.products_created'}} - %i.fa{ng: {class: "{'fa-info-circle': updates.products_created == 0, 'fa-check-circle': updates.products_created > 0}"}} + %p{ "ng-show": 'updates.products_created' } + %i.fa{ "ng-class": "{'fa-info-circle': updates.products_created == 0, 'fa-check-circle': updates.products_created > 0}" } %strong.created-count {{ updates.products_created }} = t('.products_created') - %p{ng: {show: 'updates.products_updated'}} - %i.fa{ng: {class: "{'fa-info-circle': updates.products_updated == 0, 'fa-check-circle': updates.products_updated > 0}"}} + %p{ "ng-show": 'updates.products_updated' } + %i.fa{ "ng-class": "{'fa-info-circle': updates.products_updated == 0, 'fa-check-circle': updates.products_updated > 0}" } %strong.updated-count {{ updates.products_updated }} = t('.products_updated') - %p{ng: {show: 'updates.inventory_created'}} - %i.fa{ng: {class: "{'fa-info-circle': updates.inventory_created == 0, 'fa-check-circle': updates.inventory_created > 0}"}} + %p{ "ng-show": 'updates.inventory_created' } + %i.fa{ "ng-class": "{'fa-info-circle': updates.inventory_created == 0, 'fa-check-circle': updates.inventory_created > 0}" } %strong.inv-created-count {{ updates.inventory_created }} = t('.inventory_created') - %p{ng: {show: 'updates.inventory_updated'}} - %i.fa{ng: {class: "{'fa-info-circle': updates.inventory_updated == 0, 'fa-check-circle': updates.inventory_updated > 0}"}} + %p{ "ng-show": 'updates.inventory_updated' } + %i.fa{ "ng-class": "{'fa-info-circle': updates.inventory_updated == 0, 'fa-check-circle': updates.inventory_updated > 0}" } %strong.inv-updated-count {{ updates.inventory_updated }} = t('.inventory_updated') - %p{ng: {show: 'updates.products_reset'}} + %p{ "ng-show": 'updates.products_reset' } %i.fa.fa-info-circle %strong.reset-count {{ updates.products_reset }} @@ -39,24 +39,24 @@ %br - %p{ng: {show: 'update_errors.length == 0'}} + %p{ "ng-show": 'update_errors.length == 0' } = t('.all_saved') - %div{ng: {show: 'update_errors.length > 0'}} + %div{ "ng-show": 'update_errors.length > 0' } %p {{ updated_total }} #{t('.some_saved')} %br %h5= t('.save_errors') - %p.save-error{ng: {repeat: 'error in update_errors'}} + %p.save-error{ "ng-repeat": 'error in update_errors' }  -  {{ error }} %br - %div{ng: {show: 'updated_total > 0'}} - %a.button.view{href: main_app.admin_inventory_path, ng: {show: 'updates.inventory_created > 0 || updates.inventory_updated > 0'}} + %div{ "ng-show": 'updated_total > 0' } + %a.button.view{ href: main_app.admin_inventory_path, "ng-show": 'updates.inventory_created > 0 || updates.inventory_updated > 0' } = t('.view_inventory') - %a.button.view{href: admin_products_path, ng: {show: 'updates.products_created > 0 || updates.products_updated > 0'}} + %a.button.view{ href: admin_products_path, "ng-show": 'updates.products_created > 0 || updates.products_updated > 0' } = t('.view_products') %a.button{href: main_app.admin_product_import_path} diff --git a/app/views/admin/product_import/_upload_form.html.haml b/app/views/admin/product_import/_upload_form.html.haml index cbe9cc9f9c..7477789f82 100644 --- a/app/views/admin/product_import/_upload_form.html.haml +++ b/app/views/admin/product_import/_upload_form.html.haml @@ -1,4 +1,4 @@ -%div{ng: {app: 'admin.productImport', controller: 'ImportOptionsFormCtrl', init: "initForm()"}} +%div{ "ng-app": 'admin.productImport', "ng-controller": 'ImportOptionsFormCtrl', "ng-init": "initForm()" } = form_tag main_app.admin_product_import_path, multipart: true, class: 'product-import' do diff --git a/app/views/admin/product_import/import.html.haml b/app/views/admin/product_import/import.html.haml index fe938b39d8..658d05abb1 100644 --- a/app/views/admin/product_import/import.html.haml +++ b/app/views/admin/product_import/import.html.haml @@ -4,7 +4,7 @@ = render partial: 'ams_data' = render partial: 'spree/admin/shared/product_sub_menu' -.import-wrapper{ng: {app: 'admin.productImport', controller: 'ImportFormCtrl'}} +.import-wrapper{ "ng-app": 'admin.productImport', "ng-controller": 'ImportFormCtrl' } - if @importer.item_count == 0 %h5 @@ -13,14 +13,14 @@ = t('.none_to_save') %br - else - .settings-section{ng: {show: 'step == "settings"'}} + .settings-section{ "ng-show": 'step == "settings"' } = render 'import_options' if @importer.table_headings %br - %a.button.proceed{href: '', ng: {click: 'confirmSettings()'}} + %a.button.proceed{ href: '', "ng-click": 'confirmSettings()' } = t('.import') %a.button{href: main_app.admin_product_import_path} #{t('admin.cancel')} - .progress-interface{ng: {show: 'step == "import"'}} + .progress-interface{ "ng-show": 'step == "import"' } %span.filename = @original_filename %span.percentage @@ -34,12 +34,12 @@ = render 'import_review' if @importer.table_headings - %div{ng: {controller: 'ImportFeedbackCtrl', show: 'count((entries | entriesFilterValid:"valid")) > 0'}} - %div{ng: {if: 'count((entries | entriesFilterValid:"invalid")) > 0'}} + %div{ "ng-controller": 'ImportFeedbackCtrl', "ng-show": 'count((entries | entriesFilterValid:"valid")) > 0' } + %div{ "ng-if": 'count((entries | entriesFilterValid:"invalid")) > 0' } %br %h5= t('admin.product_import.import.some_invalid_entries') %p= t('admin.product_import.import.fix_before_import') - %div{ng: {show: 'count((entries | entriesFilterValid:"invalid")) == 0'}} + %div{ "ng-show": 'count((entries | entriesFilterValid:"invalid")) == 0' } %br %h5= t('.no_errors') %p= t('.save_all_imported?') @@ -47,22 +47,22 @@ = hidden_field_tag :filepath, @filepath = hidden_field_tag "settings[import_into]", @import_into - %a.button.proceed{href: '', ng: {show: 'count((entries | entriesFilterValid:"invalid")) == 0', click: 'acceptResults()'}} + %a.button.proceed{ href: '', "ng-show": 'count((entries | entriesFilterValid:"invalid")) == 0', "ng-click": 'acceptResults()' } = t('.save') %a.button{href: main_app.admin_product_import_path}= t('admin.cancel') - %div{ng: {controller: 'ImportFeedbackCtrl', show: 'count((entries | entriesFilterValid:"valid")) == 0'}} + %div{ "ng-controller": 'ImportFeedbackCtrl', "ng-show": 'count((entries | entriesFilterValid:"valid")) == 0' } %br %a.button{href: main_app.admin_product_import_path}= t('admin.cancel') - .progress-interface{ng: {show: 'step == "save"'}} + .progress-interface{ "ng-show": 'step == "save"' } %span.filename #{t('.save_imported')} ({{ percentage.save }}) .progress-bar{} - %span.progress-track{ng: {style: "{'width': percentage.save }"}} + %span.progress-track{ "ng-style": "{'width': percentage.save }" } %p.red {{ exception }} - .save-results{ng: {show: 'step == "complete"'}} + .save-results{ "ng-show": 'step == "complete"' } = render 'save_results' diff --git a/app/views/admin/product_import/index.html.haml b/app/views/admin/product_import/index.html.haml index ef4c6ed9c3..15e413fcf9 100644 --- a/app/views/admin/product_import/index.html.haml +++ b/app/views/admin/product_import/index.html.haml @@ -13,3 +13,5 @@ %br = render 'upload_form' + += render 'dfc_import_form' if spree_current_user.oidc_account.present? diff --git a/app/views/admin/products_v3/_content.html.haml b/app/views/admin/products_v3/_content.html.haml index b805747b71..dcb29e945f 100644 --- a/app/views/admin/products_v3/_content.html.haml +++ b/app/views/admin/products_v3/_content.html.haml @@ -1,4 +1,8 @@ -#products-content +%turbo-frame#products-content{ target: "_top", refresh: "morph" } + .spinner-overlay{ "data-controller": "loading", "data-products-target": "loading", class: "hidden" } + .spinner-container + .spinner + = t('.loading') .container .sixteen.columns = render partial: 'admin/shared/flashes', locals: { flashes: } if defined? flashes @@ -12,8 +16,8 @@ .sixteen.columns = render partial: 'sort', locals: { pagy: pagy, search_term: search_term, producer_id: producer_id, category_id: category_id } = render partial: 'table', locals: { products: products } - - if pagy.pages > 1 - = render partial: 'admin/shared/v3/pagy', locals: { pagy: pagy, reflex: "click->Products#fetch" } + - if pagy.present? && pagy.pages > 1 + = render partial: 'admin/shared/stimulus_pagination', locals: { pagy: pagy } - else #no-products = render partial: "no_products", locals: { search_term: search_term, producer_id: producer_id, category_id: category_id } diff --git a/app/views/admin/products_v3/_filters.html.haml b/app/views/admin/products_v3/_filters.html.haml index e413f481d3..2a0aa55428 100644 --- a/app/views/admin/products_v3/_filters.html.haml +++ b/app/views/admin/products_v3/_filters.html.haml @@ -1,4 +1,7 @@ -%form{ id: "filters", 'data-reflex-serialize-form': true, 'data-reflex': 'submit->products#filter' } += form_with url: admin_products_path, id: "filters", method: :get, data: { "search-target": "form", 'turbo-frame': "_self" } do + = hidden_field_tag :page, nil, class: "page" + = hidden_field_tag :per_page, nil, class: "per-page" + .query .search-input = text_field_tag :search_term, search_term, placeholder: t('.search_products') @@ -15,4 +18,4 @@ data: { "controller": "tom-select", 'tom-select-placeholder-value': t('.search_for_categories')} .submit .search-button - = button_tag t(".search"), class: "secondary icon-search relaxed" + = button_tag t(".search"), class: "secondary icon-search relaxed", name: nil diff --git a/app/views/admin/products_v3/_product_row.html.haml b/app/views/admin/products_v3/_product_row.html.haml index 3e6f5f6bb7..5e11301a5e 100644 --- a/app/views/admin/products_v3/_product_row.html.haml +++ b/app/views/admin/products_v3/_product_row.html.haml @@ -2,18 +2,27 @@ %a.image-field{ href: admin_product_images_path(product), data: { controller: "modal", reflex: "click->products#edit_image", "current-id": product.id} } = image_tag product.image&.url(:mini) || Spree::Image.default_image_url(:mini), width: 40, height: 40 .button.secondary.mini= t('admin.products_page.image.edit') -%td.field.align-left.header +%td.field.align-left.header.naked_inputs = f.hidden_field :id = f.text_field :name, 'aria-label': t('admin.products_page.columns.name') = error_message_on product, :name -%td.field +%td.field.naked_inputs = f.text_field :sku, 'aria-label': t('admin.products_page.columns.sku') = error_message_on product, :sku +%td.multi-field.naked_inputs{ 'data-controller': 'toggle-control', 'data-toggle-control-match-value': 'items' } + = f.hidden_field :variant_unit + = f.hidden_field :variant_unit_scale + = f.select :variant_unit_with_scale, + options_for_select(WeightsAndMeasures.variant_unit_options, product.variant_unit_with_scale), + {}, + class: "fullwidth no-input", + 'aria-label': t('admin.products_page.columns.unit_scale'), + data: { "controller": "tom-select", "tom-select-options-value": '{ "plugins": [] }', action: "change->toggle-control#displayIfMatch"} + .field + = f.text_field :variant_unit_name, 'aria-label': t('items'), 'data-toggle-control-target': 'control', style: (product.variant_unit == "items" ? "" : "display: none") + = error_message_on product, :variant_unit_name, 'data-toggle-control-target': 'control' %td.align-right - .content - = product.variant_unit.upcase_first - / TODO: properly handle custom unit names - = WeightsAndMeasures::UNITS[product.variant_unit] && "(" + WeightsAndMeasures::UNITS[product.variant_unit][product.variant_unit_scale]["name"] + ")" + -# empty %td.align-right -# empty %td.align-right @@ -21,14 +30,14 @@ %td.align-left .content= product.supplier&.name %td.align-left - .content= product.primary_taxon&.name + -# empty %td.align-left %td.align-left .content= product.inherits_properties ? 'YES' : 'NO' #TODO: consider using https://github.com/RST-J/human_attribute_values, else use I18n.t (also below) %td.align-right = render(VerticalEllipsisMenu::Component.new) do - = link_to t('admin.products_page.actions.edit'), edit_admin_product_path(product) - = link_to t('admin.products_page.actions.clone'), clone_admin_product_path(product) + = link_to t('admin.products_page.actions.edit'), edit_admin_product_path(product), 'data-turbo': false + = link_to t('admin.products_page.actions.clone'), clone_admin_product_path(product), 'data-turbo': false %a{ "data-controller": "modal-link", "data-action": "click->modal-link#setModalDataSetOnConfirm click->modal-link#open", "data-modal-link-target-value": "product-delete-modal", "class": "delete", "data-modal-link-modal-dataset-value": {'data-current-id': product.id}.to_json } diff --git a/app/views/admin/products_v3/_sort.html.haml b/app/views/admin/products_v3/_sort.html.haml index b89d926cef..f53eec4e76 100644 --- a/app/views/admin/products_v3/_sort.html.haml +++ b/app/views/admin/products_v3/_sort.html.haml @@ -1,9 +1,15 @@ #sort %div - = t(".pagination.total_html", total: pagy.count, from: pagy.from, to: pagy.to) + - if pagy.present? + = t(".pagination.total_html", total: pagy.count, from: pagy.from, to: pagy.to) + - if search_term.present? || producer_id.present? || category_id.present? - %a{ href: "#", class: "button disruptive", data: { reflex: "click->products#clear_search" } } - = t(".pagination.clear_search") + %a{ href: url_for(page: 1), class: "button disruptive", 'data-turbo-frame': "_self" } + = t(".pagination.clear_search") + %form.with-dropdown = t(".pagination.per_page.show") - = select_tag :per_page, options_for_select([15, 25, 50, 100].collect{|i| [t('.pagination.per_page.per_page', num: i), i]}, pagy.items), class: "no-input per-page", data: { reflex: "change->products#change_per_page", controller: "tom-select", "tom-select-options-value": '{ "plugins": [] }'} + = select_tag :per_page, + options_for_select([15, 25, 50, 100].collect{|i| [t('.pagination.per_page.per_page', num: i), i]}, pagy&.items), + class: "no-input per-page", + data: { controller: "tom-select search", action: "change->search#changePerPage", "tom-select-options-value": '{ "plugins": [] }'} diff --git a/app/views/admin/products_v3/_table.html.haml b/app/views/admin/products_v3/_table.html.haml index 46de4db20d..78d32be8b2 100644 --- a/app/views/admin/products_v3/_table.html.haml +++ b/app/views/admin/products_v3/_table.html.haml @@ -1,46 +1,58 @@ -= form_with url: bulk_update_admin_products_path, method: :patch, id: "products-form", += form_with url: bulk_update_admin_products_path, method: :post, id: "products-form", builder: BulkFormBuilder, - html: { data: { reflex: 'submit->products#bulk_update', 'reflex-serialize-form': true, - controller: "bulk-form", 'bulk-form-disable-selector-value': "#sort,#filters", - 'bulk-form-error-value': defined?(error_counts), + html: { data: { 'turbo-frame': "_self", + controller: "bulk-form", + 'bulk-form-disable-selector-value': "#sort,#filters", + 'bulk-form-error-value': defined?(@error_counts), } } do |form| = render(partial: "admin/shared/flashes", locals: { flashes: }) if defined? flashes + + = hidden_field_tag :page, @page + = hidden_field_tag :per_page, @per_page + = hidden_field_tag :search_term, @search_term + = hidden_field_tag :producer_id, @producer_id + = hidden_field_tag :category_id, @category_id + %table.products - %col{ width:"4%" } - %col{ width:"15%" } - %col{ width:"5%", style: "max-width:5em" } - %col{ width:"8%" } - %col{ width:"5%", style: "max-width:5em"} - %col{ width:"8%", style: "max-width:5em"} - %col{ width:"10%" }= # producer - %col{ width:"10%" } - %col{ width:"5%" } - %col{ width:"5%", style: "max-width:5em" } - %col{ width:"5%", style: "max-width:5em" } + %colgroup + %col{ width:"56" }= # Img (size + padding) + %col= # (grow to fill) Name + %col{ width:"5%"} + %col{ width:"8%"} + %col{ width:"8%"} + %col{ width:"5%"} + %col{ width:"10%"} + %col{ width:"15%"}= # Producer + %col{ width:"8%"} + %col{ width:"8%"} + %col{ width:"8%"} + %col{ width:"8%"}= # Actions %thead %tr - %td.form-actions-wrapper{ colspan: 11 } + %td.form-actions-wrapper{ colspan: 12 } .form-actions-wrapper2 - %fieldset.form-actions{ class: ("hidden" unless defined?(error_counts)), 'data-bulk-form-target': "actions" } + %fieldset.form-actions{ class: ("hidden" unless defined?(@error_counts)), 'data-bulk-form-target': "actions" } .container .status .modified_summary{ 'data-bulk-form-target': "changedSummary", 'data-translation-key': 'admin.products_v3.table.changed_summary'} - - if defined?(error_counts) + - if defined?(@error_counts) .error_summary - - if error_counts[:saved] > 0 + - if @error_counts[:saved] > 0 -# X products were saved correctly, but Y products could not be saved correctly. Please review errors and try again - = t('.error_summary.saved', count: error_counts[:saved]) + t('.error_summary.invalid', count: error_counts[:invalid]) + = t('.error_summary.saved', count: @error_counts[:saved]) + t('.error_summary.invalid', count: @error_counts[:invalid]) - else -# Y products could not be saved correctly. Please review errors and try again - = t('.error_summary.invalid', count: error_counts[:invalid]) + = t('.error_summary.invalid', count: @error_counts[:invalid]) .form-buttons - = form.submit t('.reset'), type: :reset, class: "medium", 'data-reflex': 'click->products#fetch' + %a.button.reset.medium{ href: admin_products_path(page: @page, per_page: @per_page, search_term: @search_term, producer_id: @producer_id, category_id: @category_id), 'data-turbo': "false" } + = t('.reset') = form.submit t('.save'), class: "medium" %tr %th.align-left= # image %th.align-left.with-input= t('admin.products_page.columns.name') %th.align-left.with-input= t('admin.products_page.columns.sku') - %th.align-right= t('admin.products_page.columns.unit') + %th.align-left.with-input= t('admin.products_page.columns.unit_scale') + %th.align-left.with-input= t('admin.products_page.columns.unit') %th.align-left.with-input= t('admin.products_page.columns.price') %th.align-left.with-input= t('admin.products_page.columns.on_hand') %th.align-left= t('admin.products_page.columns.producer') @@ -50,25 +62,26 @@ %th.align-right= t('admin.products_page.columns.actions') - products.each_with_index do |product, product_index| = form.fields_for("products", product, index: product_index) do |product_form| - %tbody.relaxed{ data: { 'record-id': product_form.object.id, controller: "nested-form", - action: 'nested-form:add->bulk-form#registerElements' } } + %tbody.relaxed{ data: { 'record-id': product_form.object.id, + controller: "nested-form product", + action: 'rails-nested-form:add->bulk-form#registerElements' } } %tr = render partial: 'product_row', locals: { product:, f: product_form } - product.variants.each_with_index do |variant, variant_index| = form.fields_for("products][#{product_index}][variants_attributes][", variant, index: variant_index) do |variant_form| - %tr.condensed + %tr.condensed{ 'data-controller': "variant" } = render partial: 'variant_row', locals: { variant:, f: variant_form } = form.fields_for("products][#{product_index}][variants_attributes][NEW_RECORD", product.variants.build) do |new_variant_form| %template{ 'data-nested-form-target': "template" } - %tr.condensed + %tr.condensed{ 'data-controller': "variant" } = render partial: 'variant_row', locals: { variant: new_variant_form.object, f: new_variant_form } %tr{ 'data-nested-form-target': "target" } %tr.condensed %td - %td{ colspan: 10 } + %td{ colspan: 11 } %button.secondary.condensed.naked.icon-plus{ 'data-action': "nested-form#add", 'aria-label': t('.new_variant') } =t('.new_variant') diff --git a/app/views/admin/products_v3/_variant_row.html.haml b/app/views/admin/products_v3/_variant_row.html.haml index e7d1100d4c..97646ec1ba 100644 --- a/app/views/admin/products_v3/_variant_row.html.haml +++ b/app/views/admin/products_v3/_variant_row.html.haml @@ -1,26 +1,37 @@ %td -# empty -%td.field +%td.field.naked_inputs = f.hidden_field :id = f.text_field :display_name, 'aria-label': t('admin.products_page.columns.name'), placeholder: variant.product.name = error_message_on variant, :display_name -%td.field +%td.field.naked_inputs = f.text_field :sku, 'aria-label': t('admin.products_page.columns.sku') = error_message_on variant, :sku -- if variant.persisted? - %td.align-right - .content= variant.unit_to_display -- else # until unit component is developed, use a basic input just so we can create new records - %td.field - = f.number_field :unit_value, 'aria-label': t('admin.products_page.columns.unit') - = error_message_on variant, :unit_value -%td.field +%td + -# empty +%td.field.popout{'data-controller': "popout", 'data-popout-update-display-value': "false"} + = f.button :unit_to_display, class: "popout__button", 'aria-label': t('admin.products_page.columns.unit'), 'data-popout-target': "button" do + = variant.unit_to_display # Show the generated summary of unit values + %div.popout__container{ style: 'display: none;', 'data-controller': 'toggle-control', 'data-popout-target': "dialog" } + .field + -# Show a composite field for unit_value and unit_description + = f.hidden_field :unit_value + = f.hidden_field :unit_description + -# todo: create a method for value_with_description + = f.text_field :unit_value_with_description, + value: [number_with_precision((variant.unit_value || 1) / (variant.product.variant_unit_scale || 1), precision: nil, strip_insignificant_zeros: true), variant.unit_description].compact_blank.join(" "), + 'aria-label': t('admin.products_page.columns.unit_value'), required: true + .field + = f.label :display_as, t('admin.products_page.columns.display_as') + = f.text_field :display_as, placeholder: VariantUnits::OptionValueNamer.new(variant).name + = error_message_on variant, :unit_value +%td.field.naked_inputs = f.text_field :price, 'aria-label': t('admin.products_page.columns.price'), value: number_to_currency(variant.price, unit: '')&.strip # TODO: add a spec to prove that this formatting is necessary. If so, it should be in a shared form helper for currency inputs = error_message_on variant, :price -%td.field.on-hand__wrapper{'data-controller': "popout"} - %button.on-hand__button{'data-popout-target': "button", 'aria-label': t('admin.products_page.columns.on_hand')} +%td.field.popout{'data-controller': "popout"} + %button.popout__button{'data-popout-target': "button", 'aria-label': t('admin.products_page.columns.on_hand')} = variant.on_demand ? t(:on_demand) : variant.on_hand - %div.on-hand__popout{ style: 'display: none;', 'data-controller': 'toggle-control', 'data-popout-target': "dialog" } + %div.popout__container{ style: 'display: none;', 'data-controller': 'toggle-control', 'data-popout-target': "dialog" } .field = f.number_field :on_hand, min: 0, 'aria-label': t('admin.products_page.columns.on_hand'), 'data-toggle-control-target': 'control', disabled: f.object.on_demand = error_message_on variant, :on_hand @@ -31,9 +42,9 @@ %td.align-left .content= variant.product.supplier&.name # same as product %td.align-left - -# empty + .content= variant.primary_taxon&.name %td.align-left - .content= variant.tax_category&.name || "None" # TODO: convert to dropdown, else translate hardcoded string. + .content= (variant.tax_category_id ? variant.tax_category&.name : t('.none_tax_category')) # TODO: convert to dropdown %td.align-left -# empty %td.align-right diff --git a/app/views/admin/products_v3/index.html.haml b/app/views/admin/products_v3/index.html.haml index 52ca21def8..4200cd0176 100644 --- a/app/views/admin/products_v3/index.html.haml +++ b/app/views/admin/products_v3/index.html.haml @@ -1,5 +1,3 @@ -- content_for :body_class do - products_v3_page - content_for :page_title do = t('.header.title') - content_for :page_actions do @@ -8,15 +6,16 @@ %li#new_product_link = button_link_to t(:new_product), "/admin/products/new", { :icon => 'icon-plus', :id => 'admin_new_product' } +%script= render partial: "admin/shared/global_var_ofn", formats: :js, + locals: { name: :available_units_sorted, value: WeightsAndMeasures.available_units_sorted } + = render partial: 'spree/admin/shared/product_sub_menu' -#products_v3_page{ "data-controller": "products" } - - .spinner-overlay{ "data-controller": "loading", "data-products-target": "loading" } - .spinner-container - .spinner - = t('.loading') - #products-content +#products_v3_page{ "data-controller": "products", 'data-turbo': true } + = render partial: "content", locals: { products: @products, pagy: @pagy, search_term: @search_term, + producer_options: producers, producer_id: @producer_id, + category_options: categories, category_id: @category_id, + flashes: flash } - %w[product variant].each do |object_type| = render partial: 'delete_modal', locals: { object_type: } #modal-component diff --git a/app/views/admin/shared/_global_var_ofn.js.erb b/app/views/admin/shared/_global_var_ofn.js.erb new file mode 100644 index 0000000000..7f897536b0 --- /dev/null +++ b/app/views/admin/shared/_global_var_ofn.js.erb @@ -0,0 +1 @@ +var ofn_<%= name %> = <%= value.to_json.html_safe %>; diff --git a/app/views/admin/shared/_views_dropdown.html.haml b/app/views/admin/shared/_views_dropdown.html.haml index 9fe3df8521..8e1f299fa8 100644 --- a/app/views/admin/shared/_views_dropdown.html.haml +++ b/app/views/admin/shared/_views_dropdown.html.haml @@ -2,6 +2,6 @@ %span{ :class => 'icon-eye-open' }= "  #{t('admin.viewing', current_view_name: '{{ currentView().name }}')}".html_safe %span{ 'ng-class' => "expanded && 'icon-caret-up' || !expanded && 'icon-caret-down'" } %div.menu{ 'ng-show' => "expanded" } - %div.menu_item{ ng: { repeat: "(viewKey, view) in views" }, toggle: { view: true }, 'close-on-click' => true } + %div.menu_item{ "close-on-click": true, "ng-repeat": "(viewKey, view) in views", "toggle-view": true } %span.check %span.name {{ view.name }} diff --git a/app/views/admin/shared/v3/_pagy.html.haml b/app/views/admin/shared/v3/_pagy.html.haml deleted file mode 100644 index 6456fae45a..0000000000 --- a/app/views/admin/shared/v3/_pagy.html.haml +++ /dev/null @@ -1,15 +0,0 @@ -%nav.pagy_nav.pagination{"aria-label" => "pager", :role => "navigation"} - - if pagy.prev - %a.page.prev{ href: "#", id: "pagy-prev", "data-reflex": reflex, "data-perPage": pagy.items, "data-page": pagy.prev || 1, "aria-label": "previous"} - %i.icon-chevron-left - - pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36] - - if item.is_a?(Integer) # page link - %a.page{ href: "#", id:"pagy-#{item}", "data-reflex": reflex, "data-perPage": pagy.items, "data-page": item, "aria-label": "page #{item}"} - = item - - elsif item.is_a?(String) # current page - %span.page.current= item - - elsif item == :gap # page gap - %span.page.gap … - - if pagy.next - %a.page.next{ href: "#", id:"pagy-next", "data-reflex": reflex, "data-perPage": pagy.items, "data-page": pagy.next || pagy.last, "aria-label": "next"} - %i.icon-chevron-right diff --git a/app/views/admin/subscriptions/_address.html.haml b/app/views/admin/subscriptions/_address.html.haml index f7bebb3ad2..4ec9516941 100644 --- a/app/views/admin/subscriptions/_address.html.haml +++ b/app/views/admin/subscriptions/_address.html.haml @@ -4,48 +4,48 @@ %legend{ align: 'center'}= t(:bill_address) .field %label{ for: 'bill_address_firstname'}= t(:first_name) - %input.fullwidth#bill_address_firstname{ name: 'bill_address_firstname', type: 'text', required: true, ng: { model: "subscription.bill_address.firstname" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.bill_address_firstname.$error.required' } }= t(:error_required) - .error{ ng: { repeat: "error in errors['bill_address.firstname']", show: 'subscription_address_form.bill_address_firstname.$pristine' } } {{ error }} + %input.fullwidth#bill_address_firstname{ name: 'bill_address_firstname', type: 'text', required: true, "ng-model": "subscription.bill_address.firstname" } + .error{ "ng-show": 'subscription_form.$submitted && subscription_address_form.bill_address_firstname.$error.required' }= t(:error_required) + .error{ "ng-repeat": "error in errors['bill_address.firstname']", "ng-show": 'subscription_address_form.bill_address_firstname.$pristine' } {{ error }} .field %label{ for: 'bill_address_lastname'}= t(:last_name) - %input.fullwidth#bill_address_lastname{ name: 'bill_address_lastname', type: 'text', required: true, ng: { model: "subscription.bill_address.lastname" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.bill_address_lastname.$error.required' } }= t(:error_required) - .error{ ng: { repeat: "error in errors['bill_address.lastname']", show: 'subscription_address_form.bill_address_lastname.$pristine' } } {{ error }} + %input.fullwidth#bill_address_lastname{ name: 'bill_address_lastname', type: 'text', required: true, "ng-model": "subscription.bill_address.lastname" } + .error{ "ng-show": 'subscription_form.$submitted && subscription_address_form.bill_address_lastname.$error.required' }= t(:error_required) + .error{ "ng-repeat": "error in errors['bill_address.lastname']", "ng-show": 'subscription_address_form.bill_address_lastname.$pristine' } {{ error }} .field %label{ for: 'bill_address_address1'}= t(:address) - %input.fullwidth#bill_address_address1{ name: 'bill_address_address1', type: 'text', required: true, ng: { model: "subscription.bill_address.address1" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.bill_address_address1.$error.required' } }= t(:error_required) - .error{ ng: { repeat: "error in errors['bill_address.address1']", show: 'subscription_address_form.bill_address_address1.$pristine' } } {{ error }} + %input.fullwidth#bill_address_address1{ name: 'bill_address_address1', type: 'text', required: true, "ng-model": "subscription.bill_address.address1" } + .error{ "ng-show": 'subscription_form.$submitted && subscription_address_form.bill_address_address1.$error.required' }= t(:error_required) + .error{ "ng-repeat": "error in errors['bill_address.address1']", "ng-show": 'subscription_address_form.bill_address_address1.$pristine' } {{ error }} .field %label{ for: 'bill_address_city'}= t(:suburb) - %input.fullwidth#bill_address_city{ name: 'bill_address_city', type: 'text', required: true, ng: { model: "subscription.bill_address.city" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.bill_address_city.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.bill_address.city', show: 'subscription_address_form.bill_address_city.$pristine' } } {{ error }} + %input.fullwidth#bill_address_city{ name: 'bill_address_city', type: 'text', required: true, "ng-model": "subscription.bill_address.city" } + .error{ "ng-show": 'subscription_form.$submitted && subscription_address_form.bill_address_city.$error.required' }= t(:error_required) + .error{ "ng-repeat": 'error in errors.bill_address.city', "ng-show": 'subscription_address_form.bill_address_city.$pristine' } {{ error }} .field %label{ for: "bill_address_zipcode"}= t(:postcode) - %input.fullwidth#bill_address_zipcode{ name: 'bill_address_zipcode', type: 'text', required: true, ng: { model: "subscription.bill_address.zipcode" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.bill_address_zipcode.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.bill_address.zipcode', show: 'subscription_address_form.bill_address_zipcode.$pristine' } } {{ error }} + %input.fullwidth#bill_address_zipcode{ name: 'bill_address_zipcode', type: 'text', required: true, "ng-model": "subscription.bill_address.zipcode" } + .error{ "ng-show": 'subscription_form.$submitted && subscription_address_form.bill_address_zipcode.$error.required' }= t(:error_required) + .error{ "ng-repeat": 'error in errors.bill_address.zipcode', "ng-show": 'subscription_address_form.bill_address_zipcode.$pristine' } {{ error }} .field %label{ for: "bill_address_phone"}= t(:phone) - %input.fullwidth#bill_address_phone{ name: 'bill_address_phone', type: 'text', required: true, ng: { model: "subscription.bill_address.phone" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.bill_address_phone.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.bill_address.phone', show: 'subscription_address_form.bill_address_phone.$pristine' } } {{ error }} + %input.fullwidth#bill_address_phone{ name: 'bill_address_phone', type: 'text', required: true, "ng-model": "subscription.bill_address.phone" } + .error{ "ng-show": 'subscription_form.$submitted && subscription_address_form.bill_address_phone.$error.required' }= t(:error_required) + .error{ "ng-repeat": 'error in errors.bill_address.phone', "ng-show": 'subscription_address_form.bill_address_phone.$pristine' } {{ error }} .field %label{ for: "bill_address_country_id"}= t(:country) - %input.ofn-select2.fullwidth#bill_address_country_id{ name: 'bill_address_country_id', type: 'number', data: 'countries', required: true, placeholder: t('admin.choose'), ng: { model: 'subscription.bill_address.country_id' } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.bill_address_country_id.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.bill_address.country', show: 'subscription_address_form.bill_address_country_id.$pristine' } } {{ error }} + %input.ofn-select2.fullwidth#bill_address_country_id{ name: 'bill_address_country_id', type: 'number', data: 'countries', required: true, placeholder: t('admin.choose'), "ng-model": 'subscription.bill_address.country_id' } + .error{ "ng-show": 'subscription_form.$submitted && subscription_address_form.bill_address_country_id.$error.required' }= t(:error_required) + .error{ "ng-repeat": 'error in errors.bill_address.country', "ng-show": 'subscription_address_form.bill_address_country_id.$pristine' } {{ error }} .field %label{ for: "bill_address_state_id"}= t(:state) - %input.ofn-select2.fullwidth#bill_address_state_id{ name: 'bill_address_state_id', type: 'number', data: 'billStates', required: true, placeholder: t('admin.choose'), ng: { model: 'subscription.bill_address.state_id' } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.bill_address_state_id.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.bill_address.state', show: 'subscription_address_form.bill_address_state_id.$pristine' } } {{ error }} + %input.ofn-select2.fullwidth#bill_address_state_id{ name: 'bill_address_state_id', type: 'number', data: 'billStates', required: true, placeholder: t('admin.choose'), "ng-model": 'subscription.bill_address.state_id' } + .error{ "ng-show": 'subscription_form.$submitted && subscription_address_form.bill_address_state_id.$error.required' }= t(:error_required) + .error{ "ng-repeat": 'error in errors.bill_address.state', "ng-show": 'subscription_address_form.bill_address_state_id.$pristine' } {{ error }} .two.columns - %a.button.red.fullwidth{ href: 'javascript:void(0)', ng: { click: 'shipAddressFromBilling()' } } + %a.button.red.fullwidth{ href: 'javascript:void(0)', "ng-click": 'shipAddressFromBilling()' } = t('copy') %i.icon-chevron-right .seven.columns.omega @@ -53,41 +53,41 @@ %legend{ align: 'center'}= t(:ship_address) .field %label{ for: 'ship_address_firstname'}= t(:first_name) - %input.fullwidth#ship_address_firstname{ name: 'ship_address_firstname', type: 'text', required: true, ng: { model: "subscription.ship_address.firstname" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.ship_address_firstname.$error.required' } }= t(:error_required) - .error{ ng: { repeat: "error in errors['ship_address.firstname']", show: 'subscription_address_form.ship_address_firstname.$pristine' } } {{ error }} + %input.fullwidth#ship_address_firstname{ name: 'ship_address_firstname', type: 'text', required: true, "ng-model": "subscription.ship_address.firstname" } + .error{ "ng-show": 'subscription_form.$submitted && subscription_address_form.ship_address_firstname.$error.required' }= t(:error_required) + .error{ "ng-repeat": "error in errors['ship_address.firstname']", "ng-show": 'subscription_address_form.ship_address_firstname.$pristine' } {{ error }} .field %label{ for: 'ship_address_lastname'}= t(:last_name) - %input.fullwidth#ship_address_lastname{ name: 'ship_address_lastname', type: 'text', required: true, ng: { model: "subscription.ship_address.lastname" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.ship_address_lastname.$error.required' } }= t(:error_required) - .error{ ng: { repeat: "error in errors['ship_address.lastname']", show: 'subscription_address_form.ship_address_lastname.$pristine' } } {{ error }} + %input.fullwidth#ship_address_lastname{ name: 'ship_address_lastname', type: 'text', required: true, "ng-model": "subscription.ship_address.lastname" } + .error{ "ng-show": 'subscription_form.$submitted && subscription_address_form.ship_address_lastname.$error.required' }= t(:error_required) + .error{ "ng-repeat": "error in errors['ship_address.lastname']", "ng-show": 'subscription_address_form.ship_address_lastname.$pristine' } {{ error }} .field %label{ for: 'ship_address_address1'}= t(:address) - %input.fullwidth#ship_address_address1{ name: 'ship_address_address1', type: 'text', required: true, ng: { model: "subscription.ship_address.address1" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.ship_address_address1.$error.required' } }= t(:error_required) - .error{ ng: { repeat: "error in errors['ship_address.address1']", show: 'subscription_address_form.ship_address_address1.$pristine' } } {{ error }} + %input.fullwidth#ship_address_address1{ name: 'ship_address_address1', type: 'text', required: true, "ng-model": "subscription.ship_address.address1" } + .error{ "ng-show": 'subscription_form.$submitted && subscription_address_form.ship_address_address1.$error.required' }= t(:error_required) + .error{ "ng-repeat": "error in errors['ship_address.address1']", "ng-show": 'subscription_address_form.ship_address_address1.$pristine' } {{ error }} .field %label{ for: 'ship_address_city'}= t(:suburb) - %input.fullwidth#ship_address_city{ name: 'ship_address_city', type: 'text', required: true, ng: { model: "subscription.ship_address.city" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.ship_address_city.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.ship_address.city', show: 'subscription_address_form.ship_address_city.$pristine' } } {{ error }} + %input.fullwidth#ship_address_city{ name: 'ship_address_city', type: 'text', required: true, "ng-model": "subscription.ship_address.city" } + .error{ "ng-show": 'subscription_form.$submitted && subscription_address_form.ship_address_city.$error.required' }= t(:error_required) + .error{ "ng-repeat": 'error in errors.ship_address.city', "ng-show": 'subscription_address_form.ship_address_city.$pristine' } {{ error }} .field %label{ for: "ship_address_zipcode"}= t(:postcode) - %input.fullwidth#ship_address_zipcode{ name: 'ship_address_zipcode', type: 'text', required: true, ng: { model: "subscription.ship_address.zipcode" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.ship_address_zipcode.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.ship_address.zipcode', show: 'subscription_address_form.ship_address_zipcode.$pristine' } } {{ error }} + %input.fullwidth#ship_address_zipcode{ name: 'ship_address_zipcode', type: 'text', required: true, "ng-model": "subscription.ship_address.zipcode" } + .error{ "ng-show": 'subscription_form.$submitted && subscription_address_form.ship_address_zipcode.$error.required' }= t(:error_required) + .error{ "ng-repeat": 'error in errors.ship_address.zipcode', "ng-show": 'subscription_address_form.ship_address_zipcode.$pristine' } {{ error }} .field %label{ for: "ship_address_phone"}= t(:phone) - %input.fullwidth#ship_address_phone{ name: 'ship_address_phone', type: 'text', required: true, ng: { model: "subscription.ship_address.phone" } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.ship_address_phone.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.ship_address.phone', show: 'subscription_address_form.ship_address_phone.$pristine' } } {{ error }} + %input.fullwidth#ship_address_phone{ name: 'ship_address_phone', type: 'text', required: true, "ng-model": "subscription.ship_address.phone" } + .error{ "ng-show": 'subscription_form.$submitted && subscription_address_form.ship_address_phone.$error.required' }= t(:error_required) + .error{ "ng-repeat": 'error in errors.ship_address.phone', "ng-show": 'subscription_address_form.ship_address_phone.$pristine' } {{ error }} .field %label{ for: "ship_address_country_id"}= t(:country) - %input.ofn-select2.fullwidth#ship_address_country_id{ name: 'ship_address_country_id', type: 'number', data: 'countries', required: true, placeholder: t('admin.choose'), ng: { model: 'subscription.ship_address.country_id' } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.ship_address_country_id.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.ship_address.country', show: 'subscription_address_form.ship_address_country_id.$pristine' } } {{ error }} + %input.ofn-select2.fullwidth#ship_address_country_id{ name: 'ship_address_country_id', type: 'number', data: 'countries', required: true, placeholder: t('admin.choose'), "ng-model": 'subscription.ship_address.country_id' } + .error{ "ng-show": 'subscription_form.$submitted && subscription_address_form.ship_address_country_id.$error.required' }= t(:error_required) + .error{ "ng-repeat": 'error in errors.ship_address.country', "ng-show": 'subscription_address_form.ship_address_country_id.$pristine' } {{ error }} .field %label{ for: "ship_address_state_id"}= t(:state) - %input.ofn-select2.fullwidth#ship_address_state_id{ name: 'ship_address_state_id', type: 'number', data: 'shipStates', required: true, placeholder: t('admin.choose'), ng: { model: 'subscription.ship_address.state_id' } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_address_form.ship_address_state_id.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.ship_address.state', show: 'subscription_address_form.ship_address_state_id.$pristine' } } {{ error }} + %input.ofn-select2.fullwidth#ship_address_state_id{ name: 'ship_address_state_id', type: 'number', data: 'shipStates', required: true, placeholder: t('admin.choose'), "ng-model": 'subscription.ship_address.state_id' } + .error{ "ng-show": 'subscription_form.$submitted && subscription_address_form.ship_address_state_id.$error.required' }= t(:error_required) + .error{ "ng-repeat": 'error in errors.ship_address.state', "ng-show": 'subscription_address_form.ship_address_state_id.$pristine' } {{ error }} diff --git a/app/views/admin/subscriptions/_autocomplete.html.haml b/app/views/admin/subscriptions/_autocomplete.html.haml index 784c77009e..91a699ff2d 100644 --- a/app/views/admin/subscriptions/_autocomplete.html.haml +++ b/app/views/admin/subscriptions/_autocomplete.html.haml @@ -9,12 +9,12 @@ %td.vertical-align-top .field = label_tag :add_variant_id, t('.name_or_sku') - %input#add_variant_id.variant_autocomplete.fullwidth{ type: 'number', ng: { model: 'newItem.variant_id' } } + %input#add_variant_id.variant_autocomplete.fullwidth{ type: 'number', "ng-model": 'newItem.variant_id' } %td.vertical-align-top .field = label_tag :add_quantity, t('.quantity') - %input#add_quantity.fullwidth{ type: 'number', min: 1, ng: { model: 'newItem.quantity' } } + %input#add_quantity.fullwidth{ type: 'number', min: 1, "ng-model": 'newItem.quantity' } %td .actions - %a.icon-plus.button.fullwidth{ href: 'javascript:void(0)', ng: { click: 'addSubscriptionLineItem()' } } + %a.icon-plus.button.fullwidth{ href: 'javascript:void(0)', "ng-click": 'addSubscriptionLineItem()' } = t('.add') diff --git a/app/views/admin/subscriptions/_controls.html.haml b/app/views/admin/subscriptions/_controls.html.haml index ece0c7eecb..ae94e78d54 100644 --- a/app/views/admin/subscriptions/_controls.html.haml +++ b/app/views/admin/subscriptions/_controls.html.haml @@ -1,5 +1,5 @@ -%hr.divider.sixteen.columns.alpha.omega{ ng: { show: 'shop_id && subscriptions.length > 0' } } -.controls.sixteen.columns.alpha.omega{ ng: { show: 'shop_id && subscriptions.length > 0' } } +%hr.divider.sixteen.columns.alpha.omega{ "ng-show": 'shop_id && subscriptions.length > 0' } +.controls.sixteen.columns.alpha.omega{ "ng-show": 'shop_id && subscriptions.length > 0' } .twelve.columns.alpha   .four.columns.omega diff --git a/app/views/admin/subscriptions/_details.html.haml b/app/views/admin/subscriptions/_details.html.haml index 9015d16024..e9df22b24e 100644 --- a/app/views/admin/subscriptions/_details.html.haml +++ b/app/views/admin/subscriptions/_details.html.haml @@ -3,42 +3,42 @@ .row .seven.columns.alpha.field %label{ for: 'customer_id'}= t('admin.customer') - %input.ofn-select2.fullwidth#customer_id{ name: 'customer_id', type: 'number', data: 'customers', text: 'email', required: true, placeholder: t('admin.choose'), ng: { model: 'subscription.customer_id', disabled: 'subscription.id' } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_details_form.customer_id.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.customer', show: 'subscription_details_form.customer_id.$pristine' } } {{ error }} + %input.ofn-select2.fullwidth#customer_id{ name: 'customer_id', type: 'number', data: 'customers', text: 'email', required: true, placeholder: t('admin.choose'), "ng-model": 'subscription.customer_id', "ng-disabled": 'subscription.id' } + .error{ "ng-show": 'subscription_form.$submitted && subscription_details_form.customer_id.$error.required' }= t(:error_required) + .error{ "ng-repeat": 'error in errors.customer', "ng-show": 'subscription_details_form.customer_id.$pristine' } {{ error }} .two.columns   .seven.columns.omega.field %label{ for: 'schedule_id'}= t('admin.schedule') - %input.ofn-select2.fullwidth#schedule_id{ name: 'schedule_id', type: 'number', data: 'schedules', required: true, placeholder: t('admin.choose'), ng: { model: 'subscription.schedule_id', disabled: 'subscription.id' } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_details_form.schedule_id.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.schedule', show: 'subscription_details_form.schedule_id.$pristine'} } {{ error }} + %input.ofn-select2.fullwidth#schedule_id{ name: 'schedule_id', type: 'number', data: 'schedules', required: true, placeholder: t('admin.choose'), "ng-model": 'subscription.schedule_id', "ng-disabled": 'subscription.id' } + .error{ "ng-show": 'subscription_form.$submitted && subscription_details_form.schedule_id.$error.required' }= t(:error_required) + .error{ "ng-repeat": 'error in errors.schedule', "ng-show": 'subscription_details_form.schedule_id.$pristine' } {{ error }} .row .seven.columns.alpha.field %label{ for: 'payment_method_id'} = t('admin.payment_method') %span.with-tip.icon-question-sign{ data: { powertip: "#{t('.allowed_payment_method_types_tip')}" } } - %input.ofn-select2.fullwidth#payment_method_id{ name: 'payment_method_id', type: 'number', data: 'paymentMethods', required: true, placeholder: t('admin.choose'), ng: { model: 'subscription.payment_method_id' } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_details_form.payment_method_id.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.payment_method', show: 'subscription_details_form.payment_method_id.$pristine' } } {{ error }} - .error{ ng: { show: 'cardRequired && customer.$promise && customer.$resolved && !customer.allow_charges' } }= t('.charges_not_allowed') - .error{ ng: { show: 'cardRequired && customer.$promise && customer.$resolved && customer.allow_charges && !customer.default_card_present' } }= t('.no_default_card') - .error{ ng: { repeat: 'error in errors.credit_card', show: 'subscription_details_form.payment_method_id.$pristine' } } {{ error }} + %input.ofn-select2.fullwidth#payment_method_id{ name: 'payment_method_id', type: 'number', data: 'paymentMethods', required: true, placeholder: t('admin.choose'), "ng-model": 'subscription.payment_method_id' } + .error{ "ng-show": 'subscription_form.$submitted && subscription_details_form.payment_method_id.$error.required' }= t(:error_required) + .error{ "ng-repeat": 'error in errors.payment_method', "ng-show": 'subscription_details_form.payment_method_id.$pristine' } {{ error }} + .error{ "ng-show": 'cardRequired && customer.$promise && customer.$resolved && !customer.allow_charges' }= t('.charges_not_allowed') + .error{ "ng-show": 'cardRequired && customer.$promise && customer.$resolved && customer.allow_charges && !customer.default_card_present' }= t('.no_default_card') + .error{ "ng-repeat": 'error in errors.credit_card', "ng-show": 'subscription_details_form.payment_method_id.$pristine' } {{ error }} .two.columns   .seven.columns.omega.field %label{ for: 'shipping_method_id'}= t('admin.shipping_method') - %input.ofn-select2.fullwidth#shipping_method_id{ name: 'shipping_method_id', type: 'number', data: 'shippingMethods', required: true, placeholder: t('admin.choose'), ng: { model: 'subscription.shipping_method_id' } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_details_form.shipping_method_id.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.shipping_method', show: 'subscription_details_form.shipping_method_id.$pristine' } } {{ error }} + %input.ofn-select2.fullwidth#shipping_method_id{ name: 'shipping_method_id', type: 'number', data: 'shippingMethods', required: true, placeholder: t('admin.choose'), "ng-model": 'subscription.shipping_method_id' } + .error{ "ng-show": 'subscription_form.$submitted && subscription_details_form.shipping_method_id.$error.required' }= t(:error_required) + .error{ "ng-repeat": 'error in errors.shipping_method', "ng-show": 'subscription_details_form.shipping_method_id.$pristine' } {{ error }} .row .seven.columns.alpha.field %label{ for: 'begins_at'}= t('admin.begins_at') - %input.fullwidth#begins_at{ name: 'begins_at', type: 'text', placeholder: "#{t('.begins_at_placeholder')}", data: { controller: "flatpickr" }, required: true, ng: { model: 'subscription.begins_at' } } - .error{ ng: { show: 'subscription_form.$submitted && subscription_details_form.begins_at.$error.required' } }= t(:error_required) - .error{ ng: { repeat: 'error in errors.begins_at', show: 'subscription_details_form.begins_at.$pristine' } } {{ error }} + %input.fullwidth#begins_at{ name: 'begins_at', type: 'text', placeholder: "#{t('.begins_at_placeholder')}", data: { controller: "flatpickr" }, required: true, "ng-model": 'subscription.begins_at' } + .error{ "ng-show": 'subscription_form.$submitted && subscription_details_form.begins_at.$error.required' }= t(:error_required) + .error{ "ng-repeat": 'error in errors.begins_at', "ng-show": 'subscription_details_form.begins_at.$pristine' } {{ error }} .two.columns   .seven.columns.omega.field %label{ for: 'ends_at'}= t('admin.ends_at') - %input.fullwidth#ends_at{ name: 'ends_at', type: 'text', placeholder: "#{t('.ends_at_placeholder')}", data: { controller: "flatpickr" }, ng: { model: 'subscription.ends_at' } } - .error{ ng: { repeat: 'error in errors.ends_at', show: 'subscription_details_form.ends_at.$pristine' } } {{ error }} + %input.fullwidth#ends_at{ name: 'ends_at', type: 'text', placeholder: "#{t('.ends_at_placeholder')}", data: { controller: "flatpickr" }, "ng-model": 'subscription.ends_at' } + .error{ "ng-repeat": 'error in errors.ends_at', "ng-show": 'subscription_details_form.ends_at.$pristine' } {{ error }} diff --git a/app/views/admin/subscriptions/_filters.html.haml b/app/views/admin/subscriptions/_filters.html.haml index 870b8ce43a..d931c06d2e 100644 --- a/app/views/admin/subscriptions/_filters.html.haml +++ b/app/views/admin/subscriptions/_filters.html.haml @@ -1,11 +1,11 @@ .row.filters .sixteen.columns.alpha.omega .filter_select.five.columns.alpha - %label{ :for => 'query', ng: {class: '{disabled: !shop_id}'} }=t('admin.quick_search') + %label{ for: 'query', "ng-class": '{disabled: !shop_id}' }=t('admin.quick_search') %br - %input.fullwidth{ :type => "text", :id => 'query', ng: { model: 'query', disabled: '!shop_id'}, :placeholder => "#{t('.query_placeholder')}" } + %input.fullwidth{ type: "text", id: 'query', placeholder: "#{t('.query_placeholder')}", "ng-model": 'query', "ng-disabled": '!shop_id' } .filter_select.four.columns - %label{ :for => 'shop_id', ng: { bind: "shop_id ? '#{t('admin.shop')}' : '#{t('admin.variant_overrides.index.select_a_shop')}'" } } + %label{ for: 'shop_id', "ng-bind": "shop_id ? '#{t('admin.shop')}' : '#{t('admin.variant_overrides.index.select_a_shop')}'" } %br %input.ofn-select2.fullwidth#shop_id{ 'ng-model' => 'shop_id', name: 'shop_id', data: 'shops' } .seven.columns.omega   diff --git a/app/views/admin/subscriptions/_form.html.haml b/app/views/admin/subscriptions/_form.html.haml index cfb4feddaf..84592a3bfb 100644 --- a/app/views/admin/subscriptions/_form.html.haml +++ b/app/views/admin/subscriptions/_form.html.haml @@ -1,27 +1,27 @@ -%form.margin-bottom-50{ name: 'subscription_form', novalidate: true, ng: { submit: 'save()' } } +%form.margin-bottom-50{ name: 'subscription_form', novalidate: true, "ng-submit": 'save()' } %save-bar{ persist: 'true' } - %div{ ng: { hide: 'subscription.id' } } - %a.button{ href: main_app.admin_subscriptions_path, ng: { show: "['details','review'].indexOf(view) >= 0" } }= t(:cancel) - %input{ type: "button", value: t(:back), ng: { click: 'back()', show: '!!backCallbacks[view]'} } - %input.red{ type: "button", value: t(:next), ng: { click: 'next()', show: '!!nextCallbacks[view]' } } - %input.red{ type: "submit", value: t('.create'), ng: { show: "view == 'review'" } } - %div{ ng: { show: 'subscription.id' } } + %div{ "ng-hide": 'subscription.id' } + %a.button{ href: main_app.admin_subscriptions_path, "ng-show": "['details','review'].indexOf(view) >= 0" }= t(:cancel) + %input{ type: "button", value: t(:back), "ng-click": 'back()', "ng-show": '!!backCallbacks[view]' } + %input.red{ type: "button", value: t(:next), "ng-click": 'next()', "ng-show": '!!nextCallbacks[view]' } + %input.red{ type: "submit", value: t('.create'), "ng-show": "view == 'review'" } + %div{ "ng-show": 'subscription.id' } %a.button{ href: main_app.admin_subscriptions_path }= t(:close) - %input.red{ type: "button", value: t(:review), ng: { click: "setView('review')", show: "view != 'review'" } } - %input.red{ type: "submit", value: t(:save_changes), ng: { disabled: 'subscription_form.$pristine' } } + %input.red{ type: "button", value: t(:review), "ng-click": "setView('review')", "ng-show": "view != 'review'" } + %input.red{ type: "submit", value: t(:save_changes), "ng-disabled": 'subscription_form.$pristine' } - .details{ ng: { show: "view == 'details'" } } - %ng-form{ name: 'subscription_details_form', ng: { controller: 'DetailsController' } } + .details{ "ng-show": "view == 'details'" } + %ng-form{ name: 'subscription_details_form', "ng-controller": 'DetailsController' } = render 'details' - .address{ ng: { show: "view == 'address'" } } - %ng-form{ name: 'subscription_address_form', ng: { controller: 'AddressController' } } + .address{ "ng-show": "view == 'address'" } + %ng-form{ name: 'subscription_address_form', "ng-controller": 'AddressController' } = render 'address' - .products{ ng: { show: "view == 'products'" } } - %ng-form{ name: 'subscription_products_form', ng: { controller: 'ProductsController' } } + .products{ "ng-show": "view == 'products'" } + %ng-form{ name: 'subscription_products_form', "ng-controller": 'ProductsController' } = render :partial => "spree/admin/variants/autocomplete", :formats => :js = render 'products' - .review{ ng: { show: "view == 'review'", controller: 'ReviewController' } } + .review{ "ng-show": "view == 'review'", "ng-controller": 'ReviewController' } = render 'review' diff --git a/app/views/admin/subscriptions/_loading_flash.html.haml b/app/views/admin/subscriptions/_loading_flash.html.haml index b4a85be210..2a53e71505 100644 --- a/app/views/admin/subscriptions/_loading_flash.html.haml +++ b/app/views/admin/subscriptions/_loading_flash.html.haml @@ -1,4 +1,4 @@ -%div.sixteen.columns.alpha.omega#loading{ ng: { cloak: true, if: 'shop_id && RequestMonitor.loading' } } +%div.sixteen.columns.alpha.omega#loading{ "ng-cloak": true, "ng-if": 'shop_id && RequestMonitor.loading' } = render partial: "components/admin_spinner" %h1 = t('.loading') diff --git a/app/views/admin/subscriptions/_no_results.html.haml b/app/views/admin/subscriptions/_no_results.html.haml index 23ba6297fb..b7d461519b 100644 --- a/app/views/admin/subscriptions/_no_results.html.haml +++ b/app/views/admin/subscriptions/_no_results.html.haml @@ -1,7 +1,7 @@ -%div.margin-top-30.text-center{ ng: { show: 'shop_id && !RequestMonitor.loading && filteredSubscriptions.length == 0' } } - .no-results{ ng: { show: '!filtersApplied()' } } +%div.margin-top-30.text-center{ "ng-show": 'shop_id && !RequestMonitor.loading && filteredSubscriptions.length == 0' } + .no-results{ "ng-show": '!filtersApplied()' } %h1.margin-bottom-20=t('.no_subscriptions') %span.text-big=t('.why_dont_you_add_one') - .no-results{ ng: { show: 'filtersApplied()' } } + .no-results{ "ng-show": 'filtersApplied()' } %h1=t('.no_matching_subscriptions') diff --git a/app/views/admin/subscriptions/_order_update_issues_dialog.html.haml b/app/views/admin/subscriptions/_order_update_issues_dialog.html.haml index 0bd1e9a9ad..e7e1a0b203 100644 --- a/app/views/admin/subscriptions/_order_update_issues_dialog.html.haml +++ b/app/views/admin/subscriptions/_order_update_issues_dialog.html.haml @@ -2,7 +2,7 @@ #order_update_issues_dialog .message.clearfix.margin-bottom-30 .text=t("admin.subscriptions.order_update_issues_msg") - %div{ ng: { controller: 'OrderUpdateIssuesController' } } + %div{ "ng-controller": 'OrderUpdateIssuesController' } %table %col{ style: 'width: 30%' } %col{ style: 'width: 30%' } @@ -12,14 +12,14 @@ %th= t('admin.order_cycle') %th= t('admin.subscriptions.issue') %tbody - %tr.proxy_order{ :id => "ppo_{{proxyOrder.id}}", ng: { repeat: 'proxyOrder in options.proxyOrders' } } + %tr.proxy_order{ id: "ppo_{{proxyOrder.id}}", "ng-repeat": 'proxyOrder in options.proxyOrders' } %td - %a{ href: '{{::proxyOrder.edit_path}}', target: '_blank', ng: { bind: '::proxyOrder.number' } } + %a{ href: '{{::proxyOrder.edit_path}}', target: '_blank', "ng-bind": '::proxyOrder.number' } %td - %div{ ng: { bind: "::orderCycleName(proxyOrder.order_cycle_id)" } } - %div{ ng: { bind: "::orderCycleCloses(proxyOrder.order_cycle_id)" } } - %td.text-center{ ng: { bind: "proxyOrder.update_issues.join(', ')" } } + %div{ "ng-bind": "::orderCycleName(proxyOrder.order_cycle_id)" } + %div{ "ng-bind": "::orderCycleCloses(proxyOrder.order_cycle_id)" } + %td.text-center{ "ng-bind": "proxyOrder.update_issues.join(', ')" } .action-buttons.text-center - %button{ ng: { click: "close()" } } + %button{ "ng-click": "close()" } OK diff --git a/app/views/admin/subscriptions/_orders_panel.html.haml b/app/views/admin/subscriptions/_orders_panel.html.haml index d99ab196e8..fdf858e2fa 100644 --- a/app/views/admin/subscriptions/_orders_panel.html.haml +++ b/app/views/admin/subscriptions/_orders_panel.html.haml @@ -1,5 +1,5 @@ %script{ type: "text/ng-template", id: "admin/panels/proxy_orders.html" } - %form.margin-top-30{ name: 'subscription_form', ng: { controller: 'OrdersPanelController' } } + %form.margin-top-30{ name: 'subscription_form', "ng-controller": 'OrdersPanelController' } .row.subscription-orders .fourteen.columns.offset-by-one %table @@ -13,14 +13,14 @@ %th= t('total') %th.actions %tbody - %tr.proxy_order{ :id => "po_{{proxyOrder.id}}", ng: { repeat: 'proxyOrder in subscription.not_closed_proxy_orders' } } + %tr.proxy_order{ id: "po_{{proxyOrder.id}}", "ng-repeat": 'proxyOrder in subscription.not_closed_proxy_orders' } %td - %div{ ng: { bind: "::orderCycleName(proxyOrder.order_cycle_id)" } } - %div{ ng: { bind: "::orderCycleCloses(proxyOrder.order_cycle_id)" } } + %div{ "ng-bind": "::orderCycleName(proxyOrder.order_cycle_id)" } + %div{ "ng-bind": "::orderCycleCloses(proxyOrder.order_cycle_id)" } %td.text-center - %span.state{ ng: { class: "proxyOrder.state", bind: 'stateText(proxyOrder.state)' } } - %td.text-center{ ng: { bind: '(proxyOrder.total || subscription.estimatedTotal()) | localizeCurrency' } } + %span.state{ "ng-class": "proxyOrder.state", "ng-bind": 'stateText(proxyOrder.state)' } + %td.text-center{ "ng-bind": '(proxyOrder.total || subscription.estimatedTotal()) | localizeCurrency' } %td.actions %a.edit-order.icon-edit.no-text{ href: '{{::proxyOrder.edit_path}}', target: '_blank', 'ofn-with-tip' => t(:edit_order), confirm_order_edit: true } - %a.cancel-order.icon-remove.no-text{ href: 'javascript:void(0)', ng: { hide: "proxyOrder.state == 'canceled'", click: "cancelOrder(proxyOrder)" }, 'ofn-with-tip' => t(:cancel_order) } - %a.resume-order.icon-resume.no-text{ href: 'javascript:void(0)', ng: { show: "proxyOrder.state == 'canceled'", click: "resumeOrder(proxyOrder)" }, 'ofn-with-tip' => t(:resume_order) } + %a.cancel-order.icon-remove.no-text{ href: 'javascript:void(0)', "ofn-with-tip": t(:cancel_order), "ng-hide": "proxyOrder.state == 'canceled'", "ng-click": "cancelOrder(proxyOrder)" } + %a.resume-order.icon-resume.no-text{ href: 'javascript:void(0)', "ofn-with-tip": t(:resume_order), "ng-show": "proxyOrder.state == 'canceled'", "ng-click": "resumeOrder(proxyOrder)" } diff --git a/app/views/admin/subscriptions/_products.html.haml b/app/views/admin/subscriptions/_products.html.haml index 88d206e69d..44e62b7c9c 100644 --- a/app/views/admin/subscriptions/_products.html.haml +++ b/app/views/admin/subscriptions/_products.html.haml @@ -1,3 +1,3 @@ -%div{ ng: { controller: 'SubscriptionLineItemsController' } } +%div{ "ng-controller": 'SubscriptionLineItemsController' } = render 'autocomplete' = render 'subscription_line_items' diff --git a/app/views/admin/subscriptions/_products_panel.html.haml b/app/views/admin/subscriptions/_products_panel.html.haml index 330e2fe0c1..4781a3a007 100644 --- a/app/views/admin/subscriptions/_products_panel.html.haml +++ b/app/views/admin/subscriptions/_products_panel.html.haml @@ -1,15 +1,15 @@ = render :partial => "spree/admin/variants/autocomplete", :formats => :js %script{ type: "text/ng-template", id: "admin/panels/subscription_products.html" } - %form{ name: 'subscription_form', ng: { controller: 'ProductsPanelController' } } + %form{ name: 'subscription_form', "ng-controller": 'ProductsPanelController' } %div{ style: 'width: 90%; margin: auto;' } = render 'products' - %a.button.update.fullwidth{ ng: { class: "{disabled: saved() && !saving, saving: saving}", click: "save()" } } - %span{ ng: {hide: "saved() || saving" } } + %a.button.update.fullwidth{ "ng-class": "{disabled: saved() && !saving, saving: saving}", "ng-click": "save()" } + %span{ "ng-hide": "saved() || saving" } = t('.save') %i.icon-save - %span{ ng: {show: "saved() && !saving" } } + %span{ "ng-show": "saved() && !saving" } = t('.saved') %i.icon-ok-sign - %span{ ng: {show: "saving" } } + %span{ "ng-show": "saving" } = t('.saving') %i.icon-refresh diff --git a/app/views/admin/subscriptions/_review.html.haml b/app/views/admin/subscriptions/_review.html.haml index 9e5fcb7d55..3bf765df77 100644 --- a/app/views/admin/subscriptions/_review.html.haml +++ b/app/views/admin/subscriptions/_review.html.haml @@ -6,7 +6,7 @@ .five.columns.alpha %h3= t('.details') .eleven.columns.omega - %input#edit-details{ type: "button", value: t(:edit), ng: { click: "setView('details')" } } + %input#edit-details{ type: "button", value: t(:edit), "ng-click": "setView('details')" } .row .five.columns.alpha %strong= t('admin.customer') @@ -35,7 +35,7 @@ .five.columns.alpha %h3= t('.address') .eleven.columns.omega - %input#edit-address{ type: "button", value: t(:edit), ng: { click: "setView('address')" } } + %input#edit-address{ type: "button", value: t(:edit), "ng-click": "setView('address')" } .row .five.columns.alpha %strong= t('admin.bill_address') @@ -53,7 +53,7 @@ .five.columns.alpha %h3= t('.products') .eleven.columns.omega - %input#edit-products{ type: "button", value: t(:edit), ng: { click: "setView('products')" } } + %input#edit-products{ type: "button", value: t(:edit), "ng-click": "setView('products')" } .row %table#subscription-line-items.admin-subscription-review-subscription-line-items %colgroup @@ -69,10 +69,10 @@ %th.total %span= t(:total) %tbody - %tr.item{ id: "sli_{{$index}}", ng: { repeat: "item in subscription.subscription_line_items | filter:{ _destroy: '!true' }", class: { even: 'even', odd: 'odd' } } } + %tr.item{ id: "sli_{{$index}}", "ng-repeat": "item in subscription.subscription_line_items | filter:{ _destroy: '!true' }", "ng-class-even": 'even', "ng-class-odd": 'odd' } %td .description {{ item.description }} - .not-in-open-and-upcoming-order-cycles-warning{ ng: { if: '!item.in_open_and_upcoming_order_cycles' } } + .not-in-open-and-upcoming-order-cycles-warning{ "ng-if": '!item.in_open_and_upcoming_order_cycles' } = t(".no_open_or_upcoming_order_cycle") %td.price.align-center {{ item.price_estimate | localizeCurrency }} %td.quantity {{ item.quantity }} diff --git a/app/views/admin/subscriptions/_subscription_line_items.html.haml b/app/views/admin/subscriptions/_subscription_line_items.html.haml index 561cc76996..78afd26803 100644 --- a/app/views/admin/subscriptions/_subscription_line_items.html.haml +++ b/app/views/admin/subscriptions/_subscription_line_items.html.haml @@ -14,17 +14,17 @@ %span= t(:total) %th.orders-actions.actions %tbody - %tr.item{ id: "sli_{{$index}}", ng: { repeat: "item in subscription.subscription_line_items | filter:{ _destroy: '!true' }", class: { even: 'even', odd: 'odd' } } } + %tr.item{ id: "sli_{{$index}}", "ng-repeat": "item in subscription.subscription_line_items | filter:{ _destroy: '!true' }", "ng-class-even": 'even', "ng-class-odd": 'odd' } %td .description {{ item.description }} - .not-in-open-and-upcoming-order-cycles-warning{ ng: { if: '!item.in_open_and_upcoming_order_cycles' } } + .not-in-open-and-upcoming-order-cycles-warning{ "ng-if": '!item.in_open_and_upcoming_order_cycles' } = t(".not_in_open_and_upcoming_order_cycles_warning") %td.price.align-center {{ item.price_estimate | localizeCurrency }} %td.quantity - %input{ name: 'quantity', type: 'number', min: 0, ng: { model: 'item.quantity' } } + %input{ name: 'quantity', type: 'number', min: 0, "ng-model": 'item.quantity' } %td.total.align-center {{ (item.price_estimate * item.quantity) | localizeCurrency }} %td.actions - %a.delete-item.icon-trash.no-text{ ng: { click: 'removeSubscriptionLineItem(item)'}, :href => "javascript:void(0)" } + %a.delete-item.icon-trash.no-text{ href: "javascript:void(0)", "ng-click": 'removeSubscriptionLineItem(item)' } %tbody#subtotal.no-border-top %tr#subtotal-row %td{:colspan => "3"} @@ -34,7 +34,7 @@ %td.total.align-center %span#order_subtotal {{ subscription.estimatedSubtotal() | localizeCurrency }} %td.actions - %tbody#fees.no-border-top{ ng: { show: "subscription.estimatedFees() > 0" } } + %tbody#fees.no-border-top{ "ng-show": "subscription.estimatedFees() > 0" } %tr#fees-row %td{:colspan => "3"} %b diff --git a/app/views/admin/subscriptions/_table.html.haml b/app/views/admin/subscriptions/_table.html.haml index 4f45080694..d009af9065 100644 --- a/app/views/admin/subscriptions/_table.html.haml +++ b/app/views/admin/subscriptions/_table.html.haml @@ -1,7 +1,7 @@ = render 'products_panel' = render 'orders_panel' -%table.index#subscriptions{ ng: { cloak: true, show: 'shop_id && !RequestMonitor.loading && filteredSubscriptions.length > 0' } } +%table.index#subscriptions{ "ng-cloak": true, "ng-show": 'shop_id && !RequestMonitor.loading && filteredSubscriptions.length > 0' } %col.customer{ width: "20%", 'ng-show' => 'columns.customer.visible' } %col.schedule{ width: "20%", 'ng-show' => 'columns.schedule.visible' } %col.items{ width: "10%", 'ng-show' => 'columns.items.visible' } @@ -16,47 +16,47 @@ %tr -# %th.bulk -# %input{ :type => "checkbox", :name => 'toggle_bulk', 'ng-click' => 'toggleAllCheckboxes()', 'ng-checked' => "allBoxesChecked()" } - %th.customer{ ng: { show: 'columns.customer.visible' } } + %th.customer{ "ng-show": 'columns.customer.visible' } = t('admin.customer') - %th.schedule{ ng: { show: 'columns.schedule.visible', } } + %th.schedule{ "ng-show": 'columns.schedule.visible' } = t('admin.schedule') - %th.items{ ng: { show: 'columns.items.visible', } } + %th.items{ "ng-show": 'columns.items.visible' } = t('admin.items') - %th.orders{ ng: { show: 'columns.orders.visible', } } + %th.orders{ "ng-show": 'columns.orders.visible' } = t('orders') - %th.status{ ng: { show: 'columns.state.visible', } } + %th.status{ "ng-show": 'columns.state.visible' } = t('admin.status_state') - %th.begins_on{ ng: { show: 'columns.begins_on.visible', } } + %th.begins_on{ "ng-show": 'columns.begins_on.visible' } = t('admin.begins_on') - %th.ends_on{ ng: { show: 'columns.ends_on.visible', } } + %th.ends_on{ "ng-show": 'columns.ends_on.visible' } = t('admin.ends_on') - %th.payment_method{ ng: { show: 'columns.payment_method.visible', } } + %th.payment_method{ "ng-show": 'columns.payment_method.visible' } = t('admin.payment_method') - %th.shipping_method{ ng: { show: 'columns.shipping_method.visible', } } + %th.shipping_method{ "ng-show": 'columns.shipping_method.visible' } = t('admin.shipping_method') %th.actions   - %tbody.panel-ctrl{ object: 'subscription', ng: { repeat: "subscription in subscriptions | filter:query as filteredSubscriptions track by subscription.id" } } - %tr.subscription{ :id => "so_{{subscription.id}}", ng: { class: { even: "'even'", odd: "'odd'" } } } - %td.customer{ ng: { show: 'columns.customer.visible'}} + %tbody.panel-ctrl{ object: 'subscription', "ng-repeat": "subscription in subscriptions | filter:query as filteredSubscriptions track by subscription.id" } + %tr.subscription{ id: "so_{{subscription.id}}", "ng-class-even": "'even'", "ng-class-odd": "'odd'" } + %td.customer{ "ng-show": 'columns.customer.visible' } %span{ "ng-bind": '::subscription.customer_email' } %br %span{ "ng-bind": '::subscription.customer_full_name' } - %td.schedule{ ng: { show: 'columns.schedule.visible', bind: '::subscription.schedule_name' } } - %td.items.panel-toggle{ name: 'products', ng: { show: 'columns.items.visible' } } - %h5{ ng: { bind: 'itemCount(subscription)' } } - %td.orders.panel-toggle{ name: 'orders', ng: { show: 'columns.orders.visible' } } - %h5{ ng: { bind: 'subscription.not_closed_proxy_orders.length' } } - %td.status{ ng: { show: 'columns.state.visible' } } - %span.state{ ng: { class: "subscription.state", bind: "'spree.subscription_state.' + subscription.state | t" } } - %td.begins_on{ ng: { show: 'columns.begins_on.visible', bind: '::subscription.begins_at' } } - %td.ends_on{ ng: { show: 'columns.ends_on.visible', bind: '::subscription.ends_at' } } - %td.payment_method{ ng: { show: 'columns.payment_method.visible', bind: '::paymentMethodsByID[subscription.payment_method_id].name' } } - %td.shipping_method{ ng: { show: 'columns.shipping_method.visible', bind: '::shippingMethodsByID[subscription.shipping_method_id].name' } } + %td.schedule{ "ng-show": 'columns.schedule.visible', "ng-bind": '::subscription.schedule_name' } + %td.items.panel-toggle{ name: 'products', "ng-show": 'columns.items.visible' } + %h5{ "ng-bind": 'itemCount(subscription)' } + %td.orders.panel-toggle{ name: 'orders', "ng-show": 'columns.orders.visible' } + %h5{ "ng-bind": 'subscription.not_closed_proxy_orders.length' } + %td.status{ "ng-show": 'columns.state.visible' } + %span.state{ "ng-class": "subscription.state", "ng-bind": "'spree.subscription_state.' + subscription.state | t" } + %td.begins_on{ "ng-show": 'columns.begins_on.visible', "ng-bind": '::subscription.begins_at' } + %td.ends_on{ "ng-show": 'columns.ends_on.visible', "ng-bind": '::subscription.ends_at' } + %td.payment_method{ "ng-show": 'columns.payment_method.visible', "ng-bind": '::paymentMethodsByID[subscription.payment_method_id].name' } + %td.shipping_method{ "ng-show": 'columns.shipping_method.visible', "ng-bind": '::shippingMethodsByID[subscription.shipping_method_id].name' } %td.actions - %a.edit-subscription.icon-edit.no-text{ ng: { href: '{{subscription.edit_path}}'}, 'ofn-with-tip' => t('.edit_subscription') } - %a.pause-subscription.icon-pause.no-text{ ng: { click: 'subscription.pause()', hide: '!!subscription.paused_at' }, 'ofn-with-tip' => t('.pause_subscription') , href: 'javascript:void(0)' } - %a.unpause-subscription.icon-play.no-text{ ng: { click: 'subscription.unpause()', show: '!!subscription.paused_at' }, 'ofn-with-tip' => t('.unpause_subscription') , href: 'javascript:void(0)' } - %a.cancel-subscription.icon-remove.no-text{ ng: { click: 'subscription.cancel()', hide: '!!subscription.canceled_at'}, 'ofn-with-tip' => t('.cancel_subscription') , href: 'javascript:void(0)' } + %a.edit-subscription.icon-edit.no-text{ "ofn-with-tip": t('.edit_subscription'), "ng-href": '{{subscription.edit_path}}' } + %a.pause-subscription.icon-pause.no-text{ "ofn-with-tip": t('.pause_subscription'), href: 'javascript:void(0)', "ng-click": 'subscription.pause()', "ng-hide": '!!subscription.paused_at' } + %a.unpause-subscription.icon-play.no-text{ "ofn-with-tip": t('.unpause_subscription'), href: 'javascript:void(0)', "ng-click": 'subscription.unpause()', "ng-show": '!!subscription.paused_at' } + %a.cancel-subscription.icon-remove.no-text{ "ofn-with-tip": t('.cancel_subscription'), href: 'javascript:void(0)', "ng-click": 'subscription.cancel()', "ng-hide": '!!subscription.canceled_at' } %tr.panel-row{ object: "subscription", panels: "{products: 'subscription_products', orders: 'proxy_orders'}" } diff --git a/app/views/admin/subscriptions/_wizard_progress.html.haml b/app/views/admin/subscriptions/_wizard_progress.html.haml index d8f381247b..cc58445dd8 100644 --- a/app/views/admin/subscriptions/_wizard_progress.html.haml +++ b/app/views/admin/subscriptions/_wizard_progress.html.haml @@ -1,3 +1,3 @@ %ul.wizard-progress - %li{ ng: { repeat: "step in ['details','address','products','review']", class: '{current: view==step}' } } + %li{ "ng-repeat": "step in ['details','address','products','review']", "ng-class": '{current: view==step}' } {{ stepTitleFor(step) }} diff --git a/app/views/admin/subscriptions/edit.html.haml b/app/views/admin/subscriptions/edit.html.haml index 51b4c40045..361c42556d 100644 --- a/app/views/admin/subscriptions/edit.html.haml +++ b/app/views/admin/subscriptions/edit.html.haml @@ -4,7 +4,7 @@ -# - content_for :page_actions do -# %li= button_link_to "Back to subscriptions list", main_app.admin_subscriptions_path, icon: 'icon-arrow-left' -%div{ ng: { app: 'admin.subscriptions', controller: 'SubscriptionController', cloak: true } } +%div{ "ng-app": 'admin.subscriptions', "ng-controller": 'SubscriptionController', "ng-cloak": true } = render 'data' = render 'order_update_issues_dialog' = render 'form' diff --git a/app/views/admin/subscriptions/index.html.haml b/app/views/admin/subscriptions/index.html.haml index 3e0ebebd90..7b48edb4b6 100644 --- a/app/views/admin/subscriptions/index.html.haml +++ b/app/views/admin/subscriptions/index.html.haml @@ -15,7 +15,7 @@ = render 'data' = render 'order_update_issues_dialog' -%div.margin-bottom-50{ ng: { controller: 'SubscriptionsController' } } +%div.margin-bottom-50{ "ng-controller": 'SubscriptionsController' } %save-bar{ dirty: "false", persist: "false" } = render 'filters' = render 'controls' diff --git a/app/views/admin/subscriptions/new.html.haml b/app/views/admin/subscriptions/new.html.haml index 6ac3749982..aab6173ec6 100644 --- a/app/views/admin/subscriptions/new.html.haml +++ b/app/views/admin/subscriptions/new.html.haml @@ -6,7 +6,7 @@ -# - content_for :page_actions do -# %li= button_link_to "Back to subscriptions list", main_app.admin_subscriptions_path, icon: 'icon-arrow-left' -%div{ ng: { app: 'admin.subscriptions', controller: 'SubscriptionController', cloak: true } } +%div{ "ng-app": 'admin.subscriptions', "ng-controller": 'SubscriptionController', "ng-cloak": true } = render 'data' = render 'wizard_progress' = render 'order_update_issues_dialog' diff --git a/app/views/admin/variant_overrides/_controls.html.haml b/app/views/admin/variant_overrides/_controls.html.haml index 1f407a4b35..c401717644 100644 --- a/app/views/admin/variant_overrides/_controls.html.haml +++ b/app/views/admin/variant_overrides/_controls.html.haml @@ -1,15 +1,15 @@ -%hr.divider.sixteen.columns.alpha.omega{ ng: { show: 'hub_id && products.length > 0' } } -.controls.sixteen.columns.alpha.omega{ ng: { show: 'hub_id && products.length > 0' } } +%hr.divider.sixteen.columns.alpha.omega{ "ng-show": 'hub_id && products.length > 0' } +.controls.sixteen.columns.alpha.omega{ "ng-show": 'hub_id && products.length > 0' } .eight.columns.alpha = render 'admin/shared/bulk_actions_dropdown' = render 'admin/shared/views_dropdown' - %span.text-big.with-tip.icon-question-sign{ ng: { show: 'views.inventory.visible' } , data: { powertip: "#{t('admin.variant_overrides.index.inventory_powertip')}" } } - %span.text-big.with-tip.icon-question-sign{ ng: { show: 'views.hidden.visible' } , data: { powertip: "#{t('admin.variant_overrides.index.hidden_powertip')}" } } - %span.text-big.with-tip.icon-question-sign{ ng: { show: 'views.new.visible' } , data: { powertip: "#{t('admin.variant_overrides.index.new_powertip')}" } } + %span.text-big.with-tip.icon-question-sign{ data: { powertip: "#{t('admin.variant_overrides.index.inventory_powertip')}" }, "ng-show": 'views.inventory.visible' } + %span.text-big.with-tip.icon-question-sign{ data: { powertip: "#{t('admin.variant_overrides.index.hidden_powertip')}" }, "ng-show": 'views.hidden.visible' } + %span.text-big.with-tip.icon-question-sign{ data: { powertip: "#{t('admin.variant_overrides.index.new_powertip')}" }, "ng-show": 'views.new.visible' } .four.columns   - .four.columns.omega{ ng: { show: 'views.new.visible' } } - %button.fullwidth{ type: 'button', ng: { click: "selectView('inventory')" } } + .four.columns.omega{ "ng-show": 'views.new.visible' } + %button.fullwidth{ type: 'button', "ng-click": "selectView('inventory')" } %i.icon-chevron-left = t('.back_to_my_inventory') - .four.columns.omega{ng: { show: 'views.inventory.visible' } } + .four.columns.omega{ "ng-show": 'views.inventory.visible' } %columns-dropdown{ action: "#{controller_name}_#{action_name}" } diff --git a/app/views/admin/variant_overrides/_filters.html.haml b/app/views/admin/variant_overrides/_filters.html.haml index bafb413ae5..3bb7d538b5 100644 --- a/app/views/admin/variant_overrides/_filters.html.haml +++ b/app/views/admin/variant_overrides/_filters.html.haml @@ -1,20 +1,20 @@ .filters.sixteen.columns.alpha.omega .filter.four.columns.alpha - %label{for: 'query', ng: {class: '{disabled: !hub_id}'} }=t('admin.quick_search') + %label{ for: 'query', "ng-class": '{disabled: !hub_id}' }=t('admin.quick_search') %br - %input.fullwidth{type: "text", id: 'query', ng: {model: 'query', disabled: '!hub_id'} } + %input.fullwidth{ type: "text", id: 'query', "ng-model": 'query', "ng-disabled": '!hub_id' } .filter_select.three.columns - %label{for: 'hub_id', ng: {bind: "hub_id ? '#{t('admin.shop')}' : '#{t('admin.variant_overrides.index.select_a_shop')}'" } } + %label{ for: 'hub_id', "ng-bind": "hub_id ? '#{t('admin.shop')}' : '#{t('admin.variant_overrides.index.select_a_shop')}'" } %br - %select.select2.fullwidth#hub_id{name: 'hub_id', ng: {model: 'hub_id', options: 'hub.id as hub.name for (id, hub) in hubs' } } + %select.select2.fullwidth#hub_id{ name: 'hub_id', "ng-model": 'hub_id', "ng-options": 'hub.id as hub.name for (id, hub) in hubs' } .filter_select.three.columns - %label{for: 'producer_filter', ng: {class: '{disabled: !hub_id}'} }=t('admin.producer') + %label{ for: 'producer_filter', "ng-class": '{disabled: !hub_id}' }=t('admin.producer') %br - %input.ofn-select2.fullwidth{id: 'producer_filter', type: 'number', data: 'producers', blank: "{id: 0, name: '#{t(:all)}'}", ng: {model: 'producerFilter', disabled: '!hub_id' } } + %input.ofn-select2.fullwidth{ id: 'producer_filter', type: 'number', data: 'producers', blank: "{id: 0, name: '#{t(:all)}'}", "ng-model": 'producerFilter', "ng-disabled": '!hub_id' } .filter_select.three.columns - %label{ :for => 'import_date_filter', ng: {class: '{disabled: !hub_id}'} } #{t('admin.variant_overrides.index.import_date')} + %label{ for: 'import_date_filter', "ng-class": '{disabled: !hub_id}' } #{t('admin.variant_overrides.index.import_date')} %br - %select.fullwidth{id: 'import_date_filter', 'ofn-select2-min-search' => 5, ng: {model: 'importDateFilter', options: 'date.id as date.name for date in import_dates', disabled: '!hub_id', init: "import_dates = #{@import_dates}"} } + %select.fullwidth{ id: 'import_date_filter', "ofn-select2-min-search": 5, "ng-model": 'importDateFilter', "ng-options": 'date.id as date.name for date in import_dates', "ng-disabled": '!hub_id', "ng-init": "import_dates = #{@import_dates}" } %options{value: '0', selected: 'selected'} #{t(:all)} -# .filter_select{ :class => "three columns" } -# %label{ :for => 'distributor_filter' }Hub @@ -27,4 +27,4 @@ .filter_clear.three.columns.omega %label{ :for => 'clear_all_filters' } %br - %input.red.fullwidth{ :type => 'button', :id => 'clear_all_filters', :value => "#{t('admin.clear_all')}", ng: { click: "resetSelectFilters()", disabled: '!hub_id'} } + %input.red.fullwidth{ type: 'button', id: 'clear_all_filters', value: "#{t('admin.clear_all')}", "ng-click": "resetSelectFilters()", "ng-disabled": '!hub_id' } diff --git a/app/views/admin/variant_overrides/_hidden_products.html.haml b/app/views/admin/variant_overrides/_hidden_products.html.haml index 38f144b479..9871cdcb72 100644 --- a/app/views/admin/variant_overrides/_hidden_products.html.haml +++ b/app/views/admin/variant_overrides/_hidden_products.html.haml @@ -1,5 +1,5 @@ -%div{ ng: { show: 'views.hidden.visible' } } - %table#hidden-products{ ng: { show: 'filteredProducts.length > 0' } } +%div{ "ng-show": 'views.hidden.visible' } + %table#hidden-products{ "ng-show": 'filteredProducts.length > 0' } %col.producer{ width: "20%" } %col.product{ width: "20%" } %col.variant{ width: "20%" } @@ -10,13 +10,13 @@ %th.product=t('admin.product') %th.variant=t('admin.variant') %th.add=t('admin.variant_overrides.index.add') - %tbody{ ng: { repeat: 'product in filteredProducts | limitTo:productLimit' } } - %tr{ id: "v_{{variant.id}}", ng: { repeat: 'variant in product.variants | inventoryVariants:hub_id:views' } } - %td.producer{ ng: { bind: '::producersByID[product.producer_id].name'} } - %td.product{ ng: { bind: '::product.name'} } + %tbody{ "ng-repeat": 'product in filteredProducts | limitTo:productLimit' } + %tr{ id: "v_{{variant.id}}", "ng-repeat": 'variant in product.variants | inventoryVariants:hub_id:views' } + %td.producer{ "ng-bind": '::producersByID[product.producer_id].name' } + %td.product{ "ng-bind": '::product.name' } %td.variant - %span{ ng: { bind: '::variant.display_name || ""'} } - .variant-override-unit{ ng: { bind: '::variant.unit_to_display'} } + %span{ "ng-bind": '::variant.display_name || ""' } + .variant-override-unit{ "ng-bind": '::variant.unit_to_display' } %td.add - %button.fullwidth.icon-plus{ ng: { click: "setVisibility(hub_id,variant.id,true)" } } + %button.fullwidth.icon-plus{ "ng-click": "setVisibility(hub_id,variant.id,true)" } = t('admin.variant_overrides.index.add') diff --git a/app/views/admin/variant_overrides/_loading_flash.html.haml b/app/views/admin/variant_overrides/_loading_flash.html.haml index 0095c543e8..5765159f61 100644 --- a/app/views/admin/variant_overrides/_loading_flash.html.haml +++ b/app/views/admin/variant_overrides/_loading_flash.html.haml @@ -1,4 +1,4 @@ -%div.sixteen.columns.alpha.omega#loading{ ng: { cloak: true, if: 'hub_id && products.length == 0 && RequestMonitor.loading' } } +%div.sixteen.columns.alpha.omega#loading{ "ng-cloak": true, "ng-if": 'hub_id && products.length == 0 && RequestMonitor.loading' } = render partial: "components/admin_spinner" %h1 = t('.loading_inventory') diff --git a/app/views/admin/variant_overrides/_new_products.html.haml b/app/views/admin/variant_overrides/_new_products.html.haml index 731535d06d..fb727c84e1 100644 --- a/app/views/admin/variant_overrides/_new_products.html.haml +++ b/app/views/admin/variant_overrides/_new_products.html.haml @@ -1,4 +1,4 @@ -%table#new-products{ ng: { show: 'views.new.visible && filteredProducts.length > 0' } } +%table#new-products{ "ng-show": 'views.new.visible && filteredProducts.length > 0' } %col.producer{ width: "20%" } %col.product{ width: "20%" } %col.variant{ width: "20%" } @@ -11,16 +11,16 @@ %th.variant=t('admin.variant') %th.add=t('admin.variant_overrides.index.add') %th.hide=t('admin.variant_overrides.index.hide') - %tbody{ ng: { repeat: 'product in filteredProducts | limitTo:productLimit' } } - %tr{ id: "v_{{variant.id}}", ng: { repeat: 'variant in product.variants | inventoryVariants:hub_id:views' } } - %td.producer{ ng: { bind: { html: '::producersByID[product.producer_id].name'} } } - %td.product{ ng: { bind: '::product.name'} } + %tbody{ "ng-repeat": 'product in filteredProducts | limitTo:productLimit' } + %tr{ id: "v_{{variant.id}}", "ng-repeat": 'variant in product.variants | inventoryVariants:hub_id:views' } + %td.producer{ "ng-bind-html": '::producersByID[product.producer_id].name' } + %td.product{ "ng-bind": '::product.name' } %td.variant - %span{ ng: { bind: '::variant.display_name || ""'} } - .variant-override-unit{ ng: { bind: '::variant.unit_to_display'} } + %span{ "ng-bind": '::variant.display_name || ""' } + .variant-override-unit{ "ng-bind": '::variant.unit_to_display' } %td.add - %button.fullwidth.icon-plus{ ng: { click: "setVisibility(hub_id,variant.id,true)" } } + %button.fullwidth.icon-plus{ "ng-click": "setVisibility(hub_id,variant.id,true)" } = t('admin.variant_overrides.index.add') %td.hide - %button.fullwidth.icon-remove{ ng: { click: "setVisibility(hub_id,variant.id,false)" } } + %button.fullwidth.icon-remove{ "ng-click": "setVisibility(hub_id,variant.id,false)" } = t('admin.variant_overrides.index.hide') diff --git a/app/views/admin/variant_overrides/_new_products_alert.html.haml b/app/views/admin/variant_overrides/_new_products_alert.html.haml index 385616d817..2f352e92ca 100644 --- a/app/views/admin/variant_overrides/_new_products_alert.html.haml +++ b/app/views/admin/variant_overrides/_new_products_alert.html.haml @@ -1,5 +1,3 @@ -%div{ ng: { show: '(newProductCount = (products | hubPermissions:hubPermissions:hub_id | newInventoryProducts:hub_id).length) > 0 && !views.new.visible && !alertDismissed' } } +%div{ "ng-show": '(newProductCount = (products | hubPermissions:hubPermissions:hub_id | newInventoryProducts:hub_id).length) > 0 && !views.new.visible && !alertDismissed' } %hr.divider.sixteen.columns.alpha.omega - %alert-row{ message: "#{t('admin.variant_overrides.index.new_products_alert_message', new_product_count: '{{ newProductCount }}')}", - dismissed: "alertDismissed", - button: { text: "#{t('admin.variant_overrides.index.review_now')}", action: "selectView('new')" } } + %alert-row{ message: "#{t('admin.variant_overrides.index.new_products_alert_message', new_product_count: '{{ newProductCount }}')}", dismissed: "alertDismissed", "button-text": "#{t('admin.variant_overrides.index.review_now')}", "button-action": "selectView('new')" } diff --git a/app/views/admin/variant_overrides/_no_results.html.haml b/app/views/admin/variant_overrides/_no_results.html.haml index 7ec4e68f0e..274424b32a 100644 --- a/app/views/admin/variant_overrides/_no_results.html.haml +++ b/app/views/admin/variant_overrides/_no_results.html.haml @@ -1,7 +1,7 @@ -%div.text-big.no-results{ ng: { show: 'hub_id && products.length > 0 && filteredProducts.length == 0' } } - %span{ ng: { show: 'views.inventory.visible && !filtersApplied()' } }=t('admin.variant_overrides.index.currently_empty') - %span{ ng: { show: 'views.inventory.visible && filtersApplied()' } }=t('admin.variant_overrides.index.no_matching_products') - %span{ ng: { show: 'views.hidden.visible && !filtersApplied()' } }=t('admin.variant_overrides.index.no_hidden_products') - %span{ ng: { show: 'views.hidden.visible && filtersApplied()' } }=t('admin.variant_overrides.index.no_matching_hidden_products') - %span{ ng: { show: 'views.new.visible && !filtersApplied()' } }=t('admin.variant_overrides.index.no_new_products') - %span{ ng: { show: 'views.new.visible && filtersApplied()' } }=t('admin.variant_overrides.index.no_matching_new_products') +%div.text-big.no-results{ "ng-show": 'hub_id && products.length > 0 && filteredProducts.length == 0' } + %span{ "ng-show": 'views.inventory.visible && !filtersApplied()' }=t('admin.variant_overrides.index.currently_empty') + %span{ "ng-show": 'views.inventory.visible && filtersApplied()' }=t('admin.variant_overrides.index.no_matching_products') + %span{ "ng-show": 'views.hidden.visible && !filtersApplied()' }=t('admin.variant_overrides.index.no_hidden_products') + %span{ "ng-show": 'views.hidden.visible && filtersApplied()' }=t('admin.variant_overrides.index.no_matching_hidden_products') + %span{ "ng-show": 'views.new.visible && !filtersApplied()' }=t('admin.variant_overrides.index.no_new_products') + %span{ "ng-show": 'views.new.visible && filtersApplied()' }=t('admin.variant_overrides.index.no_matching_new_products') diff --git a/app/views/admin/variant_overrides/_products.html.haml b/app/views/admin/variant_overrides/_products.html.haml index e8d239b803..a54960da50 100644 --- a/app/views/admin/variant_overrides/_products.html.haml +++ b/app/views/admin/variant_overrides/_products.html.haml @@ -1,32 +1,32 @@ -%form{ name: 'variant_overrides_form', ng: { show: "views.inventory.visible" } } +%form{ name: 'variant_overrides_form', "ng-show": "views.inventory.visible" } %save-bar{ dirty: "customers_form.$dirty", persist: "false" } - %input.red{ type: "button", value: t(:save_changes), ng: { click: "update()", disabled: "!variant_overrides_form.$dirty" } } + %input.red{ type: "button", value: t(:save_changes), "ng-click": "update()", "ng-disabled": "!variant_overrides_form.$dirty" } %table.index.bulk#variant-overrides - %col.producer{ width: "20%", ng: { show: 'columns.producer.visible' } } - %col.product{ width: "20%", ng: { show: 'columns.product.visible' } } - %col.sku{ width: "20%", ng: { show: 'columns.sku.visible' } } - %col.price{ width: "10%", ng: { show: 'columns.price.visible' } } - %col.on_hand{ width: "10%", ng: { show: 'columns.on_hand.visible' } } - %col.on_demand{ width: "10%", ng: { show: 'columns.on_demand.visible' } } - %col.reset{ width: "1%", ng: { show: 'columns.reset.visible' } } - %col.reset{ width: "15%", ng: { show: 'columns.reset.visible' } } - %col.inheritance{ width: "5%", ng: { show: 'columns.inheritance.visible' } } - %col.tags{ width: "30%", ng: { show: 'columns.tags.visible' } } - %col.visibility{ width: "10%", ng: { show: 'columns.visibility.visible' } } - %col.visibility{ width: "10%", ng: { show: 'columns.import_date.visible' } } + %col.producer{ width: "20%", "ng-show": 'columns.producer.visible' } + %col.product{ width: "20%", "ng-show": 'columns.product.visible' } + %col.sku{ width: "20%", "ng-show": 'columns.sku.visible' } + %col.price{ width: "10%", "ng-show": 'columns.price.visible' } + %col.on_hand{ width: "10%", "ng-show": 'columns.on_hand.visible' } + %col.on_demand{ width: "10%", "ng-show": 'columns.on_demand.visible' } + %col.reset{ width: "1%", "ng-show": 'columns.reset.visible' } + %col.reset{ width: "15%", "ng-show": 'columns.reset.visible' } + %col.inheritance{ width: "5%", "ng-show": 'columns.inheritance.visible' } + %col.tags{ width: "30%", "ng-show": 'columns.tags.visible' } + %col.visibility{ width: "10%", "ng-show": 'columns.visibility.visible' } + %col.visibility{ width: "10%", "ng-show": 'columns.import_date.visible' } %thead - %tr{ ng: { controller: "ColumnsCtrl" } } - %th.producer{ ng: { show: 'columns.producer.visible' } }=t('admin.producer') - %th.product{ ng: { show: 'columns.product.visible' } }=t('admin.product') - %th.sku{ ng: { show: 'columns.sku.visible' } }=t('admin.sku') - %th.price{ ng: { show: 'columns.price.visible' } }=t('admin.price') - %th.on_hand{ ng: { show: 'columns.on_hand.visible' } }=t('admin.on_hand') - %th.on_demand{ ng: { show: 'columns.on_demand.visible' } }=t('admin.on_demand?') - %th.reset{ colspan: 2, ng: { show: 'columns.reset.visible' } }=t('admin.variant_overrides.index.enable_reset?') - %th.inheritance{ ng: { show: 'columns.inheritance.visible' } }=t('admin.variant_overrides.index.inherit?') - %th.tags{ ng: { show: 'columns.tags.visible' } }=t('admin.tags') - %th.visibility{ ng: { show: 'columns.visibility.visible' } }=t('admin.variant_overrides.index.hide') - %th.import_date{ ng: { show: 'columns.import_date.visible' } }=t('admin.variant_overrides.index.import_date') - %tbody{ ng: {repeat: 'product in filteredProducts = (products | hubPermissions:hubPermissions:hub_id | inventoryProducts:hub_id:views | attrFilter:{producer_id:producerFilter} | importDate:hub_id:importDateFilter | filter:query) | limitTo:productLimit' } } + %tr{ "ng-controller": "ColumnsCtrl" } + %th.producer{ "ng-show": 'columns.producer.visible' }=t('admin.producer') + %th.product{ "ng-show": 'columns.product.visible' }=t('admin.product') + %th.sku{ "ng-show": 'columns.sku.visible' }=t('admin.sku') + %th.price{ "ng-show": 'columns.price.visible' }=t('admin.price') + %th.on_hand{ "ng-show": 'columns.on_hand.visible' }=t('admin.on_hand') + %th.on_demand{ "ng-show": 'columns.on_demand.visible' }=t('admin.on_demand?') + %th.reset{ colspan: 2, "ng-show": 'columns.reset.visible' }=t('admin.variant_overrides.index.enable_reset?') + %th.inheritance{ "ng-show": 'columns.inheritance.visible' }=t('admin.variant_overrides.index.inherit?') + %th.tags{ "ng-show": 'columns.tags.visible' }=t('admin.tags') + %th.visibility{ "ng-show": 'columns.visibility.visible' }=t('admin.variant_overrides.index.hide') + %th.import_date{ "ng-show": 'columns.import_date.visible' }=t('admin.variant_overrides.index.import_date') + %tbody{ "ng-repeat": 'product in filteredProducts = (products | hubPermissions:hubPermissions:hub_id | inventoryProducts:hub_id:views | attrFilter:{producer_id:producerFilter} | importDate:hub_id:importDateFilter | filter:query) | limitTo:productLimit' } = render 'admin/variant_overrides/products_product' = render 'admin/variant_overrides/products_variants' diff --git a/app/views/admin/variant_overrides/_products_product.html.haml b/app/views/admin/variant_overrides/_products_product.html.haml index 312273d4d2..188f332e26 100644 --- a/app/views/admin/variant_overrides/_products_product.html.haml +++ b/app/views/admin/variant_overrides/_products_product.html.haml @@ -1,12 +1,12 @@ %tr.product.even - %td.producer{ ng: { show: 'columns.producer.visible', bind: { html: '::producersByID[product.producer_id].name'} } } - %td.product{ ng: { show: 'columns.product.visible', bind: '::product.name'} } - %td.sku{ ng: { show: 'columns.sku.visible' } } - %td.price{ ng: { show: 'columns.price.visible' } } - %td.on_hand{ ng: { show: 'columns.on_hand.visible' } } - %td.on_demand{ ng: { show: 'columns.on_demand.visible' } } - %td.reset{ colspan: 2, ng: { show: 'columns.reset.visible' } } - %td.inheritance{ ng: { show: 'columns.inheritance.visible' } } - %td.tags{ ng: { show: 'columns.tags.visible' } } - %td.visibility{ ng: { show: 'columns.visibility.visible' } } - %td.import_date{ ng: { show: 'columns.import_date.visible' } } + %td.producer{ "ng-show": 'columns.producer.visible', "ng-bind-html": '::producersByID[product.producer_id].name' } + %td.product{ "ng-show": 'columns.product.visible', "ng-bind": '::product.name' } + %td.sku{ "ng-show": 'columns.sku.visible' } + %td.price{ "ng-show": 'columns.price.visible' } + %td.on_hand{ "ng-show": 'columns.on_hand.visible' } + %td.on_demand{ "ng-show": 'columns.on_demand.visible' } + %td.reset{ colspan: 2, "ng-show": 'columns.reset.visible' } + %td.inheritance{ "ng-show": 'columns.inheritance.visible' } + %td.tags{ "ng-show": 'columns.tags.visible' } + %td.visibility{ "ng-show": 'columns.visibility.visible' } + %td.import_date{ "ng-show": 'columns.import_date.visible' } diff --git a/app/views/admin/variant_overrides/_products_variants.html.haml b/app/views/admin/variant_overrides/_products_variants.html.haml index 33f9fb9a61..43decfe33f 100644 --- a/app/views/admin/variant_overrides/_products_variants.html.haml +++ b/app/views/admin/variant_overrides/_products_variants.html.haml @@ -1,27 +1,27 @@ -%tr.variant{ id: "v_{{variant.id}}", ng: {repeat: 'variant in product.variants | inventoryVariants:hub_id:views'} } - %td.producer{ ng: { show: 'columns.producer.visible' } } - %td.product{ ng: { show: 'columns.product.visible' } } - %span{ ng: { bind: '::variant.display_name || ""'} } - .variant-override-unit{ ng: { bind: '::variant.unit_to_display'} } - %td.sku{ ng: { show: 'columns.sku.visible' } } - %input{name: 'variant-overrides-{{ variant.id }}-sku', type: 'text', ng: {model: 'variantOverrides[hub_id][variant.id].sku'}, placeholder: '{{ variant.sku }}', 'ofn-track-variant-override' => 'sku'} - %td.price{ ng: { show: 'columns.price.visible' } } - %input{name: 'variant-overrides-{{ variant.id }}-price', type: 'text', ng: {model: 'variantOverrides[hub_id][variant.id].price'}, placeholder: '{{ variant.price }}', 'ofn-track-variant-override' => 'price'} - %td.on_hand{ ng: { show: 'columns.on_hand.visible' } } - %input{name: 'variant-overrides-{{ variant.id }}-count_on_hand', type: 'text', ng: { model: 'variantOverrides[hub_id][variant.id].count_on_hand', readonly: 'variantOverrides[hub_id][variant.id].on_demand != false' }, placeholder: '{{ countOnHandPlaceholder(variant, hub_id) }}', 'ofn-track-variant-override' => 'count_on_hand'} - %td.on_demand{ ng: { show: 'columns.on_demand.visible' } } - %select{ name: 'variant-overrides-{{ variant.id }}-on_demand', ng: { model: 'variantOverrides[hub_id][variant.id].on_demand', change: 'updateCountOnHand(variant, hub_id)', options: 'option.value as option.description for option in onDemandOptions' }, 'ofn-track-variant-override' => 'on_demand' } - %td.reset{ ng: { show: 'columns.reset.visible' } } - %input{name: 'variant-overrides-{{ variant.id }}-resettable', type: 'checkbox', ng: {model: 'variantOverrides[hub_id][variant.id].resettable'}, placeholder: '{{ variant.resettable }}', 'ofn-track-variant-override' => 'resettable'} - %td.reset{ ng: { show: 'columns.reset.visible' } } - %input{name: 'variant-overrides-{{ variant.id }}-default_stock', type: 'text', ng: {model: 'variantOverrides[hub_id][variant.id].default_stock'}, placeholder: '{{ variant.default_stock ? variant.default_stock : ("admin.variant_overrides.index.default_stock" | t)}}', 'ofn-track-variant-override' => 'default_stock'} - %td.inheritance{ ng: { show: 'columns.inheritance.visible' } } - %input.field{ :type => 'checkbox', name: 'variant-overrides-{{ variant.id }}-inherit', ng: { model: 'inherit' }, 'track-inheritance' => true } - %td.tags{ ng: { show: 'columns.tags.visible' } } +%tr.variant{ id: "v_{{variant.id}}", "ng-repeat": 'variant in product.variants | inventoryVariants:hub_id:views' } + %td.producer{ "ng-show": 'columns.producer.visible' } + %td.product{ "ng-show": 'columns.product.visible' } + %span{ "ng-bind": '::variant.display_name || ""' } + .variant-override-unit{ "ng-bind": '::variant.unit_to_display' } + %td.sku{ "ng-show": 'columns.sku.visible' } + %input{ name: 'variant-overrides-{{ variant.id }}-sku', type: 'text', placeholder: '{{ variant.sku }}', "ofn-track-variant-override": 'sku', "ng-model": 'variantOverrides[hub_id][variant.id].sku' } + %td.price{ "ng-show": 'columns.price.visible' } + %input{ name: 'variant-overrides-{{ variant.id }}-price', type: 'text', placeholder: '{{ variant.price }}', "ofn-track-variant-override": 'price', "ng-model": 'variantOverrides[hub_id][variant.id].price' } + %td.on_hand{ "ng-show": 'columns.on_hand.visible' } + %input{ name: 'variant-overrides-{{ variant.id }}-count_on_hand', type: 'text', placeholder: '{{ countOnHandPlaceholder(variant, hub_id) }}', "ofn-track-variant-override": 'count_on_hand', "ng-model": 'variantOverrides[hub_id][variant.id].count_on_hand', "ng-readonly": 'variantOverrides[hub_id][variant.id].on_demand != false' } + %td.on_demand{ "ng-show": 'columns.on_demand.visible' } + %select{ name: 'variant-overrides-{{ variant.id }}-on_demand', "ofn-track-variant-override": 'on_demand', "ng-model": 'variantOverrides[hub_id][variant.id].on_demand', "ng-change": 'updateCountOnHand(variant, hub_id)', "ng-options": 'option.value as option.description for option in onDemandOptions' } + %td.reset{ "ng-show": 'columns.reset.visible' } + %input{ name: 'variant-overrides-{{ variant.id }}-resettable', type: 'checkbox', placeholder: '{{ variant.resettable }}', "ofn-track-variant-override": 'resettable', "ng-model": 'variantOverrides[hub_id][variant.id].resettable' } + %td.reset{ "ng-show": 'columns.reset.visible' } + %input{ name: 'variant-overrides-{{ variant.id }}-default_stock', type: 'text', placeholder: '{{ variant.default_stock ? variant.default_stock : ("admin.variant_overrides.index.default_stock" | t)}}', "ofn-track-variant-override": 'default_stock', "ng-model": 'variantOverrides[hub_id][variant.id].default_stock' } + %td.inheritance{ "ng-show": 'columns.inheritance.visible' } + %input.field{ type: 'checkbox', name: 'variant-overrides-{{ variant.id }}-inherit', "track-inheritance": true, "ng-model": 'inherit' } + %td.tags{ "ng-show": 'columns.tags.visible' } .tag_watcher{ 'track-tag-list' => true } %tags_with_translation{ object: 'variantOverrides[hub_id][variant.id]', form: 'variant_overrides_form' } - %td.visibility{ ng: { show: 'columns.visibility.visible' } } - %button.icon-remove.fullwidth{ :type => 'button', ng: { click: "setVisibility(hub_id,variant.id,false)" } } + %td.visibility{ "ng-show": 'columns.visibility.visible' } + %button.icon-remove.fullwidth{ type: 'button', "ng-click": "setVisibility(hub_id,variant.id,false)" } = t('admin.variant_overrides.index.hide') - %td.import_date{ ng: { show: 'columns.import_date.visible' } } + %td.import_date{ "ng-show": 'columns.import_date.visible' } %span {{variantOverrides[hub_id][variant.id].import_date | date:"MMMM dd, yyyy HH:mm"}} diff --git a/app/views/admin/variant_overrides/_show_more.html.haml b/app/views/admin/variant_overrides/_show_more.html.haml index a6414a6d52..e232a512c2 100644 --- a/app/views/admin/variant_overrides/_show_more.html.haml +++ b/app/views/admin/variant_overrides/_show_more.html.haml @@ -1,4 +1,4 @@ -.text-center{ ng: { show: "filteredProducts.length > productLimit" } } - %input{ type: 'button', value: t(:show_more), ng: { click: 'productLimit = productLimit + 10' } } +.text-center{ "ng-show": "filteredProducts.length > productLimit" } + %input{ type: 'button', value: t(:show_more), "ng-click": 'productLimit = productLimit + 10' } - %input{ type: 'button', value: "#{t(:show_all)} ({{ filteredProducts.length - productLimit }} More)", ng: { click: 'productLimit = filteredProducts.length' } } + %input{ type: 'button', value: "#{t(:show_all)} ({{ filteredProducts.length - productLimit }} More)", "ng-click": 'productLimit = filteredProducts.length' } diff --git a/app/views/admin/variant_overrides/index.html.haml b/app/views/admin/variant_overrides/index.html.haml index 16beaad7b9..adfcc8f71c 100644 --- a/app/views/admin/variant_overrides/index.html.haml +++ b/app/views/admin/variant_overrides/index.html.haml @@ -1,13 +1,13 @@ = render 'admin/variant_overrides/header' = render 'admin/variant_overrides/data' -.margin-bottom-50{ ng: { app: 'admin.variantOverrides', controller: 'AdminVariantOverridesCtrl', init: 'initialise()' } } +.margin-bottom-50{ "ng-app": 'admin.variantOverrides', "ng-controller": 'AdminVariantOverridesCtrl', "ng-init": 'initialise()' } = render 'admin/variant_overrides/filters' = render 'admin/variant_overrides/new_products_alert' = render 'admin/variant_overrides/loading_flash' = render 'admin/variant_overrides/controls' = render 'admin/variant_overrides/no_results' - %div{ ng: { cloak: true, show: 'hub_id && filteredProducts.length > 0' } } + %div{ "ng-cloak": true, "ng-show": 'hub_id && filteredProducts.length > 0' } = render 'admin/variant_overrides/new_products' = render 'admin/variant_overrides/hidden_products' = render 'admin/variant_overrides/products' diff --git a/app/views/checkout/payment/_gateway.html.haml b/app/views/checkout/payment/_gateway.html.haml deleted file mode 100644 index e2e1f8412d..0000000000 --- a/app/views/checkout/payment/_gateway.html.haml +++ /dev/null @@ -1,27 +0,0 @@ -= f.fields :bill_address, model: @order.bill_address do |bill_address| - %div.checkout-input - = bill_address.label :firstname, t("checkout.step1.your_details.first_name.label") - = bill_address.text_field :firstname, { placeholder: t("checkout.step1.your_details.first_name.placeholder") } - = f.error_message_on "bill_address.firstname" - - %div.checkout-input - = bill_address.label :lastname, t("checkout.step1.your_details.last_name.label") - = bill_address.text_field :lastname, { placeholder: t("checkout.step1.your_details.last_name.placeholder") } - = f.error_message_on "bill_address.lastname" - -.flex{style: "justify-content: space-between; gap: 10px;" } - %div.checkout-input{style: "flex-grow: 2;" } - = f.label :card_number, t("checkout.step2.form.card_number.label") - = f.text_field :card_number, { placeholder: t("checkout.step2.form.card_number.placeholder") } - - %div.checkout-input{style: "flex: 0 1 100px;"} - = f.label :card_verification_value, t("checkout.step2.form.card_verification_value.label") - = f.number_field :card_verification_value, { placeholder: t("checkout.step2.form.card_verification_value.placeholder") } - - %div.checkout-input{style: "flex: 0 1 70px;"} - = f.label :card_month, t("checkout.step2.form.card_month.label") - = f.number_field :card_month, { placeholder: t("checkout.step2.form.card_month.placeholder"), max: 12 } - - %div.checkout-input{style: "flex: 0 1 70px;"} - = f.label :card_year, t("checkout.step2.form.card_year.label") - = f.number_field :card_year, { placeholder: t("checkout.step2.form.card_year.placeholder"), min: Time.now.year, max: Time.now.year + 10 } diff --git a/app/views/devise/shared/_links.html.erb b/app/views/devise/shared/_links.html.erb index a4f3613e2c..8061cc19a8 100644 --- a/app/views/devise/shared/_links.html.erb +++ b/app/views/devise/shared/_links.html.erb @@ -1,19 +1,11 @@ -<%- if controller_name != 'sessions' %> - <%= link_to t(".sign_in"), new_session_path(resource_name) %>
-<% end %> +<%# Override Devise partial -<%- if devise_mapping.registerable? && controller_name != 'registrations' %> - <%= link_to t(".sign_up"), new_registration_path(resource_name) %>
-<% end %> +While this partial is unused in our app, Devise still renders it during +password reset and it fails to find `omniauth_authorize_path` which tries +to call `spree_user_openid_connect_omniauth_authorize_path` on our main app +while that helper is only defined on `Spree::Core::Engine.routes.url_helpers`. -<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> - <%= link_to t(".forgot_your_password"), new_password_path(resource_name) %>
-<% end %> +This is just a workaround and the proper solution would be to include all Spree +routes in our main Rails app instead of having a separate Spree::Core engine. -<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> - <%= link_to t('.didn_t_receive_confirmation_instructions'), new_confirmation_path(resource_name) %>
-<% end %> - -<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> - <%= link_to t('.didn_t_receive_unlock_instructions'), new_unlock_path(resource_name) %>
-<% end %> +%> diff --git a/app/views/enterprises/shop.html.haml b/app/views/enterprises/shop.html.haml index 628f4b8630..81949bf49a 100644 --- a/app/views/enterprises/shop.html.haml +++ b/app/views/enterprises/shop.html.haml @@ -17,9 +17,9 @@ - if @shopfront_layout == 'embedded' = render partial: 'shop/blocked_cookies' - .alert-box.changeable-orders-alert.info.animate-show{ ng: { show: "alert.visible && alert.html", cloak: true } } - %span{ ng: { bind: { html: "alert.html" } } } - %a.close{ ng: { click: "alert.close()" } } × + .alert-box.changeable-orders-alert.info.animate-show{ "ng-show": "alert.visible && alert.html", "ng-cloak": true } + %span{ "ng-bind-html": "alert.html" } + %a.close{ "ng-click": "alert.close()" } × - content_for :order_cycle_form do = render partial: "change_order_cycle" diff --git a/app/views/home/_connect.html.haml b/app/views/home/_connect.html.haml deleted file mode 100644 index 6afcb1ae96..0000000000 --- a/app/views/home/_connect.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -#connect.pane - .row - .small-12.medium-6.medium-offset-3.columns.text-center - %h2= t :label_connect - %p.text-normal= t :connect_body - %a.button.transparent{href: "https://openfoodnetwork.org/au/connect/"} - = t :connect_cta diff --git a/app/views/home/_learn.html.haml b/app/views/home/_learn.html.haml deleted file mode 100644 index f6d3061e20..0000000000 --- a/app/views/home/_learn.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -#learn.pane - .row - .small-12.medium-6.medium-offset-3.columns.text-center - %h2= t :label_learn - %p.text-normal= t :learn_body - %a.button.transparent{href: "https://openfoodnetwork.org/au/learn/"} - = t :learn_cta diff --git a/app/views/producers/_skinny.html.haml b/app/views/producers/_skinny.html.haml index 6e05619d07..644a3805b9 100644 --- a/app/views/producers/_skinny.html.haml +++ b/app/views/producers/_skinny.html.haml @@ -4,14 +4,14 @@ .row.vertical-align-middle .columns.small-12 %a.is_distributor{"ng-href" => "{{::producer.path}}", "ng-attr-target" => "{{ embedded_layout ? '_blank' : undefined}}", "data-is-link" => "true"} - %i{ng: {class: "::producer.producer_icon_font"}} + %i{ "ng-class": "::producer.producer_icon_font" } %span.margin-top %strong{"ng-bind" => "::producer.name"} %span.producer-name{"ng-if" => "::!producer.is_distributor" } .row.vertical-align-middle .columns.small-12 - %i{ng: {class: "::producer.producer_icon_font"}} + %i{ "ng-class": "::producer.producer_icon_font" } %span.margin-top %strong{"ng-bind" => "::producer.name"} diff --git a/app/views/registration/_modal.html.haml b/app/views/registration/_modal.html.haml index 5fa1da9296..798c1f23f9 100644 --- a/app/views/registration/_modal.html.haml +++ b/app/views/registration/_modal.html.haml @@ -1,10 +1,10 @@ %script{ type: "text/ng-template", id: "registration.html" } %div#registration-modal{"ng-controller" => "RegistrationCtrl"} - %div{ ng: { show: "currentStep() == 'introduction'" } } + %div{ "ng-show": "currentStep() == 'introduction'" } %ng-include{ src: "'registration/introduction.html'" } - %div{ ng: { repeat: 'step in steps', show: "currentStep() == step" } } + %div{ "ng-repeat": 'step in steps', "ng-show": "currentStep() == step" } %ng-include{ src: "'registration/'+ step + '.html'" } - %div{ ng: { show: "currentStep() == 'finished'" } } + %div{ "ng-show": "currentStep() == 'finished'" } %ng-include{ src: "'registration/finished.html'" } %a.close-reveal-modal{"ng-click" => "$close()"} diff --git a/app/views/registration/steps/_about.html.haml b/app/views/registration/steps/_about.html.haml index 65a688e54b..9a18dbd55a 100644 --- a/app/views/registration/steps/_about.html.haml +++ b/app/views/registration/steps/_about.html.haml @@ -7,49 +7,49 @@ %h2= t(".headline") %h5 = t(".message") - %span{ ng: { class: "{brick: !enterprise.is_primary_producer, turquoise: enterprise.is_primary_producer}" } } + %span{ "ng-class": "{brick: !enterprise.is_primary_producer, turquoise: enterprise.is_primary_producer}" } {{ enterprise.name }} - %form{ name: 'about', novalidate: true, ng: { controller: "RegistrationFormCtrl", submit: "selectIfValid('images', about)" } } + %form{ name: 'about', novalidate: true, "ng-controller": "RegistrationFormCtrl", "ng-submit": "selectIfValid('images', about)" } .row .small-12.columns - .alert-box.info{ "ofn-inline-alert" => true, ng: { show: "visible" } } + .alert-box.info{ "ofn-inline-alert": true, "ng-show": "visible" } %h6{ "ng-bind" => "'registration.steps.about.success' | t:{enterprise: enterprise.name}" } %span= t(".registration_exit_message") - %a.close{ ng: { click: "close()" } } × + %a.close{ "ng-click": "close()" } × .small-12.large-8.columns .row .small-12.columns .field %label{ for: 'enterprise_description' }= t(".enterprise_description") - %input.chunky{ id: 'enterprise_description', placeholder: "{{'registration.steps.about.enterprise_description_placeholder' | t}}", ng: { model: 'enterprise.description' } } + %input.chunky{ id: 'enterprise_description', placeholder: "{{'registration.steps.about.enterprise_description_placeholder' | t}}", "ng-model": 'enterprise.description' } .row .small-12.columns .field %label{ for: 'enterprise_long_desc' }= t(".enterprise_long_desc") - %textarea.chunky{ id: 'enterprise_long_desc', rows: 6, placeholder: "{{'registration.steps.about.enterprise_long_desc_placeholder' | t}}", ng: { model: 'enterprise.long_description' } } + %textarea.chunky{ id: 'enterprise_long_desc', rows: 6, placeholder: "{{'registration.steps.about.enterprise_long_desc_placeholder' | t}}", "ng-model": 'enterprise.long_description' } %small{ "ng-bind" => "'registration.steps.about.enterprise_long_desc_length' | t:{num: enterprise.long_description.length}" } .small-12.large-4.columns .row .small-12.columns .field %label{ for: 'enterprise_abn' }= t(".enterprise_abn")+":" - %input.chunky{ id: 'enterprise_abn', placeholder: "{{'registration.steps.about.enterprise_abn_placeholder' | t}}", ng: { model: 'enterprise.abn' } } + %input.chunky{ id: 'enterprise_abn', placeholder: "{{'registration.steps.about.enterprise_abn_placeholder' | t}}", "ng-model": 'enterprise.abn' } .row .small-12.columns .field %label{ for: 'enterprise_acn' }= t(".enterprise_acn")+":" - %input.chunky{ id: 'enterprise_acn', placeholder: "{{'registration.steps.about.enterprise_acn_placeholder' | t}}", ng: { model: 'enterprise.acn' } } + %input.chunky{ id: 'enterprise_acn', placeholder: "{{'registration.steps.about.enterprise_acn_placeholder' | t}}", "ng-model": 'enterprise.acn' } .row .small-12.columns .field %label{ for: 'enterprise_charges_sales_tax' }= t(:charges_sales_tax) - %input{ id: 'enterprise_charges_sales_tax_true', type: 'radio', name: 'charges_sales_tax', value: 'true', required: true, ng: { model: 'enterprise.charges_sales_tax' } } + %input{ id: 'enterprise_charges_sales_tax_true', type: 'radio', name: 'charges_sales_tax', value: 'true', required: true, "ng-model": 'enterprise.charges_sales_tax' } %label{ for: 'enterprise_charges_sales_tax_true' } {{'say_yes' | t}} - %input{ id: 'enterprise_charges_sales_tax_false', type: 'radio', name: 'charges_sales_tax', value: 'false', required: true, ng: { model: 'enterprise.charges_sales_tax' } } + %input{ id: 'enterprise_charges_sales_tax_false', type: 'radio', name: 'charges_sales_tax', value: 'false', required: true, "ng-model": 'enterprise.charges_sales_tax' } %label{ for: 'enterprise_charges_sales_tax_false' } {{'say_no' | t}} - %span.error.small-12.columns{ ng: { show: "about.charges_sales_tax.$error.required && submitted" } } + %span.error.small-12.columns{ "ng-show": "about.charges_sales_tax.$error.required && submitted" } = t(".enterprise_tax_required") .row.buttons.pad-top diff --git a/app/views/registration/steps/_contact.html.haml b/app/views/registration/steps/_contact.html.haml index 370101ada3..2dea91fef5 100644 --- a/app/views/registration/steps/_contact.html.haml +++ b/app/views/registration/steps/_contact.html.haml @@ -7,30 +7,30 @@ %h2= t('registration.steps.introduction.registration_greeting') %h5{ "ng-bind" => "'registration.steps.contact.who_is_managing_enterprise' | t:{enterprise: enterprise.name}" } - %form{ name: 'contact', novalidate: true, ng: { controller: "RegistrationFormCtrl", submit: "selectIfValid('type',contact)" } } + %form{ name: 'contact', novalidate: true, "ng-controller": "RegistrationFormCtrl", "ng-submit": "selectIfValid('type',contact)" } .row.content .small-12.medium-12.large-7.columns .row .small-12.columns.field %label{ for: 'enterprise_contact' }= t(".contact_field") - %input.chunky.small-12.columns{ id: 'enterprise_contact', name: 'contact_name', required: true, placeholder: "{{'registration.steps.contact.contact_field_placeholder' | t}}", ng: { model: 'enterprise.contact_name' } } - %span.error.small-12.columns{ ng: { show: "contact.contact_name.$error.required && submitted" } } + %input.chunky.small-12.columns{ id: 'enterprise_contact', name: 'contact_name', required: true, placeholder: "{{'registration.steps.contact.contact_field_placeholder' | t}}", "ng-model": 'enterprise.contact_name' } + %span.error.small-12.columns{ "ng-show": "contact.contact_name.$error.required && submitted" } = t(".contact_field_required") .row .small-12.columns.field %label{ for: 'enterprise_email_address' }= t("admin.enterprises.form.contact.email_address")+":" - %input.chunky.small-12.columns{ id: 'enterprise_email_address', name: 'email_address', type: 'email', placeholder: t('admin.enterprises.form.contact.email_address_placeholder'), ng: { model: 'enterprise.email_address' } } + %input.chunky.small-12.columns{ id: 'enterprise_email_address', name: 'email_address', type: 'email', placeholder: t('admin.enterprises.form.contact.email_address_placeholder'), "ng-model": 'enterprise.email_address' } .row .small-12.columns.field %label{ for: 'enterprise_phone' }= t(".phone_field")+":" - %input.chunky.small-12.columns{ id: 'enterprise_phone', name: 'phone', placeholder: "{{'registration.steps.contact.phone_field_placeholder' | t}}", ng: { model: 'enterprise.phone' } } + %input.chunky.small-12.columns{ id: 'enterprise_phone', name: 'phone', placeholder: "{{'registration.steps.contact.phone_field_placeholder' | t}}", "ng-model": 'enterprise.phone' } .row .small-12.columns.field %label{ "for" => 'enterprise_whatsapp_phone', 'data-toggle' => "tooltip", 'title' => "{{'registration.steps.contact.whatsapp_phone_tooltip' | t}}" }= t(".whatsapp_phone_field")+":" - %input.chunky.small-12.columns{ id: 'enterprise_whatsapp_phone', name: 'whatsapp_phone', placeholder: "{{'registration.steps.contact.whatsapp_phone_field_placeholder' | t}}", ng: { model: 'enterprise.whatsapp_phone' } } + %input.chunky.small-12.columns{ id: 'enterprise_whatsapp_phone', name: 'whatsapp_phone', placeholder: "{{'registration.steps.contact.whatsapp_phone_field_placeholder' | t}}", "ng-model": 'enterprise.whatsapp_phone' } .small-12.medium-12.large-5.hide-for-small-only .row.buttons .small-12.columns - %input.button.secondary{ type: "button", value: "{{'back' | t}}", ng: { click: "select('details')" } } + %input.button.secondary{ type: "button", value: "{{'back' | t}}", "ng-click": "select('details')" } %input.button.primary.right{ type: "submit", value: "{{'continue' | t}}" } diff --git a/app/views/registration/steps/_details.html.haml b/app/views/registration/steps/_details.html.haml index 906b3a5745..45fb0e56b7 100644 --- a/app/views/registration/steps/_details.html.haml +++ b/app/views/registration/steps/_details.html.haml @@ -5,56 +5,56 @@ .small-12.columns %header %h2= t('.headline') - %h5{ ng: { if: "::enterprise.type != 'own'" } }= t(".enterprise") - %h5{ ng: { if: "::enterprise.type == 'own'" } }= t(".producer") - %form{ name: 'details', novalidate: true, ng: { controller: "RegistrationFormCtrl", submit: "selectIfValid('contact',details)" } } + %h5{ "ng-if": "::enterprise.type != 'own'" }= t(".enterprise") + %h5{ "ng-if": "::enterprise.type == 'own'" }= t(".producer") + %form{ name: 'details', novalidate: true, "ng-controller": "RegistrationFormCtrl", "ng-submit": "selectIfValid('contact',details)" } .row .small-12.medium-9.large-12.columns.end .field - %label{ for: 'enterprise_name', ng: { if: "::enterprise.type != 'own'" } }= t(".enterprise_name_field") - %label{ for: 'enterprise_name', ng: { if: "::enterprise.type == 'own'" } }= t(".producer_name_field") - %input.chunky{ id: 'enterprise_name', name: 'name', placeholder: "{{'registration.steps.details.producer_name_field_placeholder' | t}}", required: true, ng: { model: 'enterprise.name' } } - %span.error{ ng: { show: "details.name.$error.required && submitted" } } + %label{ for: 'enterprise_name', "ng-if": "::enterprise.type != 'own'" }= t(".enterprise_name_field") + %label{ for: 'enterprise_name', "ng-if": "::enterprise.type == 'own'" }= t(".producer_name_field") + %input.chunky{ id: 'enterprise_name', name: 'name', placeholder: "{{'registration.steps.details.producer_name_field_placeholder' | t}}", required: true, "ng-model": 'enterprise.name' } + %span.error{ "ng-show": "details.name.$error.required && submitted" } = t(".producer_name_field_error") .row .small-12.medium-9.large-6.columns .field %label{ for: 'enterprise_address' }= t(".address1_field") - %input.chunky{ id: 'enterprise_address', name: 'address1', required: true, placeholder: "{{'registration.steps.details.address1_field_placeholder' | t}}", required: true, ng: { model: 'enterprise.address.address1' } } - %span.error{ ng: { show: "details.address1.$error.required && submitted" } } + %input.chunky{ id: 'enterprise_address', name: 'address1', required: true, placeholder: "{{'registration.steps.details.address1_field_placeholder' | t}}", "ng-model": 'enterprise.address.address1' } + %span.error{ "ng-show": "details.address1.$error.required && submitted" } = t(".address1_field_error") .field %label{ for: 'enterprise_address2' }= t(".address2_field") - %input.chunky{ id: 'enterprise_address2', name: 'address2', required: false, placeholder: "", required: false, ng: { model: 'enterprise.address.address2' } } + %input.chunky{ id: 'enterprise_address2', name: 'address2', required: false, placeholder: "", "ng-model": 'enterprise.address.address2' } .small-12.medium-9.large-6.columns.end .row .small-12.medium-8.large-8.columns .field %label{ for: 'enterprise_city' }= t('.suburb_field') - %input.chunky{ id: 'enterprise_city', name: 'city', required: true, placeholder: "{{'registration.steps.details.suburb_field_placeholder' | t}}", ng: { model: 'enterprise.address.city' } } - %span.error{ ng: { show: "details.city.$error.required && submitted" } } + %input.chunky{ id: 'enterprise_city', name: 'city', required: true, placeholder: "{{'registration.steps.details.suburb_field_placeholder' | t}}", "ng-model": 'enterprise.address.city' } + %span.error{ "ng-show": "details.city.$error.required && submitted" } = t(".suburb_field_error") .small-12.medium-4.large-4.columns .field %label{ for: 'enterprise_zipcode' }= t(".postcode_field") - %input.chunky{ id: 'enterprise_zipcode', name: 'zipcode', required: true, placeholder: "{{'registration.steps.details.postcode_field_placeholder' | t}}", ng: { model: 'enterprise.address.zipcode' } } - %span.error{ ng: { show: "details.zipcode.$error.required && submitted" } } + %input.chunky{ id: 'enterprise_zipcode', name: 'zipcode', required: true, placeholder: "{{'registration.steps.details.postcode_field_placeholder' | t}}", "ng-model": 'enterprise.address.zipcode' } + %span.error{ "ng-show": "details.zipcode.$error.required && submitted" } = t(".postcode_field_error") .row .small-12.medium-8.large-8.columns .field %label{ for: 'enterprise_country' }= t(".country_field") - %select.chunky{ id: 'enterprise_country', name: 'country', required: true, ng: { init: "setDefaultCountry(#{DefaultCountry.id})", model: 'enterprise.country', options: 'c as c.name for c in countries' } } - %span.error{ ng: { show: "details.country.$error.required && submitted" } } + %select.chunky{ id: 'enterprise_country', name: 'country', required: true, "ng-init": "setDefaultCountry(#{DefaultCountry.id})", "ng-model": 'enterprise.country', "ng-options": 'c as c.name for c in countries' } + %span.error{ "ng-show": "details.country.$error.required && submitted" } = t(".country_field_error") .small-12.medium-4.large-4.columns .field %label{ for: 'enterprise_state' }= t(".state_field") - %select.chunky{ id: 'enterprise_state', name: 'state', ng: { model: 'enterprise.address.state_id', options: 's.id as s.abbr for s in enterprise.country.states', show: 'countryHasStates()', required: 'countryHasStates()' } } - %span.error{ ng: { show: "details.state.$error.required && submitted" } } + %select.chunky{ id: 'enterprise_state', name: 'state', "ng-model": 'enterprise.address.state_id', "ng-options": 's.id as s.abbr for s in enterprise.country.states', "ng-show": 'countryHasStates()', "ng-required": 'countryHasStates()' } + %span.error{ "ng-show": "details.state.$error.required && submitted" } = t(".state_field_error") = render 'registration/steps/location_map' if using_google_maps? diff --git a/app/views/registration/steps/_images.html.haml b/app/views/registration/steps/_images.html.haml index b52c179f3c..9df31aaf96 100644 --- a/app/views/registration/steps/_images.html.haml +++ b/app/views/registration/steps/_images.html.haml @@ -1,5 +1,5 @@ %script{ type: "text/ng-template", id: "registration/images.html" } - .container#registration-images{ 'nv-file-drop' => true, uploader: "imageUploader", options:"{ alias: imageStep }", ng: { controller: "EnterpriseImageCtrl" } } + .container#registration-images{ "nv-file-drop": true, uploader: "imageUploader", options: "{ alias: imageStep }", "ng-controller": "EnterpriseImageCtrl" } %ng-include{ src: "'registration/steps.html'" } .row .small-12.columns @@ -7,17 +7,17 @@ %h2= t(".headline") %h5= t(".description") - %form{ name: 'images', novalidate: true, ng: { controller: "RegistrationFormCtrl", submit: "select('social')" } } - .row{ ng: { repeat: 'image_step in imageSteps', show: "imageStep == image_step" } } + %form{ name: 'images', novalidate: true, "ng-controller": "RegistrationFormCtrl", "ng-submit": "select('social')" } + .row{ "ng-repeat": 'image_step in imageSteps', "ng-show": "imageStep == image_step" } %ng-include{ src: "'registration/'+ image_step + '.html'" } - .row.buttons.pad-top{ ng: { if: "imageStep == 'logo'" } } + .row.buttons.pad-top{ "ng-if": "imageStep == 'logo'" } .small-12.columns - %input.button.secondary{ type: "button", value: t(".back"), ng: { click: "select('about')" } } + %input.button.secondary{ type: "button", value: t(".back"), "ng-click": "select('about')" }   - %input.button.primary.right{ type: "button", value: t(".continue"), ng: { click: "imageSelect('promo')" } } + %input.button.primary.right{ type: "button", value: t(".continue"), "ng-click": "imageSelect('promo')" } - .row.buttons.pad-top{ ng: { if: "imageStep == 'promo'" } } + .row.buttons.pad-top{ "ng-if": "imageStep == 'promo'" } .small-12.columns - %input.button.secondary{ type: "button", value: t(".back"), ng: { click: "imageSelect('logo')" } } + %input.button.secondary{ type: "button", value: t(".back"), "ng-click": "imageSelect('logo')" } %input.button.primary.right{ type: "submit", value: t(".continue") } diff --git a/app/views/registration/steps/_introduction.html.haml b/app/views/registration/steps/_introduction.html.haml index 90cbabff83..9b7286864b 100644 --- a/app/views/registration/steps/_introduction.html.haml +++ b/app/views/registration/steps/_introduction.html.haml @@ -44,8 +44,8 @@ #{t(:enterprise_tos_message)} = link_to_platform_terms %p.tos-checkbox - %input{ type: 'checkbox', name: 'accept_terms', id: 'accept_terms', ng: { model: "tos_accepted" } } + %input{ type: 'checkbox', name: 'accept_terms', id: 'accept_terms', "ng-model": "tos_accepted" } %label{for: "accept_terms"} #{t(:enterprise_tos_agree)} .small-12.medium-6.columns - %input.button.primary.left{ type: "button", value: "{{'registration.steps.introduction.registration_action' | t}}", ng: { click: "select('details')", disabled: "tos_required && !tos_accepted", model: "tos_accepted"} } + %input.button.primary.left{ type: "button", value: "{{'registration.steps.introduction.registration_action' | t}}", "ng-click": "select('details')", "ng-disabled": "tos_required && !tos_accepted", "ng-model": "tos_accepted" } diff --git a/app/views/registration/steps/_limit_reached.html.haml b/app/views/registration/steps/_limit_reached.html.haml index 7a486e5743..6f07dd80b9 100644 --- a/app/views/registration/steps/_limit_reached.html.haml +++ b/app/views/registration/steps/_limit_reached.html.haml @@ -14,4 +14,4 @@ .row .small-12.columns %hr - %input.button.primary{ type: "button", value: "{{'registration.steps.limit_reached.action' | t}}", ng: { click: "close()" } } + %input.button.primary{ type: "button", value: "{{'registration.steps.limit_reached.action' | t}}", "ng-click": "close()" } diff --git a/app/views/registration/steps/_location_map.html.haml b/app/views/registration/steps/_location_map.html.haml index 1d6baeb9ac..280ca55541 100644 --- a/app/views/registration/steps/_location_map.html.haml +++ b/app/views/registration/steps/_location_map.html.haml @@ -1,19 +1,19 @@ %div .center - %input.button.primary{ type: "button", value: "{{'registration.steps.details.locate_address' | t}}", ng: { click: "locateAddress()" } } - .center{ ng: {if: "latLong"}} + %input.button.primary{ type: "button", value: "{{'registration.steps.details.locate_address' | t}}", "ng-click": "locateAddress()" } + .center{ "ng-if": "latLong" } %strong {{'registration.steps.details.drag_pin' | t}} .small-12.medium-9.large-12.columns.end - .map-container--registration{id: "registration-map", ng: {if: "!!map"}} + .map-container--registration{ id: "registration-map", "ng-if": "!!map" } %ui-gmap-google-map{ center: "map.center", zoom: "map.zoom"} %ui-gmap-marker{idKey: 1, coords: "latLong", options: '{ draggable: true}'} - .center{ ng: {if: "latLong"}} + .center{ "ng-if": "latLong" } .field - %input{ type: 'checkbox', id: 'confirm_address', name: 'confirm_address', ng: { click: 'toggleAddressConfirmed()' } } + %input{ type: 'checkbox', id: 'confirm_address', name: 'confirm_address', "ng-click": 'toggleAddressConfirmed()' } %label{ for: 'confirm_address' } {{'registration.steps.details.confirm_address' | t}} - .small-12.medium-9.large-12.columns.end{ ng: {if: "latLong"}} + .small-12.medium-9.large-12.columns.end{ "ng-if": "latLong" } .field %strong {{'registration.steps.details.drag_map_marker' | t}} diff --git a/app/views/registration/steps/_logo.html.haml b/app/views/registration/steps/_logo.html.haml index 06de18ff4d..e79ba39fd1 100644 --- a/app/views/registration/steps/_logo.html.haml +++ b/app/views/registration/steps/_logo.html.haml @@ -37,10 +37,10 @@ .row.pad-top .small-12.columns.center #image-placeholder.logo - %img{ ng: { show: "imageSrc() && !imageUploader.isUploading", src: '{{ imageSrc() }}' } } - .message{ ng: { hide: "imageSrc() || imageUploader.isUploading" } } + %img{ "ng-show": "imageSrc() && !imageUploader.isUploading", "ng-src": '{{ imageSrc() }}' } + .message{ "ng-hide": "imageSrc() || imageUploader.isUploading" } = t(".logo_placeholder") - .loading{ ng: { hide: "!imageUploader.isUploading" } } + .loading{ "ng-hide": "!imageUploader.isUploading" } = render partial: "components/spinner" %br/ = t("registration.steps.images.uploading") diff --git a/app/views/registration/steps/_promo.html.haml b/app/views/registration/steps/_promo.html.haml index 3a9d94db75..2b9ef89616 100644 --- a/app/views/registration/steps/_promo.html.haml +++ b/app/views/registration/steps/_promo.html.haml @@ -35,10 +35,10 @@ .row.pad-top .small-12.columns.center #image-placeholder.promo - %img{ ng: { show: "imageSrc() && !imageUploader.isUploading", src: '{{ imageSrc() }}' } } - .message{ ng: { hide: "imageSrc() || imageUploader.isUploading" } } + %img{ "ng-show": "imageSrc() && !imageUploader.isUploading", "ng-src": '{{ imageSrc() }}' } + .message{ "ng-hide": "imageSrc() || imageUploader.isUploading" } = t(".promo_image_placeholder") - .loading{ ng: { hide: "!imageUploader.isUploading" } } + .loading{ "ng-hide": "!imageUploader.isUploading" } = render partial: "components/spinner" %br/ = t("registration.steps.images.uploading") diff --git a/app/views/registration/steps/_social.html.haml b/app/views/registration/steps/_social.html.haml index 9cd86ead1c..180d79019b 100644 --- a/app/views/registration/steps/_social.html.haml +++ b/app/views/registration/steps/_social.html.haml @@ -8,38 +8,38 @@ %h2= t(".enterprise_final_step") %h5{ "ng-bind" => "'registration.steps.social.enterprise_social_text' | t:{enterprise: enterprise.name}" } - %form{ name: 'social', novalidate: true, ng: { controller: "RegistrationFormCtrl", submit: "update('finished',social)" } } + %form{ name: 'social', novalidate: true, "ng-controller": "RegistrationFormCtrl", "ng-submit": "update('finished',social)" } .row.content .small-12.large-7.columns .row .small-12.columns .field %label{ for: 'enterprise_website' }= t(".website")+":" - %input.chunky{ id: 'enterprise_website', placeholder: "{{'registration.steps.social.website_placeholder' | t}}", ng: { model: 'enterprise.website' } } + %input.chunky{ id: 'enterprise_website', placeholder: "{{'registration.steps.social.website_placeholder' | t}}", "ng-model": 'enterprise.website' } .row .small-12.columns .field %label{ for: 'enterprise_facebook' }= t(".facebook")+":" - %input.chunky{ id: 'enterprise_facebook', placeholder: "{{'registration.steps.social.facebook_placeholder' | t}}", ng: { model: 'enterprise.facebook' } } + %input.chunky{ id: 'enterprise_facebook', placeholder: "{{'registration.steps.social.facebook_placeholder' | t}}", "ng-model": 'enterprise.facebook' } .row .small-12.columns .field %label{ for: 'enterprise_linkedin' }= t(".linkedin")+":" - %input.chunky{ id: 'enterprise_linkedin', placeholder: "{{'registration.steps.social.linkedin_placeholder' | t}}", ng: { model: 'enterprise.linkedin' } } + %input.chunky{ id: 'enterprise_linkedin', placeholder: "{{'registration.steps.social.linkedin_placeholder' | t}}", "ng-model": 'enterprise.linkedin' } .small-12.large-5.columns .row .small-12.columns .field %label{ for: 'enterprise_twitter' }= t(".twitter")+":" - %input.chunky{ id: 'enterprise_twitter', placeholder: "{{'registration.steps.social.twitter_placeholder' | t}}", ng: { model: 'enterprise.twitter' } } + %input.chunky{ id: 'enterprise_twitter', placeholder: "{{'registration.steps.social.twitter_placeholder' | t}}", "ng-model": 'enterprise.twitter' } .row .small-12.columns .field %label{ for: 'enterprise_instagram' }= t(".instagram")+":" - %input.chunky{ id: 'enterprise_instagram', placeholder: "{{'registration.steps.social.instagram_placeholder' | t}}", ng: { model: 'enterprise.instagram' } } + %input.chunky{ id: 'enterprise_instagram', placeholder: "{{'registration.steps.social.instagram_placeholder' | t}}", "ng-model": 'enterprise.instagram' } %span.error.small-12.columns#instagram-error{ style: "display: none" } .row.buttons .small-12.columns - %input.button.secondary{ type: "button", value: "{{'back' | t}}", ng: { click: "select('images')" } } + %input.button.secondary{ type: "button", value: "{{'back' | t}}", "ng-click": "select('images')" } %input.button.primary.right{ type: "submit", value: "{{'continue' | t}}" } diff --git a/app/views/registration/steps/_steps.html.haml b/app/views/registration/steps/_steps.html.haml index 081cd97d98..44bd076de9 100644 --- a/app/views/registration/steps/_steps.html.haml +++ b/app/views/registration/steps/_steps.html.haml @@ -1,5 +1,5 @@ %script{ type: "text/ng-template", id: "registration/steps.html" } .row#progress-bar - .small-12.medium-2.columns.item{ ng: { repeat: 'step in steps', class: "{active: (currentStep() == step),'show-for-medium-up': (currentStep() != step)}" } } + .small-12.medium-2.columns.item{ "ng-repeat": 'step in steps', "ng-class": "{active: (currentStep() == step),'show-for-medium-up': (currentStep() != step)}" } {{ $index+1 + ". " + ('registration.steps.' + step + '.title' | t) }} diff --git a/app/views/registration/steps/_type.html.haml b/app/views/registration/steps/_type.html.haml index 01482fd160..654ddedded 100644 --- a/app/views/registration/steps/_type.html.haml +++ b/app/views/registration/steps/_type.html.haml @@ -10,24 +10,24 @@ %h4 = t(".question") - %form{ name: 'type', novalidate: true, ng: { controller: "RegistrationFormCtrl", submit: "create(type)" } } - .row#enterprise-types{ 'data-equalizer' => true, ng: { if: "::enterprise.type != 'own'" } } + %form{ name: 'type', novalidate: true, "ng-controller": "RegistrationFormCtrl", "ng-submit": "create(type)" } + .row#enterprise-types{ "data-equalizer": true, "ng-if": "::enterprise.type != 'own'" } .small-12.columns.field .row .small-12.medium-6.large-6.columns{ 'data-equalizer-watch' => true } - %a.btnpanel#producer-panel{ href: "#", ng: { click: "enterprise.is_primary_producer = true", class: "{selected: enterprise.is_primary_producer}" } } + %a.btnpanel#producer-panel{ href: "#", "ng-click": "enterprise.is_primary_producer = true", "ng-class": "{selected: enterprise.is_primary_producer}" } %i.ofn-i_059-producer %h4= t(".yes_producer") .small-12.medium-6.large-6.columns{ 'data-equalizer-watch' => true } - %a.btnpanel#hub-panel{ href: "#", ng: { click: "enterprise.is_primary_producer = false", class: "{selected: enterprise.is_primary_producer == false}" } } + %a.btnpanel#hub-panel{ href: "#", "ng-click": "enterprise.is_primary_producer = false", "ng-class": "{selected: enterprise.is_primary_producer == false}" } %i.ofn-i_063-hub %h4= t(".no_producer") .row .small-12.columns - %input.chunky{ id: 'enterprise_is_primary_producer', name: 'is_primary_producer', type: "hidden", required: true, ng: { model: 'enterprise.is_primary_producer' } } - %span.error{ ng: { show: "type.is_primary_producer.$error.required && submitted" } } + %input.chunky{ id: 'enterprise_is_primary_producer', name: 'is_primary_producer', type: "hidden", required: true, "ng-model": 'enterprise.is_primary_producer' } + %span.error{ "ng-show": "type.is_primary_producer.$error.required && submitted" } = t(".producer_field_error") .row .small-12.columns @@ -44,5 +44,5 @@ .row.buttons .small-12.columns - %input.button.secondary{ type: "button", value: "{{'back' | t}}", ng: { click: "select('contact')" } } - %input.button.primary.right{ ng: { disabled: 'isDisabled' }, type: "submit", value: t(".create_profile") } + %input.button.secondary{ type: "button", value: "{{'back' | t}}", "ng-click": "select('contact')" } + %input.button.primary.right{ type: "submit", value: t(".create_profile"), "ng-disabled": 'isDisabled' } diff --git a/app/views/shared/_distributor.html.haml b/app/views/shared/_distributor.html.haml deleted file mode 100644 index ea1eeae0a4..0000000000 --- a/app/views/shared/_distributor.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -= succeed ',' do - = link_to "#{distributor.name}".html_safe, enterprise_shop_path(distributor), {class: distributor_link_class(distributor)} -%span.secondary= distributor.city diff --git a/app/views/shared/menu/_alert.html.haml b/app/views/shared/menu/_alert.html.haml index e3eb53fe74..787c1258cc 100644 --- a/app/views/shared/menu/_alert.html.haml +++ b/app/views/shared/menu/_alert.html.haml @@ -1,4 +1,4 @@ .text-center.page-alert.fixed{ "ofn-page-alert" => true } .alert-box = render 'shared/page_alert' - %a.close{ ng: { click: "close()" } } × + %a.close{ "ng-click": "close()" } × diff --git a/app/views/shared/menu/_cart_sidebar.html.haml b/app/views/shared/menu/_cart_sidebar.html.haml index 423d4585cd..16c057888f 100644 --- a/app/views/shared/menu/_cart_sidebar.html.haml +++ b/app/views/shared/menu/_cart_sidebar.html.haml @@ -1,5 +1,5 @@ -.expanding-sidebar.cart-sidebar{ng: {controller: 'CartCtrl', class: "{'shown': showCartSidebar}"}} - .background{ng: {click: 'toggleCartSidebar()'}} +.expanding-sidebar.cart-sidebar{ "ng-controller": 'CartCtrl', "ng-class": "{'shown': showCartSidebar}" } + .background{ "ng-click": 'toggleCartSidebar()' } .sidebar = cache_with_locale "cart-header" do .cart-header @@ -7,7 +7,7 @@ = t('.items_in_cart_singular', num: "{{ Cart.total_item_count() }}") %span.title{"ng-show" => "Cart.line_items.length > 1"} = t('.items_in_cart_plural', num: "{{ Cart.total_item_count() }}") - %a.close{ng: {click: 'toggleCartSidebar()'}} + %a.close{ "ng-click": 'toggleCartSidebar()' } = t('.close') %i.ofn-i_009-close @@ -40,7 +40,7 @@ %p = t('.cart_empty') - %a.go-shopping.button.large.bright{ng: {show: "#{show_shopping_cta?}", href: "{{ CurrentHub.hub.id ? '#{main_app.shop_path}' : '#{main_app.shops_path}' }}"}} + %a.go-shopping.button.large.bright{ "ng-show": "#{show_shopping_cta?}", "ng-href": "{{ CurrentHub.hub.id ? '#{main_app.shop_path}' : '#{main_app.shops_path}' }}" } = t('.take_me_shopping') .sidebar-footer{"ng-show" => "Cart.line_items.length > 0"} @@ -52,8 +52,8 @@ %div.fullwidth %a.edit-cart.button.large.dark.left{href: main_app.cart_path, "ng-disabled" => "Cart.dirty || Cart.empty()", "ng-class" => "{ dirty: Cart.dirty }"} - %div{ ng: { if: "Cart.dirty" } }= t(:cart_updating) - %div{ ng: { if: "!Cart.dirty && Cart.empty()" } }= t(:cart_empty) - %div{ ng: { if: "!Cart.dirty && !Cart.empty()" } }= t('.edit_cart') + %div{ "ng-if": "Cart.dirty" }= t(:cart_updating) + %div{ "ng-if": "!Cart.dirty && Cart.empty()" }= t(:cart_empty) + %div{ "ng-if": "!Cart.dirty && !Cart.empty()" }= t('.edit_cart') %a.checkout.button.large.bright.right{href: main_app.checkout_path, "ng-disabled" => "Cart.dirty || Cart.empty()"} = t '.checkout' diff --git a/app/views/shared/menu/_mobile_menu.html.haml b/app/views/shared/menu/_mobile_menu.html.haml index 0e25ee57b0..544cb65631 100644 --- a/app/views/shared/menu/_mobile_menu.html.haml +++ b/app/views/shared/menu/_mobile_menu.html.haml @@ -14,7 +14,7 @@ %section.right{"ng-cloak" => true} %span.cart-span{"ng-class" => "{ dirty: Cart.dirty || Cart.empty(), 'pure-dirty': Cart.dirty }"} - %a.icon{ng: {click: 'toggleCartSidebar()'}} + %a.icon{ "ng-click": 'toggleCartSidebar()' } %span = t '.cart' %span.count diff --git a/app/views/shared/menu/_offcanvas_menu.html.haml b/app/views/shared/menu/_offcanvas_menu.html.haml index 8c6456c647..967c854acd 100644 --- a/app/views/shared/menu/_offcanvas_menu.html.haml +++ b/app/views/shared/menu/_offcanvas_menu.html.haml @@ -1,4 +1,4 @@ -%aside.left-off-canvas-menu.show-for-medium-down{ ng: { controller: "OffcanvasCtrl" } } +%aside.left-off-canvas-menu.show-for-medium-down{ "ng-controller": "OffcanvasCtrl" } %ul.off-canvas-list = cache_with_locale [ContentConfig.cache_key, @white_label_logo] do %li.ofn-logo diff --git a/app/views/shop/products/_filters.html.haml b/app/views/shop/products/_filters.html.haml index 869b215c60..8a929af886 100644 --- a/app/views/shop/products/_filters.html.haml +++ b/app/views/shop/products/_filters.html.haml @@ -1,6 +1,6 @@ = cache_with_locale do - .filter-shopfront.taxon-selectors{ng: {show: 'supplied_taxons != null'}} + .filter-shopfront.taxon-selectors{ "ng-show": 'supplied_taxons != null' } %filter-selector{ 'selector-set' => "taxonSelectors", objects: "supplied_taxons", "active-selectors" => "activeTaxons"} - .filter-shopfront.property-selectors{ng: {show: 'supplied_properties != null'}} + .filter-shopfront.property-selectors{ "ng-show": 'supplied_properties != null' } %filter-selector{ 'selector-set' => "propertySelectors", objects: "supplied_properties", "active-selectors" => "activeProperties"} diff --git a/app/views/shop/products/_form.html.haml b/app/views/shop/products/_form.html.haml index e5a51a50cc..b40ea8255b 100644 --- a/app/views/shop/products/_form.html.haml +++ b/app/views/shop/products/_form.html.haml @@ -31,22 +31,22 @@ .sticky-shop-filters-container.thin-scroll-bar.hide-for-medium-down.large-2.columns %h5.filter-header = t(:products_filter_by) - %span{ng: {show: 'filtersCount()' }} + %span{ "ng-show": 'filtersCount()' } = "({{ filtersCount() }} #{t(:products_filter_selected)})" = render partial: "shop/products/filters" - .expanding-sidebar.shop-filters-sidebar.hide-for-large-up{ng: {show: 'showFilterSidebar', class: "{'shown': showFilterSidebar}"}} - .background{ng: {click: 'toggleFilterSidebar()'}} + .expanding-sidebar.shop-filters-sidebar.hide-for-large-up{ "ng-show": 'showFilterSidebar', "ng-class": "{'shown': showFilterSidebar}" } + .background{ "ng-click": 'toggleFilterSidebar()' } .sidebar %h5 = t(:products_filter_by) - %span{ng: {show: 'filtersCount()' }} + %span{ "ng-show": 'filtersCount()' } = "({{ filtersCount() }} #{t(:products_filter_selected)})" = render partial: "shop/products/filters" .sidebar-footer - %button.large.dark.left{type: 'button', ng: {click: 'clearFilters()'}} + %button.large.dark.left{ type: 'button', "ng-click": 'clearFilters()' } = t(:products_filter_clear) - %button.large.bright.right{type: 'button', ng: {click: 'toggleFilterSidebar()'}} + %button.large.bright.right{ type: 'button', "ng-click": 'toggleFilterSidebar()' } = t(:products_filter_done) diff --git a/app/views/shop/products/_search_feedback.haml b/app/views/shop/products/_search_feedback.haml index 3245c6bb50..eb71015376 100644 --- a/app/views/shop/products/_search_feedback.haml +++ b/app/views/shop/products/_search_feedback.haml @@ -10,7 +10,7 @@ %span.filter-label = t :products_results_for - %span{ ng: { hide: "!query"} } + %span{ "ng-hide": "!query" } %span.applied-search {{ query }} = render partial: 'shop/products/applied_filters_feedback' @@ -21,5 +21,5 @@ %p.no-results = t :products_no_results_html, query: "{{query}}".html_safe = render partial: 'shop/products/applied_filters_feedback' - %button.clear-search{type: 'button', ng: {click: 'clearAll()'}} + %button.clear-search{ type: 'button', "ng-click": 'clearAll()' } = t :products_clear_search diff --git a/app/views/shop/products/_searchbar.haml b/app/views/shop/products/_searchbar.haml index b7e6f98d57..d1f2b65879 100644 --- a/app/views/shop/products/_searchbar.haml +++ b/app/views/shop/products/_searchbar.haml @@ -8,11 +8,11 @@ placeholder: t(:products_search), "ng-debounce" => "200", "disable-enter-with-blur" => true} - %a.clear{type: 'button', ng: {show: 'query', click: 'clearQuery()'}, 'focus-search' => true} + %a.clear{ type: 'button', "focus-search": true, "ng-show": 'query', "ng-click": 'clearQuery()' } = image_pack_tag "icn-close.png" .hide-for-large-up - %button{type: 'button', ng: {click: 'toggleFilterSidebar()'}} + %button{ type: 'button', "ng-click": 'toggleFilterSidebar()' } = t(:products_filter_heading) - %span{ng: {show: 'filtersCount()' }} + %span{ "ng-show": 'filtersCount()' } ({{ filtersCount() }}) diff --git a/app/views/shop/products/_shop_variant_no_group_buy.html.haml b/app/views/shop/products/_shop_variant_no_group_buy.html.haml index c2f3e4131c..20fbb09901 100644 --- a/app/views/shop/products/_shop_variant_no_group_buy.html.haml +++ b/app/views/shop/products/_shop_variant_no_group_buy.html.haml @@ -1,23 +1,20 @@ = cache_with_locale do .small-5.medium-3.large-3.columns.variant-quantity-column.text-right{"ng-if" => "::!variant.product.group_buy"} - .variant-quantity-inputs{ng: {if: "variant.line_item.quantity == 0"}} - %button.add-variant{type: "button", ng: {click: "add(1)", disabled: "!canAdd(1)"}} + .variant-quantity-inputs{ "ng-if": "variant.line_item.quantity == 0" } + %button.add-variant{ type: "button", "ng-click": "add(1)", "ng-disabled": "!canAdd(1)" } {{ "js.shopfront.variant.add_to_cart" | t }} - .variant-quantity-inputs{ng: {if: "variant.line_item.quantity != 0"}} - %button.variant-quantity{type: "button", ng: {click: "add(-1)", disabled: "!canAdd(-1)"}}> + .variant-quantity-inputs{ "ng-if": "variant.line_item.quantity != 0" } + %button.variant-quantity{ type: "button", "ng-click": "add(-1)", "ng-disabled": "!canAdd(-1)" }> -# U+FF0D Fullwidth Hyphen-Minus - - %input.variant-quantity{ type: "number", min: "0", max: "{{ available() }}", - ng: {model: "variant.line_item.quantity", max: "Infinity"}}> - %button.variant-quantity{type: "button", ng: {click: "add(1)", disabled: "!canAdd(1)"}} + %input.variant-quantity{ type: "number", min: "0", max: "{{ available() }}", "ng-model": "variant.line_item.quantity", "ng-max": "Infinity" }> + %button.variant-quantity{ type: "button", "ng-click": "add(1)", "ng-disabled": "!canAdd(1)" } -# U+FF0B Fullwidth Plus Sign + - .variant-remaining-stock{ng: {if: "displayRemainingInStock()"}} + .variant-remaining-stock{ "ng-if": "displayRemainingInStock()" } {{ "js.shopfront.variant.remaining_in_stock" | t:{quantity: available()} }} - .variant-quantity-display{ng: {class: "{visible: variant.line_item.quantity}"}} + .variant-quantity-display{ "ng-class": "{visible: variant.line_item.quantity}" } {{ "js.shopfront.variant.quantity_in_cart" | t:{quantity: variant.line_item.quantity || 0} }} - %input{type: :hidden, - name: "variants[{{::variant.id}}]", - ng: {model: "variant.line_item.quantity"}} + %input{ type: :hidden, name: "variants[{{::variant.id}}]", "ng-model": "variant.line_item.quantity" } diff --git a/app/views/shop/products/_shop_variant_with_group_buy.html.haml b/app/views/shop/products/_shop_variant_with_group_buy.html.haml index fc5c6533b3..50b4812e5c 100644 --- a/app/views/shop/products/_shop_variant_with_group_buy.html.haml +++ b/app/views/shop/products/_shop_variant_with_group_buy.html.haml @@ -1,18 +1,14 @@ = cache_with_locale do .small-5.medium-3.large-3.columns.variant-quantity-column.text-right{"ng-if" => "::variant.product.group_buy"} - %button.add-variant{type: "button", ng: {if: "!variant.line_item.quantity", click: "addBulk(1)", disabled: "!canAdd(1)"}} + %button.add-variant{ type: "button", "ng-if": "!variant.line_item.quantity", "ng-click": "addBulk(1)", "ng-disabled": "!canAdd(1)" } {{ "js.shopfront.variant.add_to_cart" | t }} - %button.bulk-buy.variant-quantity{type: "button", ng: {if: "variant.line_item.quantity", click: "addBulk(0)"}}> + %button.bulk-buy.variant-quantity{ type: "button", "ng-if": "variant.line_item.quantity", "ng-click": "addBulk(0)" }> {{ variant.line_item.quantity }} - %button.bulk-buy.variant-quantity{type: "button", ng: {if: "variant.line_item.quantity", click: "addBulk(0)"}} + %button.bulk-buy.variant-quantity{ type: "button", "ng-if": "variant.line_item.quantity", "ng-click": "addBulk(0)" } {{ variant.line_item.max_quantity || "-" }} %br - .variant-quantity-display{ng: {class: "{visible: variant.line_item.quantity}"}} + .variant-quantity-display{ "ng-class": "{visible: variant.line_item.quantity}" } {{ "js.shopfront.variant.in_cart" | t }} - %input{type: :hidden, - name: "variants[{{::variant.id}}]", - ng: {model: "variant.line_item.quantity"}} - %input{type: :hidden, - name: "variants[{{::variant.id}}]", - ng: {model: "variant.line_item.max_quantity"}} + %input{ type: :hidden, name: "variants[{{::variant.id}}]", "ng-model": "variant.line_item.quantity" } + %input{ type: :hidden, name: "variants[{{::variant.id}}]", "ng-model": "variant.line_item.max_quantity" } diff --git a/app/views/shop/products/_summary.html.haml b/app/views/shop/products/_summary.html.haml index da625de3ee..8163d6e903 100644 --- a/app/views/shop/products/_summary.html.haml +++ b/app/views/shop/products/_summary.html.haml @@ -10,7 +10,7 @@ %h3 %a{"ng-click" => "triggerProductModal()", href: 'javascript:void(0)'} %span{"ng-bind" => "::product.name"} - .product-description{ng: {"bind-html": "::product.description_html", click: "triggerProductModal()", show: "product.description_html.length"}, "data-controller": "add-blank-to-link"} + .product-description{ "data-controller": "add-blank-to-link", "ng-bind-html": "::product.description_html", "ng-click": "triggerProductModal()", "ng-show": "product.description_html.length" } %div{ "ng-switch" => "enterprise.visible" } .product-producer = t :products_from diff --git a/app/views/shops/_hubs.html.haml b/app/views/shops/_hubs.html.haml index 23410b2505..5b9e1d3792 100644 --- a/app/views/shops/_hubs.html.haml +++ b/app/views/shops/_hubs.html.haml @@ -27,12 +27,12 @@ %a{href: "", "ng-click" => "showDistanceMatches()"} = t :hubs_distance_filter, location: "{{ nameMatchesFiltered[0].name }}" .more-controls - %span{ng: {show: "closed_shops_loading", cloak: true}} + %span{ "ng-show": "closed_shops_loading", "ng-cloak": true } = render partial: "components/spinner" - %span{ng: {if: "!show_closed", cloak: true}} - %a.button{href: "", ng: {click: "showClosedShops()"}} + %span{ "ng-if": "!show_closed", "ng-cloak": true } + %a.button{ href: "", "ng-click": "showClosedShops()" } = t '.show_closed_shops' - %span{ng: {if: "show_closed", cloak: true}} - %a.button{href: "", ng: {click: "hideClosedShops()"}} + %span{ "ng-if": "show_closed", "ng-cloak": true } + %a.button{ href: "", "ng-click": "hideClosedShops()" } = t '.hide_closed_shops' %a.button{href: main_app.map_path}= t '.show_on_map' diff --git a/app/views/shops/_skinny.html.haml b/app/views/shops/_skinny.html.haml index 33a2106fd5..2599bd7881 100644 --- a/app/views/shops/_skinny.html.haml +++ b/app/views/shops/_skinny.html.haml @@ -2,7 +2,7 @@ .row.active_table_row{"ng-if" => "hub.is_distributor", "ng-click" => "toggle($event)", "ng-class" => "{'closed' : !open(), 'is_distributor' : producer.is_distributor}"} .columns.small-12.medium-5.large-5.skinny-head %a.hub{"ng-href" => "{{::hub.path}}", "ng-attr-target" => "{{ embedded_layout ? '_blank' : undefined}}", "ng-class" => "{primary: hub.active, secondary: !hub.active}", "ofn-change-hub" => "hub", "data-is-link" => "true"} - %i{ng: {class: "::hub.icon_font"}} + %i{ "ng-class": "::hub.icon_font" } %span.margin-top.hub-name-listing{"ng-bind" => "::hub.name | truncate:40"} .columns.small-4.medium-2.large-2 @@ -13,9 +13,9 @@ .columns.small-5.medium-3.large-3.text-right.no-wrap.flex.flex-align-center.flex-justify-end{"ng-if" => "::hub.active"} %a.hub.open_closed.flex.flex-align-center{"ng-href" => "{{::hub.path}}", "ng-attr-target" => "{{ embedded_layout ? '_blank' : undefined}}", "ng-class" => "{primary: hub.active, secondary: !hub.active}", "ofn-change-hub" => "hub"} - %span{ ng: { if: "::current()" } } + %span{ "ng-if": "::current()" } %em= t :hubs_shopping_here - %span{ ng: { if: "::!current()" } } + %span{ "ng-if": "::!current()" } %span{"ng-bind" => "::hub.orders_close_at | sensible_timeframe"} %i.ofn-i_068-shop-reversed.show-for-medium-up %span{style: "margin-left: 0.5rem;"} @@ -23,9 +23,9 @@ .columns.small-5.medium-3.large-3.text-right.no-wrap.flex.flex-align-center.flex-justify-end{"ng-if" => "::!hub.active"} %a.hub.open_closed.flex{"ng-href" => "{{::hub.path}}", "ng-attr-target" => "{{ embedded_layout ? '_blank' : undefined}}", "ng-class" => "{primary: hub.active, secondary: !hub.active}", "ofn-change-hub" => "hub"} - %span{ ng: { if: "::current()" } } + %span{ "ng-if": "::current()" } %em= t :hubs_shopping_here - %span{ ng: { if: "::!current()" } } + %span{ "ng-if": "::!current()" } = t :hubs_orders_closed %i.ofn-i_068-shop-reversed.show-for-medium-up %span{style: "margin-left: 0.5rem;"} @@ -34,7 +34,7 @@ .row.active_table_row{"ng-if" => "!hub.is_distributor", "ng-class" => "closed"} .columns.small-12.medium-6.large-5.skinny-head %a.hub{"ng-click" => "openModal(hub)", "ng-class" => "{primary: hub.active, secondary: !hub.active}"} - %i{ng: {class: "hub.icon_font"}} + %i{ "ng-class": "hub.icon_font" } %span.hub-name-listing{"ng-bind" => "::hub.name | truncate:40"} .columns.small-4.medium-2.large-2 @@ -43,5 +43,5 @@ %span.ellipsed{"ng-bind" => "::hub.address.state_name"} .columns.small-6.medium-3.large-4.text-right.no-wrap.flex.flex-align-center.flex-justify-end - %span{ ng: { if: "::!current()" } } + %span{ "ng-if": "::!current()" } %em= t :hubs_profile_only diff --git a/app/views/spree/admin/general_settings/edit.html.haml b/app/views/spree/admin/general_settings/edit.html.haml index 5c938419e6..f4c8c813a2 100644 --- a/app/views/spree/admin/general_settings/edit.html.haml +++ b/app/views/spree/admin/general_settings/edit.html.haml @@ -79,7 +79,7 @@ %fieldset.available_units.no-border-bottom %legend{:align => "center"}= t('admin.available_units') .field - - available_units = Spree::Config[:available_units].split(",") + - available_units = CurrentConfig.get(:available_units).split(",") - all_units.each do |unit| - selected = available_units.include?(unit) = preference_field_tag("available_units[#{unit}]", selected, { type: :boolean, selected: selected }) diff --git a/app/views/spree/admin/orders/_bulk_actions.html.haml b/app/views/spree/admin/orders/_bulk_actions.html.haml index 7616334c1f..74c032ed55 100644 --- a/app/views/spree/admin/orders/_bulk_actions.html.haml +++ b/app/views/spree/admin/orders/_bulk_actions.html.haml @@ -3,23 +3,22 @@ %span{ "data-controller": "checked-feedback", "data-checked-feedback-translation-value": "spree.admin.orders.index.selected" } = t("spree.admin.orders.index.selected", count: 0) - %div.plain.ofn-drop-down.disabled{ "data-checked-target": "disable", "data-controller": "dropdown", "data-action": "click->dropdown#toggle" } - %span{ class: 'icon-reorder' } - ="#{t('admin.actions')}".html_safe - %span - %i{ "data-dropdown-target": "arrow", "data-expanded-class": "icon-caret-up", "data-collapsed-class": "icon-caret-down" } - - %div.menu{ "data-dropdown-target": "menu" } - %div.menu_item - %span.name{ "data-controller": "modal-link", "data-action": "click->modal-link#open", "data-modal-link-target-value": "resend_confirmation" } - = t('spree.admin.orders.index.resend_confirmation') - - if Spree::Config[:enable_invoices?] + %div.plain.ofn-drop-down.disabled{ "data-checked-target": "disable" } + %details{"data-controller": "dropdown"} + %summary + %span.icon-reorder + ="#{t('admin.actions')}".html_safe + %div.menu{"data-action": "click->dropdown#closeOnMenu"} %div.menu_item - %span.name{ "data-controller": "modal-link", "data-action": "click->modal-link#open", "data-modal-link-target-value": "send_invoice" } - = t('spree.admin.orders.index.send_invoice') + %span.name{ "data-controller": "modal-link", "data-action": "click->modal-link#open", "data-modal-link-target-value": "resend_confirmation" } + = t('spree.admin.orders.index.resend_confirmation') + - if Spree::Config[:enable_invoices?] + %div.menu_item + %span.name{ "data-controller": "modal-link", "data-action": "click->modal-link#open", "data-modal-link-target-value": "send_invoice" } + = t('spree.admin.orders.index.send_invoice') + %div.menu_item + %span.name{ "data-controller": "bulk-actions", "data-action": "click->bulk-actions#perform", "data-bulk-actions-reflex-value": "Admin::Orders#bulk_invoice" } + = t('spree.admin.orders.index.print_invoices') %div.menu_item - %span.name{ "data-controller": "bulk-actions", "data-action": "click->bulk-actions#perform", "data-bulk-actions-reflex-value": "Admin::Orders#bulk_invoice" } - = t('spree.admin.orders.index.print_invoices') - %div.menu_item - %span.name{ "data-controller": "modal-link", "data-action": "click->modal-link#open", "data-modal-link-target-value": "cancel_orders" } - = t('spree.admin.orders.index.cancel_orders') + %span.name{ "data-controller": "modal-link", "data-action": "click->modal-link#open", "data-modal-link-target-value": "cancel_orders" } + = t('spree.admin.orders.index.cancel_orders') diff --git a/app/views/spree/admin/orders/_invoice_table4.html.haml b/app/views/spree/admin/orders/_invoice_table4.html.haml index a19f7aa20c..5382d3d8ce 100644 --- a/app/views/spree/admin/orders/_invoice_table4.html.haml +++ b/app/views/spree/admin/orders/_invoice_table4.html.haml @@ -32,7 +32,7 @@ %td{:align => "right"} = item.display_amount_with_adjustments_without_taxes %td{:align => "right"} - = item.display_line_item_tax_rates + = @order.display_line_item_tax_rate(item) %td{:align => "right"} = item.display_amount_with_adjustments_and_with_taxes %tr diff --git a/app/views/spree/admin/orders/bulk_management.html.haml b/app/views/spree/admin/orders/bulk_management.html.haml index 4216df3732..15053c326f 100644 --- a/app/views/spree/admin/orders/bulk_management.html.haml +++ b/app/views/spree/admin/orders/bulk_management.html.haml @@ -12,33 +12,33 @@ = admin_inject_column_preferences module: 'admin.lineItems' = admin_inject_available_units -%div{ ng: { controller: 'LineItemsCtrl' }, id: "table-filter" } +%div{ id: "table-filter", "ng-controller": 'LineItemsCtrl' } %fieldset %save-bar{ dirty: "bulk_order_form.$dirty", persist: "false" } - %input.red{ type: "button", value: "Save Changes", ng: { click: "submit()", disabled: "!bulk_order_form.$dirty" } } + %input.red{ type: "button", value: "Save Changes", "ng-click": "submit()", "ng-disabled": "!bulk_order_form.$dirty" } %legend{ align: 'center'}= t(:search) %div{ :class => "sixteen columns alpha" } .quick_search.three.columns.alpha %label{ for: 'quick_filter' } %br - %input.quick-search.fullwidth{ ng: {model: 'query'}, name: "quick_filter", type: 'text', placeholder: t('admin.quick_search'), "ng-keypress" => "$event.keyCode === 13 && fetchResults()" } + %input.quick-search.fullwidth{ name: "quick_filter", type: 'text', placeholder: t('admin.quick_search'), "ng-keypress": "$event.keyCode === 13 && fetchResults()", "ng-model": 'query' } .one.columns   .filter_select{ :class => "three columns" } %label{ :for => 'supplier_filter' } = t("admin.producer") %br - %input#supplier_filter.ofn-select2.fullwidth{ type: 'number', 'min-search' => 5, data: 'suppliers', placeholder: "#{t(:all)}", blank: "{ id: '', name: '#{t(:all)}' }", on: { selecting: "confirmRefresh" }, ng: { model: 'supplierFilter' } } + %input#supplier_filter.ofn-select2.fullwidth{ type: 'number', "min-search": 5, data: 'suppliers', placeholder: "#{t(:all)}", blank: "{ id: '', name: '#{t(:all)}' }", "on-selecting": "confirmRefresh", "ng-model": 'supplierFilter' } .filter_select{ :class => "three columns" } %label{ :for => 'distributor_filter' } = t("admin.shop") %br - %input#distributor_filter.ofn-select2.fullwidth{ type: 'number', 'min-search' => 5, data: 'distributors', placeholder: "#{t(:all)}", blank: "{ id: '', name: '#{t(:all)}' }", on: { selecting: "confirmRefresh" }, ng: { model: 'distributorFilter' } } + %input#distributor_filter.ofn-select2.fullwidth{ type: 'number', "min-search": 5, data: 'distributors', placeholder: "#{t(:all)}", blank: "{ id: '', name: '#{t(:all)}' }", "on-selecting": "confirmRefresh", "ng-model": 'distributorFilter' } .filter_select{ :class => "three columns" } %label{ :for => 'order_cycle_filter' } = t("admin.order_cycle") %br - %input#order_cycle_filter.ofn-select2.fullwidth{ type: 'number', 'min-search' => 5, data: 'orderCycles', placeholder: "#{t(:all)}", blank: "{ id: '', name: '#{t(:all)}' }", on: { selecting: "confirmRefresh" }, ng: { model: 'orderCycleFilter' } } + %input#order_cycle_filter.ofn-select2.fullwidth{ type: 'number', "min-search": 5, data: 'orderCycles', placeholder: "#{t(:all)}", blank: "{ id: '', name: '#{t(:all)}' }", "on-selecting": "confirmRefresh", "ng-model": 'orderCycleFilter' } .date_filter{class: "three columns"} %label = t("date_range") @@ -55,9 +55,9 @@ %a.button{'ng-click' => 'resetSelectFilters()', "id": "clear_filters_button" } = t(:clear_filters) - %hr.divider.sixteen.columns.alpha.omega{ ng: { show: 'unitsVariantSelected()' } } + %hr.divider.sixteen.columns.alpha.omega{ "ng-show": 'unitsVariantSelected()' } - %div.sixteen.columns.alpha.omega#group_buy_calculation{ ng: { show: 'unitsVariantSelected()', cloak: true } } + %div.sixteen.columns.alpha.omega#group_buy_calculation{ "ng-show": 'unitsVariantSelected()', "ng-cloak": true } .one.columns.alpha .shared_resource.four.columns.alpha %input{ type: 'checkbox', :id => 'shared_resource', 'ng-model' => 'sharedResource'} @@ -102,7 +102,7 @@ %hr.divider.sixteen.columns.alpha.omega .clear - %div{ ng: { hide: 'RequestMonitor.loading || line_items.length == 0' }, style: "display: flex; justify-content: flex-start; column-gap: 10px; margin-bottom: 15px" } + %div{ style: "display: flex; justify-content: flex-start; column-gap: 10px; margin-bottom: 15px", "ng-hide": 'RequestMonitor.loading || line_items.length == 0' } -# This -20px is a hack to make the dropdowns align properly %div{ style: "margin-right: -20px;" } = render 'admin/shared/bulk_actions_dropdown' @@ -118,15 +118,15 @@ %h1 = t("admin.orders.bulk_management.loading") - %div{ class: "sixteen columns alpha", ng: { show: '!RequestMonitor.loading && filteredLineItems.length == 0', cloak: true } } + %div{ class: "sixteen columns alpha", "ng-show": '!RequestMonitor.loading && filteredLineItems.length == 0', "ng-cloak": true } %h1#no_results = t("admin.orders.bulk_management.no_results") - .margin-bottom-50{ ng: { hide: 'RequestMonitor.loading || filteredLineItems.length == 0', cloak: true } } + .margin-bottom-50{ "ng-hide": 'RequestMonitor.loading || filteredLineItems.length == 0', "ng-cloak": true } %form{ name: 'bulk_order_form' } - %table.index#listing_orders.bulk{ :class => "sixteen columns alpha", ng: { show: "initialized" } } + %table.index#listing_orders.bulk{ class: "sixteen columns alpha", "ng-show": "initialized" } %thead - %tr{ ng: { controller: "ColumnsCtrl" } } + %tr{ "ng-controller": "ColumnsCtrl" } %th.bulk %input{ :type => "checkbox", :name => 'toggle_bulk', 'ng-click' => 'toggleAllCheckboxes()', 'ng-checked' => "allBoxesChecked()" } %th.order_no{ 'ng-show' => 'columns.order_no.visible' } @@ -166,7 +166,7 @@ = "#{t('admin.price')} (#{Spree::Money.currency_symbol})" %th.actions - %tr.line_item{ ng: { repeat: "line_item in filteredLineItems = ( line_items | orderBy:sorting.predicate:sorting.reverse )", 'class-even' => "'even'", 'class-odd' => "'odd'", attr: { id: "li_{{line_item.id}}" } } } + %tr.line_item{ "ng-repeat": "line_item in filteredLineItems = ( line_items | orderBy:sorting.predicate:sorting.reverse )", "ng-class-even": "'even'", "ng-class-odd": "'odd'", "ng-attr-id": "li_{{line_item.id}}" } %td.bulk %input{ :type => "checkbox", :name => 'bulk', 'ng-model' => 'line_item.checked', 'ignore-dirty' => true } %td.order_no{ 'ng-show' => 'columns.order_no.visible' } {{ line_item.order.number }} @@ -180,17 +180,17 @@ %td.variant{ 'ng-show' => 'columns.variant.visible' } %a{ :href => '#', 'ng-click' => "setSelectedUnitsVariant(line_item.units_product,line_item.units_variant)" } {{ line_item.units_variant.full_name }} %td.quantity{ 'ng-show' => 'columns.quantity.visible' } - %input.show-dirty{ :type => 'number', :name => 'quantity', :id => 'quantity', ng: { model: "line_item.quantity", change: "updateOnQuantity(line_item)", required: "true", class: '{"update-error": line_item.errors.quantity}' }, min: 1, step: 1 } - %span.error{ ng: { bind: 'line_item.errors.quantity' } } + %input.show-dirty{ type: 'number', name: 'quantity', id: 'quantity', min: 1, step: 1, "ng-model": "line_item.quantity", "ng-change": "updateOnQuantity(line_item)", "ng-required": "true", "ng-class": '{"update-error": line_item.errors.quantity}' } + %span.error{ "ng-bind": 'line_item.errors.quantity' } %td.max{ 'ng-show' => 'columns.max.visible' } {{ line_item.max_quantity }} %td.final_weight_volume{ 'ng-show' => 'columns.final_weight_volume.visible' } - %input.show-dirty{ type: 'number', step: 'any', :name => 'final_weight_volume', :id => 'final_weight_volume', ng: { model: "line_item.final_weight_volume", readonly: "unitValueLessThanZero(line_item)", change: "weightAdjustedPrice(line_item)", required: "true", class: '{"update-error": line_item.errors.final_weight_volume}' }, min: 0, 'ng-pattern' => '/[0-9]*[.]?[0-9]+/' } - %span.error{ ng: { bind: 'line_item.errors.final_weight_volume' } } + %input.show-dirty{ type: 'number', step: 'any', name: 'final_weight_volume', id: 'final_weight_volume', min: 0, "ng-pattern": '/[0-9]*[.]?[0-9]+/', "ng-model": "line_item.final_weight_volume", "ng-readonly": "unitValueLessThanZero(line_item)", "ng-change": "weightAdjustedPrice(line_item)", "ng-required": "true", "ng-class": '{"update-error": line_item.errors.final_weight_volume}' } + %span.error{ "ng-bind": 'line_item.errors.final_weight_volume' } %td.price{ 'ng-show' => 'columns.price.visible' } - %input.show-dirty{ :type => 'text', :name => 'price', :id => 'price', :ng => { value: 'line_item.price * line_item.quantity | currency:""', readonly: "true", class: '{"update-error": line_item.errors.price}' } } - %span.error{ ng: { bind: 'line_item.errors.price' } } + %input.show-dirty{ type: 'text', name: 'price', id: 'price', "ng-value": 'line_item.price * line_item.quantity | currency:""', "ng-readonly": "true", "ng-class": '{"update-error": line_item.errors.price}' } + %span.error{ "ng-bind": 'line_item.errors.price' } %td.actions - %a{ ng: { href: "/admin/orders/{{line_item.order.number}}/edit" }, :class => "edit-order icon-edit no-text", 'confirm-link-click' => 'confirmRefresh()' } + %a{ class: "edit-order icon-edit no-text", "confirm-link-click": 'confirmRefresh()', "ng-href": "/admin/orders/{{line_item.order.number}}/edit" } %td.actions %a{ 'ng-click' => "deleteLineItem(line_item)", :class => "delete-line-item icon-trash no-text" } diff --git a/app/views/spree/admin/orders/edit.html.haml b/app/views/spree/admin/orders/edit.html.haml index c74f2e6bcb..eb10841bbc 100644 --- a/app/views/spree/admin/orders/edit.html.haml +++ b/app/views/spree/admin/orders/edit.html.haml @@ -5,7 +5,7 @@ - content_for :page_actions do - if can?(:fire, @order) - %li= event_links + %li= event_links(@order) = render partial: 'spree/admin/shared/order_links' - if can?(:admin, Spree::Order) %li diff --git a/app/views/spree/admin/payment_methods/_providers.html.haml b/app/views/spree/admin/payment_methods/_providers.html.haml index b25a7b09c5..15bd4ef979 100644 --- a/app/views/spree/admin/payment_methods/_providers.html.haml +++ b/app/views/spree/admin/payment_methods/_providers.html.haml @@ -1,4 +1,4 @@ -#provider-settings{ ng: { controller: "ProvidersCtrl" } } +#provider-settings{ "ng-controller": "ProvidersCtrl" } .row .alpha.four.columns = label :payment_method, :type, t('.provider') diff --git a/app/views/spree/admin/payment_methods/_stripe_connect.html.haml b/app/views/spree/admin/payment_methods/_stripe_connect.html.haml index bc3ba014b4..28f1ad8f66 100644 --- a/app/views/spree/admin/payment_methods/_stripe_connect.html.haml +++ b/app/views/spree/admin/payment_methods/_stripe_connect.html.haml @@ -1,40 +1,37 @@ %fieldset.no-border-bottom#gateway_fields %legend{ align: "center"} = t(:provider_settings) - .preference-settings{ ng: { controller: "StripeController" } } + .preference-settings{ "ng-controller": "StripeController" } = fields_for :payment_method, @payment_method do |payment_method_form| .row .alpha.four.columns = payment_method_form.label :stripe_account_owner .omega.twelve.columns - if @stripe_account_holder.nil? || spree_current_user.enterprises.include?(@stripe_account_holder) - %input.ofn-select2.fullwidth#payment_method_preferred_enterprise_id{ type: 'number', - name: 'payment_method[preferred_enterprise_id]', - placeholder: t(".enterprise_select_placeholder"), - data: 'shops', ng: { model: 'paymentMethod.preferred_enterprise_id' } } + %input.ofn-select2.fullwidth#payment_method_preferred_enterprise_id{ type: 'number', name: 'payment_method[preferred_enterprise_id]', placeholder: t(".enterprise_select_placeholder"), data: 'shops', "ng-model": 'paymentMethod.preferred_enterprise_id' } - else %strong= Enterprise.find_by(id: @payment_method)&.name - #stripe-account-status{ ng: { show: "paymentMethod.preferred_enterprise_id" } } - .alert-box.warning{ ng: { hide: "stripe_account.status" } } + #stripe-account-status{ "ng-show": "paymentMethod.preferred_enterprise_id" } + .alert-box.warning{ "ng-hide": "stripe_account.status" } = t(".loading_account_information_msg") - .alert-box.error{ ng: { show: "stripe_account.status == 'stripe_disabled'" } } + .alert-box.error{ "ng-show": "stripe_account.status == 'stripe_disabled'" } = t(".stripe_disabled_msg") - .alert-box.error{ ng: { show: "stripe_account.status == 'request_failed'" } } + .alert-box.error{ "ng-show": "stripe_account.status == 'request_failed'" } = t(".request_failed_msg") - .alert-box.error{ ng: { show: "stripe_account.status == 'account_missing'" } } + .alert-box.error{ "ng-show": "stripe_account.status == 'account_missing'" } = t(".account_missing_msg") - %a.button{ ng: { href: "{{current_enterprise_stripe_path()}}" }, target: 'blank' } + %a.button{ target: 'blank', "ng-href": "{{current_enterprise_stripe_path()}}" } = t(".connect_one") %i.icon-chevron-right - .alert-box.error{ ng: { show: "stripe_account.status == 'access_revoked'" } } + .alert-box.error{ "ng-show": "stripe_account.status == 'access_revoked'" } = t(".access_revoked_msg") - .alert-box.ok{ ng: { show: "stripe_account.status == 'connected'" } } + .alert-box.ok{ "ng-show": "stripe_account.status == 'connected'" } .status %strong= t(".status") + ":" = t(".connected") diff --git a/app/views/spree/admin/payments/index.html.haml b/app/views/spree/admin/payments/index.html.haml index 98e00c102d..c3c52c2a23 100644 --- a/app/views/spree/admin/payments/index.html.haml +++ b/app/views/spree/admin/payments/index.html.haml @@ -20,5 +20,3 @@ - if @payments.any? = render partial: 'list', locals: { payments: @payments } -- else - .alpha.twelve.columns.no-objects-found= t(:order_has_no_payments) diff --git a/app/views/spree/admin/payments/paypal_refund.html.haml b/app/views/spree/admin/payments/paypal_refund.html.haml index 98641d05a2..7319be4dd3 100644 --- a/app/views/spree/admin/payments/paypal_refund.html.haml +++ b/app/views/spree/admin/payments/paypal_refund.html.haml @@ -18,8 +18,8 @@ %small %em= Spree.t(:original_amount, scope: 'paypal', amount: @payment.display_amount) %br/ - - symbol = ::Money.new(1, Spree::Config[:currency]).symbol - - if Spree::Config[:currency_symbol_position] == "before" + - symbol = ::Money.new(1, CurrentConfig.get(:currency)).symbol + - if CurrentConfig.get(:currency_symbol_position) == "before" = symbol = text_field_tag 'refund_amount', @payment.amount - else diff --git a/app/views/spree/admin/products/_form.html.haml b/app/views/spree/admin/products/_form.html.haml index 1bd362b7e7..1f3492c123 100644 --- a/app/views/spree/admin/products/_form.html.haml +++ b/app/views/spree/admin/products/_form.html.haml @@ -27,8 +27,6 @@ = f.text_field :variant_unit_name, {placeholder: t('admin.products.unit_name_placeholder')} = f.error_message_on :variant_unit_name - = render 'spree/admin/products/primary_taxon_form', f: f - = f.field_container :supplier do = f.label :supplier, t(:spree_admin_supplier) %br diff --git a/app/views/spree/admin/products/_primary_taxon_form.html.haml b/app/views/spree/admin/products/_primary_taxon_form.html.haml index e24f84a6a2..fa4b0b1976 100644 --- a/app/views/spree/admin/products/_primary_taxon_form.html.haml +++ b/app/views/spree/admin/products/_primary_taxon_form.html.haml @@ -1,6 +1,6 @@ = f.field_container :primary_taxon do - = f.label :primary_taxon, t('.product_category') + = f.label :primary_taxon_id, t('.product_category') %span.required * %br = f.collection_select(:primary_taxon_id, Spree::Taxon.order(:name), :id, :name, {:include_blank => true}, {:class => "select2 fullwidth"}) - = f.error_message_on :primary_taxon + = f.error_message_on :primary_taxon_id diff --git a/app/views/spree/admin/products/index.html.haml b/app/views/spree/admin/products/index.html.haml index b7c4a3853a..b78c73cb4f 100644 --- a/app/views/spree/admin/products/index.html.haml +++ b/app/views/spree/admin/products/index.html.haml @@ -2,7 +2,7 @@ = render 'spree/admin/products/index/data' = admin_inject_available_units -%div{ ng: { app: 'ofn.admin', controller: 'AdminProductEditCtrl', init: 'initialise()' } } +%div{ "ng-app": 'ofn.admin', "ng-controller": 'AdminProductEditCtrl', "ng-init": 'initialise()' } = render 'spree/admin/products/index/filters' %div{ 'ng-cloak' => true } diff --git a/app/views/spree/admin/products/index/_filters.html.haml b/app/views/spree/admin/products/index/_filters.html.haml index 98e186c7f1..57615eb09e 100644 --- a/app/views/spree/admin/products/index/_filters.html.haml +++ b/app/views/spree/admin/products/index/_filters.html.haml @@ -5,20 +5,20 @@ .quick_search.three.columns.alpha %label{ for: 'quick_filter' } %br - %input.quick-search.fullwidth{ ng: {model: 'q.query'}, name: "quick_filter", type: 'text', placeholder: t('admin.quick_search'), "ng-keypress" => "$event.keyCode === 13 && fetchProducts()" } + %input.quick-search.fullwidth{ name: "quick_filter", type: 'text', placeholder: t('admin.quick_search'), "ng-keypress": "$event.keyCode === 13 && fetchProducts()", "ng-model": 'q.query' } .one.columns   .filter_select.three.columns %label{ for: 'producer_filter' }= t 'producer' %br - %select.fullwidth{ id: 'producer_filter', 'ofn-select2-min-search' => 5, ng: {model: 'q.producerFilter', options: 'producer.id as producer.name for producer in producers'} } + %select.fullwidth{ id: 'producer_filter', "ofn-select2-min-search": 5, "ng-model": 'q.producerFilter', "ng-options": 'producer.id as producer.name for producer in producers' } .filter_select.three.columns %label{ for: 'category_filter' }= t 'category' %br - %select.fullwidth{ id: 'category_filter', 'ofn-select2-min-search' => 5, ng: {model: 'q.categoryFilter', options: 'taxon.id as taxon.name for taxon in taxons'} } + %select.fullwidth{ id: 'category_filter', "ofn-select2-min-search": 5, "ng-model": 'q.categoryFilter', "ng-options": 'taxon.id as taxon.name for taxon in taxons' } .filter_select.three.columns %label{ for: 'import_filter' }= t 'import_date' %br - %select.fullwidth{ id: 'import_date_filter', 'ofn-select2-min-search' => 5, ng: {model: 'q.importDateFilter', init: "importDates = #{@import_dates}; showLatestImport = #{@show_latest_import}", options: 'date.id as date.name for date in importDates'} } + %select.fullwidth{ id: 'import_date_filter', "ofn-select2-min-search": 5, "ng-model": 'q.importDateFilter', "ng-init": "importDates = #{@import_dates}; showLatestImport = #{@show_latest_import}", "ng-options": 'date.id as date.name for date in importDates' } .filter_clear.three.columns.omega %label{ for: 'clear_all_filters' } diff --git a/app/views/spree/admin/products/index/_products.html.haml b/app/views/spree/admin/products/index/_products.html.haml index e0c6d76a2b..58b1c4133e 100644 --- a/app/views/spree/admin/products/index/_products.html.haml +++ b/app/views/spree/admin/products/index/_products.html.haml @@ -1,7 +1,7 @@ %div.sixteen.columns.alpha{ 'ng-hide' => 'RequestMonitor.loading || products.length == 0' } %form{ name: 'bulk_product_form', autocomplete: "off" } %save-bar{ dirty: "bulk_product_form.$dirty", persist: "false" } - %input.red{ type: "button", value: t(:save_changes), ng: { click: "submitProducts()", disabled: "!bulk_product_form.$dirty" } } + %input.red{ type: "button", value: t(:save_changes), "ng-click": "submitProducts()", "ng-disabled": "!bulk_product_form.$dirty" } %input{ type: "button", value: t(:close), 'ng-click' => "cancel('#{admin_products_path}')" } %table.index#listing_products.bulk diff --git a/app/views/spree/admin/products/index/_products_head.html.haml b/app/views/spree/admin/products/index/_products_head.html.haml index 09de5a1114..9e6d7e7065 100644 --- a/app/views/spree/admin/products/index/_products_head.html.haml +++ b/app/views/spree/admin/products/index/_products_head.html.haml @@ -1,24 +1,24 @@ %colgroup %col.actions - %col.image{ ng: { show: 'columns.image.visible' } } - %col.producer{ ng: { show: 'columns.producer.visible' } } - %col.sku{ ng: { show: 'columns.sku.visible' } } - %col.name{ ng: { show: 'columns.name.visible' } } - %col.unit{ ng: { show: 'columns.unit.visible' } } - %col.display_as{ ng: { show: 'columns.unit.visible' } } - %col.price{ ng: { show: 'columns.price.visible'} } - %col.on_hand{ ng: { show: 'columns.on_hand.visible' } } - %col.on_demand{ ng: { show: 'columns.on_demand.visible' } } - %col.category{ ng: { show: 'columns.category.visible' } } - %col.tax_category{ ng: { show: 'columns.tax_category.visible' } } - %col.inherits_properties{ ng: { show: 'columns.inherits_properties.visible' } } - %col.import_date{ ng: { show: 'columns.import_date.visible' } } + %col.image{ "ng-show": 'columns.image.visible' } + %col.producer{ "ng-show": 'columns.producer.visible' } + %col.sku{ "ng-show": 'columns.sku.visible' } + %col.name{ "ng-show": 'columns.name.visible' } + %col.unit{ "ng-show": 'columns.unit.visible' } + %col.display_as{ "ng-show": 'columns.unit.visible' } + %col.price{ "ng-show": 'columns.price.visible' } + %col.on_hand{ "ng-show": 'columns.on_hand.visible' } + %col.on_demand{ "ng-show": 'columns.on_demand.visible' } + %col.category{ "ng-show": 'columns.category.visible' } + %col.tax_category{ "ng-show": 'columns.tax_category.visible' } + %col.inherits_properties{ "ng-show": 'columns.inherits_properties.visible' } + %col.import_date{ "ng-show": 'columns.import_date.visible' } %col.actions %col.actions %col.actions %thead - %tr{ ng: { controller: "ColumnsCtrl" } } + %tr{ "ng-controller": "ColumnsCtrl" } %th.left-actions %a{ 'ng-click' => 'toggleShowAllVariants()', :style => 'color: red; cursor: pointer' } = t(:expand_all) diff --git a/app/views/spree/admin/products/index/_products_product.html.haml b/app/views/spree/admin/products/index/_products_product.html.haml index 99ca44c24c..e399d64aa3 100644 --- a/app/views/spree/admin/products/index/_products_product.html.haml +++ b/app/views/spree/admin/products/index/_products_product.html.haml @@ -24,7 +24,6 @@ %td.on_demand{ 'ng-show' => 'columns.on_demand.visible' } %input.field{ 'ng-model' => 'product.on_demand', :name => 'on_demand', 'ofn-track-product' => 'on_demand', :type => 'checkbox', 'ng-hide' => 'hasVariants(product)' } %td.category{ 'ng-if' => 'columns.category.visible' } - %input.fullwidth{ :type => 'text', id: "p{{product.id}}_category_id", 'ng-model' => 'product.category_id', 'ofn-taxon-autocomplete' => '', 'ofn-track-product' => 'category_id', 'multiple-selection' => 'false', placeholder: 'Category' } %td.tax_category{ 'ng-if' => 'columns.tax_category.visible' } %td.inherits_properties{ 'ng-show' => 'columns.inherits_properties.visible' } %input{ 'ng-model' => 'product.inherits_properties', :name => 'inherits_properties', 'ofn-track-product' => 'inherits_properties', type: "checkbox" } diff --git a/app/views/spree/admin/products/index/_products_variant.html.haml b/app/views/spree/admin/products/index/_products_variant.html.haml index 45a7ea24c6..48c732c155 100644 --- a/app/views/spree/admin/products/index/_products_variant.html.haml +++ b/app/views/spree/admin/products/index/_products_variant.html.haml @@ -21,8 +21,9 @@ %td{ 'ng-show' => 'columns.on_demand.visible' } %input.field{ 'ng-model' => 'variant.on_demand', :name => 'variant_on_demand', 'ofn-track-variant' => 'on_demand', :type => 'checkbox' } %td{ 'ng-show' => 'columns.category.visible' } + %input.fullwidth{ type: 'text', id: "p{{product.id}}_category_id", 'ng-model' => 'variant.category_id', 'ofn-taxon-autocomplete' => '', 'ofn-track-variant' => 'category_id', 'multiple-selection' => 'false', placeholder: 'Category' } %td{ 'ng-show' => 'columns.tax_category.visible' } - %select.select2{ name: 'variant_tax_category_id', 'ofn-track-variant': 'tax_category_id', ng: { model: 'variant.tax_category_id', options: 'tax_category.id as tax_category.name for tax_category in tax_categories' } } + %select.select2{ name: 'variant_tax_category_id', "ofn-track-variant": 'tax_category_id', "ng-model": 'variant.tax_category_id', "ng-options": 'tax_category.id as tax_category.name for tax_category in tax_categories' } %option{ value: '' }= t(:none) %td{ 'ng-show' => 'columns.inherits_properties.visible' } %td{ 'ng-show' => 'columns.import_date.visible' } diff --git a/app/views/spree/admin/products/new.html.haml b/app/views/spree/admin/products/new.html.haml index 71710c1258..db7968a1da 100644 --- a/app/views/spree/admin/products/new.html.haml +++ b/app/views/spree/admin/products/new.html.haml @@ -54,7 +54,7 @@ %br/ = f.text_field :price, { "class": "fullwidth", "ng-model": "product.price", "ng-value": "'#{@product.price}'" } = f.error_message_on :price - .four.columns{ ng: { app: 'ofn.admin'}} + .four.columns{ "ng-app": 'ofn.admin' } = f.field_container :unit_price do %div{style: "display: flex"} = f.label :unit_price, t(".unit_price") diff --git a/app/views/spree/admin/return_authorizations/index.html.haml b/app/views/spree/admin/return_authorizations/index.html.haml index 390551307c..de984deedd 100644 --- a/app/views/spree/admin/return_authorizations/index.html.haml +++ b/app/views/spree/admin/return_authorizations/index.html.haml @@ -27,7 +27,7 @@ - tr_id = spree_dom_id(return_authorization) %tr{class: tr_class, id: tr_id} %td= return_authorization.number - %td= Spree.t('spree.admin.return_authorizations.states.' + return_authorization.state.downcase) + %td= Spree.t('admin.return_authorizations.states.' + return_authorization.state.downcase) %td= return_authorization.display_amount.to_html %td= pretty_time(return_authorization.created_at) %td.actions diff --git a/app/views/spree/admin/shared/_order_links.html.haml b/app/views/spree/admin/shared/_order_links.html.haml index 41508a2ad2..9af75fffd8 100644 --- a/app/views/spree/admin/shared/_order_links.html.haml +++ b/app/views/spree/admin/shared/_order_links.html.haml @@ -1,20 +1,21 @@ %li.links-dropdown#links-dropdown - .ofn-drop-down{"data-controller": "dropdown", "data-action": "click->dropdown#toggle" } - %span - %i.icon-check - = I18n.t 'admin.actions' - %i{ "data-dropdown-target": "arrow", "data-expanded-class": "icon-caret-up", "data-collapsed-class": "icon-caret-down" } - %div.menu.hidden{"data-dropdown-target": "menu"} - - order_links(@order).each do |link| - - if link[:name] == t(:ship_order) - %a.menu_item{ href: link[:url], target: link[:target] || "_self", data: { "modal-link-target-value": dom_id(@order, :ship), "action": "click->modal-link#open", "controller": "modal-link" } } - %span - %i{ class: link[:icon] } - %span=link[:name] - - else - %a.menu_item{ href: link[:url], target: link[:target] || "_self", data: { method: link[:method], "ujs-navigate": link[:method] ? "false" : "undefined", confirm: link[:confirm] } } - %span - %i{ class: link[:icon] } - %span=link[:name] + .ofn-drop-down + %details{"data-controller": "dropdown"} + %summary + %span + %i.icon-check + = I18n.t 'admin.actions' + %div.menu{"data-action": "click->dropdown#closeOnMenu"} + - order_links(@order).each do |link| + - if link[:name] == t(:ship_order) + %a.menu_item{ href: link[:url], target: link[:target] || "_self", data: { "modal-link-target-value": dom_id(@order, :ship), "action": "click->modal-link#open", "controller": "modal-link" } } + %span + %i{ class: link[:icon] } + %span=link[:name] + - else + %a.menu_item{ href: link[:url], target: link[:target] || "_self", data: { method: link[:method], "ujs-navigate": link[:method] ? "false" : "undefined", confirm: link[:confirm] } } + %span + %i{ class: link[:icon] } + %span=link[:name] = render 'spree/admin/shared/custom-confirm' diff --git a/app/views/spree/admin/shared/_status_message.html.haml b/app/views/spree/admin/shared/_status_message.html.haml index f9de868721..5f0ce5824b 100644 --- a/app/views/spree/admin/shared/_status_message.html.haml +++ b/app/views/spree/admin/shared/_status_message.html.haml @@ -1,2 +1,2 @@ -%h6{ id: "status-message", ng: { style: 'StatusMessage.statusMessage.style' } } +%h6{ id: "status-message", "ng-style": 'StatusMessage.statusMessage.style' } {{ StatusMessage.statusMessage.text || " " }} diff --git a/app/views/spree/admin/taxonomies/_form.html.haml b/app/views/spree/admin/taxonomies/_form.html.haml index 81927c7c1a..ac60030374 100644 --- a/app/views/spree/admin/taxonomies/_form.html.haml +++ b/app/views/spree/admin/taxonomies/_form.html.haml @@ -3,5 +3,5 @@ = f.label :name, t("spree.name") %span.required * %br/ - = error_message_on :taxonomy, :name, class: 'fullwidth title' + = error_message_on :taxonomy, :name = text_field :taxonomy, :name diff --git a/app/views/spree/admin/taxons/_form.html.haml b/app/views/spree/admin/taxons/_form.html.haml index 0d1bcd0605..621b5eadf8 100644 --- a/app/views/spree/admin/taxons/_form.html.haml +++ b/app/views/spree/admin/taxons/_form.html.haml @@ -4,7 +4,7 @@ = f.label :name, t(".name") %span.required * %br/ - = error_message_on :taxon, :name, class: 'fullwidth title' + = error_message_on :taxon, :name = text_field :taxon, :name, class: 'fullwidth' = f.field_container :permalink_part do = f.label :permalink_part, t(".permalink") diff --git a/app/views/spree/admin/taxons/edit.html.haml b/app/views/spree/admin/taxons/edit.html.haml index efb5c29e91..1df6e7288f 100644 --- a/app/views/spree/admin/taxons/edit.html.haml +++ b/app/views/spree/admin/taxons/edit.html.haml @@ -1,7 +1,7 @@ = render partial: 'spree/admin/shared/configuration_menu' - content_for :page_title do - = t("spree.taxon_edit") + = t("spree.taxonomy_edit") - content_for :page_actions do %li diff --git a/app/views/spree/admin/variants/_form.html.haml b/app/views/spree/admin/variants/_form.html.haml index 1e9aa79236..76a1ebfafc 100644 --- a/app/views/spree/admin/variants/_form.html.haml +++ b/app/views/spree/admin/variants/_form.html.haml @@ -72,4 +72,8 @@ = f.label :shipping_category_id, t(:shipping_categories) = f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, {}, { class: 'select2 fullwidth' }) + .field + = f.label :primary_taxon, t('spree.admin.products.primary_taxon_form.product_category') + = f.collection_select(:primary_taxon_id, Spree::Taxon.order(:name), :id, :name, { include_blank: true }, { class: "select2 fullwidth" }) + .clear diff --git a/app/views/spree/orders/_bought.html.haml b/app/views/spree/orders/_bought.html.haml index f00a8b2dbe..5d80edbb05 100644 --- a/app/views/spree/orders/_bought.html.haml +++ b/app/views/spree/orders/_bought.html.haml @@ -1,18 +1,18 @@ -%tbody{ ng: { controller: 'EditBoughtOrderController' } } +%tbody{ "ng-controller": 'EditBoughtOrderController' } %tr - %td.toggle-bought{ colspan: 2, ng: { click: 'showBought=!showBought' } } + %td.toggle-bought{ colspan: 2, "ng-click": 'showBought=!showBought' } %h5.brick - %i{ ng: { class: "{ 'ofn-i_007-caret-right': !showBought, 'ofn-i_005-caret-down': showBought}"} } + %i{ "ng-class": "{ 'ofn-i_007-caret-right': !showBought, 'ofn-i_005-caret-down': showBought}" } = t(:orders_bought_items_notice, count: @order.finalised_line_items.to_a.sum(&:quantity)) %td.text-right{ colspan: 3 } - %a.edit-finalised.button.radius.expand.small{ href: changeable_orders_link_path, ng: { class: "{secondary: !showBought, primary: showBought}" } } + %a.edit-finalised.button.radius.expand.small{ href: changeable_orders_link_path, "ng-class": "{secondary: !showBought, primary: showBought}" } = t(:orders_bought_edit_button) %i.ofn-i_007-caret-right - @order.finalised_line_items.each do |line_item| - variant = line_item.variant - %tr.bought.line-item{class: "line-item-#{line_item.id} variant-#{variant.id}", ng: { show: 'showBought'} } + %tr.bought.line-item{ class: "line-item-#{line_item.id} variant-#{variant.id}", "ng-show": 'showBought' } %td.cart-item-description %div.item-thumb-image @@ -31,5 +31,5 @@ = line_item.display_amount_with_adjustments.to_html unless line_item.quantity.nil? %td.bought-item-delete.text-center - %a{ng: {click: "removeEnabled && deleteLineItem(#{line_item.id})"}} + %a{ "ng-click": "removeEnabled && deleteLineItem(#{line_item.id})" } %i.ofn-i_026-trash diff --git a/app/views/spree/orders/edit.html.haml b/app/views/spree/orders/edit.html.haml index ddde898e32..fb50b995eb 100644 --- a/app/views/spree/orders/edit.html.haml +++ b/app/views/spree/orders/edit.html.haml @@ -28,8 +28,8 @@ #cart-container - if @order.line_items.empty? %div.row - %p= t(:your_cart_is_empty) - %p= link_to t(:continue_shopping), current_shop_products_path, :class => 'button continue' + %p= t(:cart_empty) + %p= link_to t(:orders_edit_continue), current_shop_products_path, :class => 'button continue' - else %div diff --git a/app/views/spree/orders/form/_update_buttons.html.haml b/app/views/spree/orders/form/_update_buttons.html.haml index 50e256e540..be58dbbd4b 100644 --- a/app/views/spree/orders/form/_update_buttons.html.haml +++ b/app/views/spree/orders/form/_update_buttons.html.haml @@ -23,5 +23,5 @@ .columns.small-12.medium-3 = button_tag :class => 'button primary expand', :id => 'update-button', "ng-disabled" => 'update_order_form.$pristine' do %i.ofn-i_051-check-big - %span{ ng: { show: 'update_order_form.$dirty' } }= t(:save_changes) - %span{ ng: { hide: 'update_order_form.$dirty' } }= t(:order_saved) + %span{ "ng-show": 'update_order_form.$dirty' }= t(:save_changes) + %span{ "ng-hide": 'update_order_form.$dirty' }= t(:order_saved) diff --git a/app/views/spree/users/_authorised_shops.html.haml b/app/views/spree/users/_authorised_shops.html.haml index 51fdacf3ef..4e83917699 100644 --- a/app/views/spree/users/_authorised_shops.html.haml +++ b/app/views/spree/users/_authorised_shops.html.haml @@ -5,13 +5,7 @@ %tr %th= t(".shop_name") %th= t(".allow_charges?") - %tr.customer{ id: "customer{{ customer.id }}", ng: { repeat: "customer in customers" } } - %td.shop{ ng: { bind: 'shopsByID[customer.enterprise_id].name' } } + %tr.customer{ id: "customer{{ customer.id }}", "ng-repeat": "customer in customers" } + %td.shop{ "ng-bind": 'shopsByID[customer.enterprise_id].name' } %td.allow_charges{ tooltip: "{{ hasOneDefaultSavedCards() ? null : \'" + t('.no_default_saved_cards_tooltip') + "\' }}" } - %input{ type: 'checkbox', - name: 'allow_charges', - ng: { model: 'customer.allow_charges', - change: 'customer.update()', - disabled: "!hasOneDefaultSavedCards()", - "true-value" => "true", - "false-value" => "false" } } + %input{ type: 'checkbox', name: 'allow_charges', "ng-model": 'customer.allow_charges', "ng-change": 'customer.update()', "ng-disabled": "!hasOneDefaultSavedCards()", "ng-true-value": "true", "ng-false-value": "false" } diff --git a/app/views/spree/users/_cards.html.haml b/app/views/spree/users/_cards.html.haml index 869b59242a..25ef6c87eb 100644 --- a/app/views/spree/users/_cards.html.haml +++ b/app/views/spree/users/_cards.html.haml @@ -7,18 +7,18 @@ %button.button.secondary.tiny.help-btn{ "data-controller": "help-modal-link", "data-action": "click->help-modal-link#open", "data-help-modal-link-target-value": "saved_cards_modal" } %i.ofn-i_013-help - .saved_cards{ ng: { show: 'savedCreditCards.length > 0' } } + .saved_cards{ "ng-show": 'savedCreditCards.length > 0' } = render 'saved_cards' - .no_cards{ ng: { hide: 'savedCreditCards.length > 0' } } + .no_cards{ "ng-hide": 'savedCreditCards.length > 0' } = t(:you_have_no_saved_cards) - %button.button.primary{ ng: { click: 'showForm()', hide: 'CreditCard.visible' } } + %button.button.primary{ "ng-click": 'showForm()', "ng-hide": 'CreditCard.visible' } = t(:add_a_card) .small-12.medium-6.columns - .new_card{ ng: { show: 'CreditCard.visible', class: '{visible: CreditCard.visible}' } } + .new_card{ "ng-show": 'CreditCard.visible', "ng-class": '{visible: CreditCard.visible}' } %h3= t(:add_new_credit_card) = render 'new_card_form' - .authorised_shops{ ng: { controller: 'AuthorisedShopsCtrl', hide: 'CreditCard.visible || savedCreditCards.length == 0' } } + .authorised_shops{ "ng-controller": 'AuthorisedShopsCtrl', "ng-hide": 'CreditCard.visible || savedCreditCards.length == 0' } %h3 = t('.authorised_shops') = render 'authorised_shops' diff --git a/app/views/spree/users/_new_card_form.html.haml b/app/views/spree/users/_new_card_form.html.haml index 3d17afbf6a..72bfafd14f 100644 --- a/app/views/spree/users/_new_card_form.html.haml +++ b/app/views/spree/users/_new_card_form.html.haml @@ -4,24 +4,14 @@ %label = t(:first_name) -# Changing name not permitted by default (in checkout) - can be enabled by setting an allow_name_change variable in $scope - %input#first_name{ type: :text, - name: 'first_name', - required: true, - ng: { model: "secrets.first_name", - disabled: "!allow_name_change", - value: "order.bill_address.firstname"} } - %small.error{ ng: { show: 'new_card_form.$submitted && new_card_form.first_name.$error.required' } }= t(:error_required) + %input#first_name{ type: :text, name: 'first_name', required: true, "ng-model": "secrets.first_name", "ng-disabled": "!allow_name_change", "ng-value": "order.bill_address.firstname" } + %small.error{ "ng-show": 'new_card_form.$submitted && new_card_form.first_name.$error.required' }= t(:error_required) .small-6.columns %label = t(:last_name) - %input#last_name{type: :text, - name: "last_name", - required: true, - ng: { model: "secrets.last_name", - disabled: "!allow_name_change", - value: "order.bill_address.lastname" } } - %small.error{ ng: { show: 'new_card_form.$submitted && new_card_form.last_name.$error.required' } }= t(:error_required) + %input#last_name{ type: :text, name: "last_name", required: true, "ng-model": "secrets.last_name", "ng-disabled": "!allow_name_change", "ng-value": "order.bill_address.lastname" } + %small.error{ "ng-show": 'new_card_form.$submitted && new_card_form.last_name.$error.required' }= t(:error_required) .row .small-12.columns diff --git a/app/views/spree/users/_orders.html.haml b/app/views/spree/users/_orders.html.haml index a8c34b22f1..db548000ee 100644 --- a/app/views/spree/users/_orders.html.haml +++ b/app/views/spree/users/_orders.html.haml @@ -1,10 +1,10 @@ %script{ type: "text/ng-template", id: "account/orders.html" } .orders{"ng-controller" => "OrdersCtrl", "ng-cloak" => true} - .my-open-orders{ ng: { show: 'Orders.changeable.length > 0' } } + .my-open-orders{ "ng-show": 'Orders.changeable.length > 0' } %h3= t('.open_orders') = render 'open_orders' - .past-orders{ ng: { show: 'pastOrders.length > 0' } } + .past-orders{ "ng-show": 'pastOrders.length > 0' } %h3= t('.past_orders') = render 'past_orders' .message{"ng-if" => "Orders.all.length == 0", "ng-bind" => "::'you_have_no_orders_yet' | t"} diff --git a/app/views/spree/users/_saved_cards.html.haml b/app/views/spree/users/_saved_cards.html.haml index 853642762b..035d0849b1 100644 --- a/app/views/spree/users/_saved_cards.html.haml +++ b/app/views/spree/users/_saved_cards.html.haml @@ -5,12 +5,12 @@ %th= t(:card_expiry_date) %th= t('.default?') %th= t('.delete?') - %tr.card{ id: "card{{ card.id }}", ng: { repeat: "card in savedCreditCards" } } - %td.brand{ ng: { bind: '::card.brand' } } - %td.number{ ng: { bind: '::card.number' } } - %td.expiry{ ng: { bind: '::card.expiry' } } + %tr.card{ id: "card{{ card.id }}", "ng-repeat": "card in savedCreditCards" } + %td.brand{ "ng-bind": '::card.brand' } + %td.number{ "ng-bind": '::card.number' } + %td.expiry{ "ng-bind": '::card.expiry' } %td.is-default - %input{ type: 'radio', name: 'default_card', ng: { model: 'card.is_default', click: 'confirmSetDefault(card, $event)', value: "true"} } + %input{ type: 'radio', name: 'default_card', "ng-model": 'card.is_default', "ng-click": 'confirmSetDefault(card, $event)', "ng-value": "true" } %td.actions %button.tiny.alert.no-margin{ "ng-click": "deleteCard(card.id)" } = t(:delete) diff --git a/app/webpacker/channels/scoped_channel.js b/app/webpacker/channels/scoped_channel.js new file mode 100644 index 0000000000..359cf5c26d --- /dev/null +++ b/app/webpacker/channels/scoped_channel.js @@ -0,0 +1 @@ +// ScopedChannel is created with a specific ID in ../controllers/scoped_channel_controller.js diff --git a/app/webpacker/controllers/bulk_form_controller.js b/app/webpacker/controllers/bulk_form_controller.js index 98a6063a0e..602f7c0127 100644 --- a/app/webpacker/controllers/bulk_form_controller.js +++ b/app/webpacker/controllers/bulk_form_controller.js @@ -1,6 +1,19 @@ import { Controller } from "stimulus"; -// Manages "changed" state for a form with multiple records +// Manage "changed" state for a form with multiple records +// +// When any elements are changed: +// - the element is marked ".changed" +// - "actions" element appears +// - "changedSummary" element is updated using I18n +// - "disableSelector" elements are disabled +// - The browser will warn if trying to leave the page +// +// Supported element types: +// - input[type=text] and similar +// - input[type=checkbox] +// - select (single) - including tom-select +// export default class BulkFormController extends Controller { static targets = ["actions", "changedSummary"]; static values = { @@ -10,25 +23,31 @@ export default class BulkFormController extends Controller { recordElements = {}; connect() { + this.submitting = false; this.form = this.element; // Start listening for any changes within the form this.#registerElements(this.form.elements); this.toggleFormChanged(); + + this.form.addEventListener("submit", this.#registerSubmit.bind(this)); + window.addEventListener("beforeunload", this.preventLeavingChangedForm.bind(this)); } disconnect() { // Make sure to clean up anything that happened outside this.#disableOtherElements(false); - window.removeEventListener("beforeunload", this.preventLeavingBulkForm); + window.removeEventListener("beforeunload", this.preventLeavingChangedForm.bind(this)); } // Register any new elements (may be called by another controller after dynamically adding fields) registerElements() { const registeredElements = Object.values(this.recordElements).flat(); // Select only elements that haven't been registered yet - const newElements = Array.from(this.form.elements).filter(n => !registeredElements.includes(n)); + const newElements = Array.from(this.form.elements).filter( + (n) => !registeredElements.includes(n), + ); this.#registerElements(newElements); } @@ -42,14 +61,15 @@ export default class BulkFormController extends Controller { toggleFormChanged() { // For each record, check if any fields are changed + // TODO: optimise basd on current state. if field is changed, but form already changed, no need to update (and vice versa) const changedRecordCount = Object.values(this.recordElements).filter((elements) => - elements.some(this.#isChanged) + elements.some(this.#isChanged), ).length; - const formChanged = changedRecordCount > 0 || this.errorValue; + this.formChanged = changedRecordCount > 0 || this.errorValue; // Show actions - this.hasActionsTarget && this.actionsTarget.classList.toggle("hidden", !formChanged); - this.#disableOtherElements(formChanged); // like filters and sorting + this.hasActionsTarget && this.actionsTarget.classList.toggle("hidden", !this.formChanged); + this.#disableOtherElements(this.formChanged); // like filters and sorting // Display number of records changed const key = this.hasChangedSummaryTarget && this.changedSummaryTarget.dataset.translationKey; @@ -57,25 +77,26 @@ export default class BulkFormController extends Controller { // TODO: save processing and only run if changedRecordCount has changed. this.changedSummaryTarget.textContent = I18n.t(key, { count: changedRecordCount }); } + } - // Prevent accidental data loss - if (formChanged) { - window.addEventListener("beforeunload", this.preventLeavingBulkForm); - } else { - window.removeEventListener("beforeunload", this.preventLeavingBulkForm); + // If form is not being submitted, warn to prevent accidental data loss + preventLeavingChangedForm(event) { + if (this.formChanged && !this.submitting) { + // Cancel the event + event.preventDefault(); + // Chrome requires returnValue to be set, but ignores the value. Other browsers may display + // this if provided, but let's not create a new translation key, and keep the behaviour + // consistent. + event.returnValue = ""; } } - preventLeavingBulkForm(e) { - // Cancel the event - e.preventDefault(); - // Chrome requires returnValue to be set. Other browsers may display this if provided, but let's - // not create a new translation key, and keep the behaviour consistent. - e.returnValue = ""; - } - // private + #registerSubmit() { + this.submitting = true; + } + #registerElements(elements) { for (const element of elements) { element.addEventListener("input", this.toggleChanged.bind(this)); // immediately respond to any change @@ -105,7 +126,7 @@ export default class BulkFormController extends Controller { forms && forms.forEach((form) => - Array.from(form.elements).forEach((formElement) => (formElement.disabled = disable)) + Array.from(form.elements).forEach((formElement) => (formElement.disabled = disable)), ); }); } @@ -113,6 +134,11 @@ export default class BulkFormController extends Controller { #isChanged(element) { if (element.type == "checkbox") { return element.defaultChecked !== undefined && element.checked != element.defaultChecked; + } else if (element.type == "select-one") { + const defaultSelected = Array.from(element.options).find((opt) => + opt.hasAttribute("selected"), + ); + return element.selectedOptions[0] != defaultSelected; } else { return element.defaultValue !== undefined && element.value != element.defaultValue; } diff --git a/app/webpacker/controllers/checked_controller.js b/app/webpacker/controllers/checked_controller.js index 6317635fa4..acca8ec0dd 100644 --- a/app/webpacker/controllers/checked_controller.js +++ b/app/webpacker/controllers/checked_controller.js @@ -41,6 +41,13 @@ export default class extends Controller { return this.countValue === this.checkboxTargets.length; } + #closeDetails(elmnt) { + if (elmnt.getElementsByTagName('details').length == 0) + return; + + Array.from(elmnt.getElementsByTagName('details')).forEach((element) => element.open = false); + } + #toggleDisabled() { if (!this.hasDisableTarget) { return; @@ -48,6 +55,7 @@ export default class extends Controller { if (this.#checkedCount() === 0) { this.disableTargets.forEach((element) => element.classList.add("disabled")); + this.disableTargets.forEach(this.#closeDetails); } else { this.disableTargets.forEach((element) => element.classList.remove("disabled")); } diff --git a/app/webpacker/controllers/dropdown_controller.js b/app/webpacker/controllers/dropdown_controller.js index 19a3dc8b7a..844289e12c 100644 --- a/app/webpacker/controllers/dropdown_controller.js +++ b/app/webpacker/controllers/dropdown_controller.js @@ -1,44 +1,29 @@ import { Controller } from "stimulus"; export default class extends Controller { - static targets = ["arrow", "menu"]; connect() { - this.collapsedClasses = this.arrowTarget.dataset.collapsedClass.split(" "); - this.expandedClasses = this.arrowTarget.dataset.expandedClass.split(" "); - this.#hide(); - document.addEventListener("click", this.#onBodyClick.bind(this)); + document.body.addEventListener("click", this.#close.bind(this)); + this.element.addEventListener("click", this.#stopPropagation.bind(this)); } disconnect() { - document.removeEventListener("click", this.#onBodyClick); + document.removeEventListener("click", this.#close); + document.removeEventListener("click", this.#stopPropagation); } - toggle() { - if (this.element.classList.contains("disabled")) { - return; - } - if (this.menuTarget.classList.contains("hidden")) { - this.#show(); - } else { - this.#hide(); - } + closeOnMenu(event) { + this.#close(); + this.#stopPropagation(event); } - #onBodyClick(event) { - if (!this.element.contains(event.target)) { - this.#hide(); - } + // private + + #close(event) { + this.element.open = false; } - #show() { - this.menuTarget.classList.remove("hidden"); - this.arrowTarget.classList.remove(...this.collapsedClasses); - this.arrowTarget.classList.add(...this.expandedClasses); - } - #hide() { - this.menuTarget.classList.add("hidden"); - this.arrowTarget.classList.remove(...this.expandedClasses); - this.arrowTarget.classList.add(...this.collapsedClasses); + #stopPropagation(event) { + event.stopPropagation(); } } diff --git a/app/webpacker/controllers/index.js b/app/webpacker/controllers/index.js index 4e31f9a433..55c57a46ce 100644 --- a/app/webpacker/controllers/index.js +++ b/app/webpacker/controllers/index.js @@ -6,15 +6,15 @@ import StimulusReflex from "stimulus_reflex"; import consumer from "../channels/consumer"; import controller from "../controllers/application_controller"; import CableReady from "cable_ready"; -import NestedForm from 'stimulus-rails-nested-form/dist/stimulus-rails-nested-form.umd.js' // the default module entry point is broken - +import RailsNestedForm from '@stimulus-components/rails-nested-form/dist/stimulus-rails-nested-form.umd.js' // the default module entry point is broken const application = Application.start(); const context = require.context("controllers", true, /_controller\.js$/); const contextComponents = require.context("../../components", true, /_controller\.js$/); application.load(definitionsFromContext(context).concat(definitionsFromContext(contextComponents))); -application.register('nested-form', NestedForm); +application.register('nested-form', RailsNestedForm); + application.consumer = consumer; StimulusReflex.initialize(application, { controller, isolate: true }); StimulusReflex.debug = process.env.RAILS_ENV === "development"; diff --git a/app/webpacker/controllers/popout_controller.js b/app/webpacker/controllers/popout_controller.js index 287ed98771..c62d7934dd 100644 --- a/app/webpacker/controllers/popout_controller.js +++ b/app/webpacker/controllers/popout_controller.js @@ -3,27 +3,26 @@ import { Controller } from "stimulus"; // Allows a form section to "pop out" and show additional options export default class PopoutController extends Controller { static targets = ["button", "dialog"]; + static values = { + updateDisplay: { Boolean, default: true } + } connect() { - this.first_input = this.dialogTarget.querySelector("input"); this.displayElements = Array.from(this.element.querySelectorAll('input:not([type="hidden"]')); + this.first_input = this.displayElements[0]; // Show when click or down-arrow on button this.buttonTarget.addEventListener("click", this.show.bind(this)); this.buttonTarget.addEventListener("keydown", this.applyKeyAction.bind(this)); - // Close when click or tab outside of dialog. Run async (don't block primary event handlers). - this.closeIfOutsideBound = this.closeIfOutside.bind(this); // Store reference for removing listeners later. - document.addEventListener("click", this.closeIfOutsideBound, { passive: true }); - document.addEventListener("focusin", this.closeIfOutsideBound, { passive: true }); + this.closeIfOutsideBound = this.closeIfOutside.bind(this); // Store reference for managing listeners. } disconnect() { // Clean up handlers registered outside the controller element. // (jest cleans up document too early) if (document) { - document.removeEventListener("click", this.closeIfOutsideBound); - document.removeEventListener("focusin", this.closeIfOutsideBound); + this.#removeGlobalEventListeners(); } } @@ -31,6 +30,9 @@ export default class PopoutController extends Controller { this.dialogTarget.style.display = "block"; this.first_input.focus(); e.preventDefault(); + + // Close when click or tab outside of dialog. + this.#addGlobalEventListeners(); } // Apply an appropriate action, behaving similar to a dropdown @@ -58,16 +60,22 @@ export default class PopoutController extends Controller { } // Update button to represent any changes - this.buttonTarget.innerText = this.#displayValue(); - this.buttonTarget.innerHTML ||= " "; // (with default space to help with styling) + if (this.updateDisplayValue) { + this.buttonTarget.textContent = this.#displayValue(); + this.buttonTarget.innerHTML ||= " "; // (with default space to help with styling) + } this.buttonTarget.classList.toggle("changed", this.#isChanged()); this.dialogTarget.style.display = "none"; + + this.#removeGlobalEventListeners(); } } closeIfOutside(e) { - if (!this.dialogTarget.contains(e.target)) { + // Note that we need to ignore the clicked button. Even though the listener was only just + // registered, it still fires sometimes for some unkown reason. + if (!this.dialogTarget.contains(e.target) && !this.buttonTarget.contains(e.target)) { this.close(); } } @@ -87,7 +95,7 @@ export default class PopoutController extends Controller { let values = this.#enabledDisplayElements().map((element) => { if (element.type == "checkbox") { if (element.checked && element.labels[0]) { - return element.labels[0].innerText; + return element.labels[0].textContent.trim(); } } else { return element.value; @@ -104,4 +112,15 @@ export default class PopoutController extends Controller { #enabledDisplayElements() { return this.displayElements.filter((element) => !element.disabled); } + + #addGlobalEventListeners() { + // Run async (don't block primary event handlers). + document.addEventListener("click", this.closeIfOutsideBound, { passive: true }); + document.addEventListener("focusin", this.closeIfOutsideBound, { passive: true }); + } + + #removeGlobalEventListeners() { + document.removeEventListener("click", this.closeIfOutsideBound); + document.removeEventListener("focusin", this.closeIfOutsideBound); + } } diff --git a/app/webpacker/controllers/product_controller.js b/app/webpacker/controllers/product_controller.js new file mode 100644 index 0000000000..942f3b02e1 --- /dev/null +++ b/app/webpacker/controllers/product_controller.js @@ -0,0 +1,38 @@ +import { Controller } from "stimulus"; + +// Dynamically update related Product unit fields (expected to move to Variant due to Product Refactor) +// +export default class ProductController extends Controller { + connect() { + // idea: create a helper that includes a nice getter/setter for Rails model attr values, just pass it the attribute name. + // It could automatically find (and cache a ref to) each dom element and get/set the values. + this.variantUnit = this.element.querySelector('[name$="[variant_unit]"]'); + this.variantUnitScale = this.element.querySelector('[name$="[variant_unit_scale]"]'); + this.variantUnitWithScale = this.element.querySelector('[name$="[variant_unit_with_scale]"]'); + + // on variant_unit_with_scale changed; update variant_unit and variant_unit_scale + this.variantUnitWithScale.addEventListener("change", this.#updateUnitAndScale.bind(this), { + passive: true, + }); + } + + // private + + // Extract variant_unit and variant_unit_scale from dropdown variant_unit_with_scale, + // and update hidden product fields + #updateUnitAndScale(event) { + const variant_unit_with_scale = this.variantUnitWithScale.value; + const match = variant_unit_with_scale.match(/^([^_]+)_([\d\.]+)$/); // eg "weight_1000" + + if (match) { + this.variantUnit.value = match[1]; + this.variantUnitScale.value = parseFloat(match[2]); + } else { + // "items" + this.variantUnit.value = variant_unit_with_scale; + this.variantUnitScale.value = ""; + } + this.variantUnit.dispatchEvent(new Event("change")); + this.variantUnitScale.dispatchEvent(new Event("change")); + } +} diff --git a/app/webpacker/controllers/products_controller.js b/app/webpacker/controllers/products_controller.js index 6fe8662f50..9ec3ac1a86 100644 --- a/app/webpacker/controllers/products_controller.js +++ b/app/webpacker/controllers/products_controller.js @@ -6,8 +6,6 @@ export default class extends ApplicationController { connect() { super.connect(); - // Fetch the products on page load - this.stimulate("Products#fetch"); } beforeReflex() { diff --git a/app/webpacker/controllers/toggle_control_controller.js b/app/webpacker/controllers/toggle_control_controller.js index 7ba2bdb85d..6beea90ec2 100644 --- a/app/webpacker/controllers/toggle_control_controller.js +++ b/app/webpacker/controllers/toggle_control_controller.js @@ -1,32 +1,29 @@ import { Controller } from "stimulus"; +// Toggle state of a control based on a condition. +// +// 1. When an action occurs on an element, +// 2. The element's value is inspected, and +// 3. The related control(s) are changed state +// export default class extends Controller { static targets = ["control", "content", "chevron"]; - static values = { selector: String }; + static values = { selector: String, match: String }; disableIfPresent(event) { - const input = event.currentTarget; - const disable = !!this.#inputValue(input); // Coerce value to boolean + const present = !!this.#inputValue(event.currentTarget); // Coerce value to boolean - this.controlTargets.forEach((target) => { - target.disabled = disable; - }); - - // Focus when enabled - if (!disable) { - this.controlTargets[0].focus(); - } + this.#toggleDisabled(present); } enableIfPresent(event) { - const input = event.currentTarget; - const enable = !!this.#inputValue(input); + const present = !!this.#inputValue(event.currentTarget); // Coerce value to boolean - this.controlTargets.forEach((target) => { - target.disabled = !enable; - }); + this.#toggleDisabled(!present); } + // Display the "content" target if element has data-toggle-show="true" + // (TODO: why not use the "control" target?) toggleDisplay(event) { const input = event.currentTarget; this.contentTargets.forEach((t) => { @@ -34,6 +31,8 @@ export default class extends Controller { }); } + // Toggle element specified by data-control-toggle-selector-value="" + // (TODO: give a more general name) toggleAdvancedSettings(event) { if (this.hasChevronTarget) { this.chevronTarget.classList.toggle("icon-chevron-down"); @@ -44,8 +43,37 @@ export default class extends Controller { element.style.display = element.style.display === "none" ? "block" : "none"; } + // Display the control if selected value matches value in data-toggle-match="" + displayIfMatch(event) { + const inputValue = this.#inputValue(event.currentTarget); + + this.#toggleDisplay(inputValue == this.matchValue); + } + // private + #toggleDisabled(disable) { + this.controlTargets.forEach((target) => { + target.disabled = disable; + }); + + // Focus first when enabled + if (!disable) { + this.controlTargets[0].focus(); + } + } + + #toggleDisplay(show) { + this.controlTargets.forEach((target) => { + target.style.display = (show ? "block" : "none"); + }); + + // Focus first when displayed + if (show) { + this.controlTargets[0].focus(); + } + } + // Return input's value, but only if it would be submitted by a form // Radio buttons not supported (yet) #inputValue(input) { diff --git a/app/webpacker/controllers/variant_controller.js b/app/webpacker/controllers/variant_controller.js new file mode 100644 index 0000000000..07780e2531 --- /dev/null +++ b/app/webpacker/controllers/variant_controller.js @@ -0,0 +1,86 @@ +import { Controller } from "stimulus"; +import OptionValueNamer from "js/services/option_value_namer"; + +// Dynamically update related variant fields +// +export default class VariantController extends Controller { + connect() { + // Assuming these will be available on the variant soon, just a quick hack to find the product fields: + const product = this.element.closest("[data-record-id]"); + this.variantUnit = product.querySelector('[name$="[variant_unit]"]'); + this.variantUnitScale = product.querySelector('[name$="[variant_unit_scale]"]'); + this.variantUnitName = product.querySelector('[name$="[variant_unit_name]"]'); + + this.unitValue = this.element.querySelector('[name$="[unit_value]"]'); + this.unitDescription = this.element.querySelector('[name$="[unit_description]"]'); + this.unitValueWithDescription = this.element.querySelector( + '[name$="[unit_value_with_description]"]', + ); + this.displayAs = this.element.querySelector('[name$="[display_as]"]'); + this.unitToDisplay = this.element.querySelector('[name$="[unit_to_display]"]'); + + // on unit changed; update display_as:placeholder and unit_to_display + [this.variantUnit, this.variantUnitScale, this.variantUnitName].forEach((element) => { + element.addEventListener("change", this.#unitChanged.bind(this), { passive: true }); + }); + this.variantUnitName.addEventListener("input", this.#unitChanged.bind(this), { passive: true }); + + // on unit_value_with_description changed; update unit_value and unit_description + // on unit_value and/or unit_description changed; update display_as:placeholder and unit_to_display + this.unitValueWithDescription.addEventListener("input", this.#unitChanged.bind(this), { + passive: true, + }); + + // on display_as changed; update unit_to_display + // TODO: optimise to avoid unnecessary OptionValueNamer calc + this.displayAs.addEventListener("input", this.#updateUnitDisplay.bind(this), { passive: true }); + } + + disconnect() { + // Make sure to clean up anything that happened outside + } + + // private + + // Extract variant_unit and variant_unit_scale from dropdown variant_unit_with_scale, + // and update hidden product fields + #unitChanged(event) { + //Hmm in hindsight the logic in product_controller should be inn this controller already. then we can do everything in one event, and store the generated name in an instance variable. + this.#extractUnitValues(); + this.#updateUnitDisplay(); + } + + // Extract unit_value and unit_description + #extractUnitValues() { + // Extract a number (optional) and text value, separated by a space. + const match = this.unitValueWithDescription.value.match(/^([\d\.\,]+(?= |$)|)( |)(.*)$/); + if (match) { + let unit_value = parseFloat(match[1].replace(",", ".")); + unit_value = isNaN(unit_value) ? null : unit_value; + unit_value *= this.variantUnitScale.value ? this.variantUnitScale.value : 1; // Normalise to default scale + + this.unitValue.value = unit_value; + this.unitDescription.value = match[3]; + } + } + + // Update display_as placeholder and unit_to_display + #updateUnitDisplay() { + const unitDisplay = new OptionValueNamer(this.#variant()).name(); + this.displayAs.placeholder = unitDisplay; + this.unitToDisplay.textContent = this.displayAs.value || unitDisplay; + } + + // A representation of the variant model to satisfy OptionValueNamer. + #variant() { + return { + unit_value: parseFloat(this.unitValue.value), + unit_description: this.unitDescription.value, + product: { + variant_unit: this.variantUnit.value, + variant_unit_scale: parseFloat(this.variantUnitScale.value), + variant_unit_name: this.variantUnitName.value, + }, + }; + } +} diff --git a/app/webpacker/css/admin/dropdown.scss b/app/webpacker/css/admin/dropdown.scss index 64c98e7ddf..ab3a61d5bb 100644 --- a/app/webpacker/css/admin/dropdown.scss +++ b/app/webpacker/css/admin/dropdown.scss @@ -47,6 +47,7 @@ &.disabled { opacity: 0.5; + pointer-events: none; &:hover { cursor: default; @@ -179,6 +180,34 @@ background-color: #ededed; } } + + > details { + // Override padding on ofn-drop-down-style + margin: -7px -15px; + padding: 7px 15px; + } + + > details > summary { + display: inline-block; + list-style: none; + width: auto; + text-transform: uppercase; + font-size: 85%; + font-weight: 600; + // Override padding on ofn-drop-down-style to increase clickable area + margin: -8px -15px; + padding: 8px 15px; + } + + > details > summary:after { + content: "\f0d7"; + font-family: FontAwesome; + } + + > details[open] > summary:after { + content: "\f0d8"; + font-family: FontAwesome; + } } .ofn-drop-down-v2 { diff --git a/app/webpacker/css/admin/products_v3.scss b/app/webpacker/css/admin/products_v3.scss index 731f487dba..8cb8ccbce2 100644 --- a/app/webpacker/css/admin/products_v3.scss +++ b/app/webpacker/css/admin/products_v3.scss @@ -1,5 +1,6 @@ // Customisations for the new Bulk Edit Products page only -.products_v3_page { +// Scoped to containing div, because Turbo messes with body classes +#products_v3_page { #content > .row:first-child > .container:first-child { // Allow table to extend to full width of available screen space // TODO: move this to a generic rule, eg body.full-width{}. Then it can be included on any page. @@ -67,13 +68,17 @@ } th.with-input { + // Additional padding to line up with content of input padding-left: $padding-tbl-cell + $hpadding-txt; - padding-right: $padding-tbl-cell + $hpadding-txt; + + &.align-right { + padding-right: $padding-tbl-cell + $hpadding-txt; + } } } // Row hover - tr:hover { + tbody tr:hover { td { background-color: $light-grey; position: relative; @@ -89,6 +94,13 @@ } } + // "Naked" inputs. Row hover helps reveal them. + .naked_inputs { + input:not([type="checkbox"]), .ts-control { + background-color: $color-tbl-cell-bg; + } + } + // Reveal naked button text when any part of row is hovered button.naked { color: $color-link; @@ -157,27 +169,16 @@ .field { padding: 0; - margin-bottom: 0.75em; + } + .multi-field { + // Allow wrap with small gap + display: flex; + flex-wrap: wrap; + gap: 3px; } - label { - margin: 0; - } - - // "Naked" inputs. Row hover helps reveal them. - tbody { - input:not([type="checkbox"]) { - background-color: $color-tbl-cell-bg; - height: auto; - font-size: inherit; - font-weight: inherit; - } - - :not(.field_with_errors) > { - input:not([type="checkbox"]):not(:focus):not(.changed):not([disabled]) { - border-color: transparent; - } - } + .ts-control { + z-index: 0; // Avoid hovering over thead } } @@ -301,15 +302,13 @@ } } - // Stock popout widget - .on-hand { - &__wrapper { - position: relative; - } + // Popout widget (todo: move to separate fiel) + .popout { + position: relative; &__button { // override button styles - &.on-hand__button { + &.popout__button { background: $color-tbl-cell-bg; color: $color-txt-text; white-space: nowrap; @@ -318,6 +317,8 @@ padding-left: $border-radius; // Super compact padding-right: 1rem; // Retain space for arrow height: auto; + min-width: 2em; + min-height: 1lh; // Line height of parent &:hover, &:active, @@ -350,13 +351,14 @@ content: "\f078"; position: absolute; + top: 0; // Required for empty buttons right: $border-radius; font-size: 0.67em; } } } - &__popout { + &__container { position: absolute; top: -0.6em; left: -0.2em; @@ -369,12 +371,20 @@ border-radius: $border-radius; box-shadow: 0px 0px 8px 0px rgba($near-black, 0.25); - .field:last-child { - margin-bottom: 0; + .field{ + margin-bottom: 0.75em; + + &:last-child { + margin-bottom: 0; + } } - input[disabled] { - color: transparent; // hide value completely + input { + height: auto; + + &[disabled] { + color: transparent; // hide value completely + } } } } diff --git a/app/webpacker/css/admin/sections/products.scss b/app/webpacker/css/admin/sections/products.scss index bac5965d4e..791942a322 100644 --- a/app/webpacker/css/admin/sections/products.scss +++ b/app/webpacker/css/admin/sections/products.scss @@ -1,7 +1,4 @@ .admin-product-form-fields { - label { - display: inline-block; - } input, select, textarea, diff --git a/app/webpacker/css/admin_v3/components/buttons.scss b/app/webpacker/css/admin_v3/components/buttons.scss index f213dd7bc3..01ede577d1 100644 --- a/app/webpacker/css/admin_v3/components/buttons.scss +++ b/app/webpacker/css/admin_v3/components/buttons.scss @@ -158,7 +158,8 @@ button:not(.plain):not(.trix-button), } // --- Reset buttons --- -input[type="reset"] { +input[type="reset"], +.reset { // Reset button looks like a link, but has a border the same as buttons when active. background: none; border: 1px solid transparent; diff --git a/app/webpacker/css/admin_v3/components/dropdown.scss b/app/webpacker/css/admin_v3/components/dropdown.scss index 6a93884aeb..8a101d1c8d 100644 --- a/app/webpacker/css/admin_v3/components/dropdown.scss +++ b/app/webpacker/css/admin_v3/components/dropdown.scss @@ -47,6 +47,7 @@ &.disabled { opacity: 0.5; + pointer-events: none; &:hover { cursor: default; @@ -179,6 +180,32 @@ background-color: #ededed; } } + + > details { + margin: -7px -15px; + padding: 7px 15px; + } + + > details > summary { + display: inline-block; + list-style: none; + width: auto; + text-transform: uppercase; + font-size: 85%; + font-weight: 600; + margin: -8px -15px; + padding: 8px 15px; + } + + > details > summary:after { + content: "\f0d7"; + font-family: FontAwesome; + } + + > details[open] > summary:after { + content: "\f0d8"; + font-family: FontAwesome; + } } .ofn-drop-down-v2 { diff --git a/app/webpacker/css/admin_v3/components/spinner.scss b/app/webpacker/css/admin_v3/components/spinner.scss index fd7235ffe3..9f8d8a15e6 100644 --- a/app/webpacker/css/admin_v3/components/spinner.scss +++ b/app/webpacker/css/admin_v3/components/spinner.scss @@ -6,6 +6,11 @@ min-height: 200px; background: rgba(255, 255, 255, 0.8); z-index: 2; + + // Show when inside a loading Turbo Frame + turbo-frame[aria-busy="true"] > & { + display: flex; + } } .spinner-container { @@ -28,7 +33,9 @@ height: 56px; border-radius: 50%; border: 9px solid $teal; - animation: spinner-bulqg1 0.8s infinite linear alternate, spinner-oaa3wk 1.6s infinite linear; + animation: + spinner-bulqg1 0.8s infinite linear alternate, + spinner-oaa3wk 1.6s infinite linear; } } diff --git a/app/webpacker/css/admin_v3/components/tom_select.scss b/app/webpacker/css/admin_v3/components/tom_select.scss index dae7f18fd8..ddae48cd71 100644 --- a/app/webpacker/css/admin_v3/components/tom_select.scss +++ b/app/webpacker/css/admin_v3/components/tom_select.scss @@ -42,6 +42,9 @@ background: none; border: none; box-shadow: none; + + min-width: 10em; // Ensure content doesn't wrap too much + // We could consider always stretching to fit with width: max-content; } .ts-dropdown-content { @@ -51,6 +54,8 @@ @include border-radius($border-radius); box-shadow: $shadow-dropdown; + max-height: 21em; // Show up to 8 items without scrolling + .option { padding: 8px; border-left: 3px solid transparent; @@ -77,8 +82,8 @@ content: "\f077"; // chevron-up font-family: FontAwesome; border: none; - top: 0.7rem; - right: 0.7rem; + top: 0.7em; + right: 0.7em; font-size: 13px; } @@ -86,7 +91,7 @@ background-color: $color-body-bg; border: 1px solid $lighter-grey; box-shadow: none; - padding: 0.6rem 0.75rem; + padding: 0.6em 0.75em; &:focus { border: 1px solid $orient; @@ -101,8 +106,8 @@ max-width: 100%; .ts-control { - padding: 0.5rem 0.75rem; - padding-right: 1rem !important; // ts has a clever variable-based rule here, but it doesn't seem to work right. + padding: 0.5em 0.75em; + padding-right: 1em !important; // ts has a clever variable-based rule here, but it doesn't seem to work right. overflow: hidden; // Icon: Override TS icon with icon-chevron-down @@ -113,11 +118,11 @@ top: 1em; } &:not(.rtl)::after { - right: 1.5rem; + right: 1.9em; } .item { - margin-right: 1rem; + margin-right: 1em; // Hide overflow with an ellipsis if a width has been set overflow: hidden; text-overflow: ellipsis; @@ -134,6 +139,11 @@ // 'no-input' mode, like a native select (hide text input). .ts-wrapper.single.no-input { + .ts-control input { + // Hide input, while keeping it focusable for keyboard events. + height: 0; + } + .ts-dropdown { position: absolute; top: 0; // we don't need to see the currently selected option, because it's visible in the dropdown @@ -143,3 +153,52 @@ margin-top: 0; } } + +// Appears just like other text on the page. +// See table.products tr:hover for example of revealing them +.naked_inputs .ts-wrapper { + height: auto; + min-height: 0; + + .ts-control { + padding: ($vpadding-txt - 1px) ($hpadding-txt - 1px); // Minus 1px for border + + height: auto; + min-height: 0; + font-size: inherit; + font-weight: inherit; + border-color: transparent; + line-height: 22px; + background-color: $color-body-bg; + + &::after { + display: none; // hide until hover + top: 0.8em; + right: 1em; + font-size: 0.75em; + } + + .item { + margin-top: 0; + margin-right: 0; // full width until hover + } + + &:hover { + &::after { + display: block; + } + .item { + margin-right: 1em; + } + } + } +} + +// Display as "changed" if sibling select is marked as changed. +select.changed + .ts-wrapper { + &.single, &.multi { + .ts-control { + border-color: $color-txt-changed-brd; + } + } +} diff --git a/app/webpacker/css/admin_v3/globals/variables.scss b/app/webpacker/css/admin_v3/globals/variables.scss index bbd8fde650..41863422d4 100644 --- a/app/webpacker/css/admin_v3/globals/variables.scss +++ b/app/webpacker/css/admin_v3/globals/variables.scss @@ -82,7 +82,8 @@ $color-sel-bg: $lighter-grey !default; $color-sel-hover-bg: $lighter-grey !default; // Text inputs styles -$color-txt-brd: $color-border !default; +$color-txt-bg: $lighter-grey !default; +$color-txt-brd: $lighter-grey !default; $color-txt-text: $near-black !default; $color-txt-hover-brd: $teal !default; $color-txt-disabled-text: $medium-grey !default; diff --git a/app/webpacker/css/admin_v3/shared/forms.scss b/app/webpacker/css/admin_v3/shared/forms.scss index b6dfa00240..57cc0789db 100644 --- a/app/webpacker/css/admin_v3/shared/forms.scss +++ b/app/webpacker/css/admin_v3/shared/forms.scss @@ -13,16 +13,26 @@ input[type="date"], input[type="datetime"], input[type="time"], input[type="number"], -textarea, -fieldset { +textarea { @include border-radius($border-radius); padding: ($vpadding-txt - 1px) ($hpadding-txt - 1px); // Minus 1px for border - border: 1px solid $lighter-grey; + border: 1px solid $color-txt-brd; color: $color-txt-text; - background-color: $lighter-grey; + background-color: $color-txt-bg; font-size: 14px; line-height: 22px; + + // Appears just like other text on the page. + // See table.products tr:hover for example of revealing them + .naked_inputs & { + background-color: inherit; + height: auto; + font-size: inherit; + font-weight: inherit; + border-color: transparent; + } + &:focus { outline: none; border-color: $color-txt-hover-brd; @@ -59,18 +69,11 @@ textarea { } label { + display: inline-block; font-weight: 600; font-size: 85%; - margin-bottom: 3px; + margin-bottom: 5px; color: $near-black; - - &.inline { - display: inline-block !important; - } - - &.block { - display: block !important; - } } .label-block label { @@ -95,6 +98,7 @@ span.info { display: block; font-size: inherit; font-weight: normal; + margin-bottom: 0; } } diff --git a/app/webpacker/js/services/option_value_namer.js b/app/webpacker/js/services/option_value_namer.js new file mode 100644 index 0000000000..ba4b12fd96 --- /dev/null +++ b/app/webpacker/js/services/option_value_namer.js @@ -0,0 +1,99 @@ +import VariantUnitManager from "../../js/services/variant_unit_manager"; + +// Javascript clone of VariantUnits::OptionValueNamer, for bulk product editing. +export default class OptionValueNamer { + constructor(variant) { + this.variant = variant; + this.variantUnitManager = new VariantUnitManager(); + } + + name() { + const [value, unit] = this.option_value_value_unit(); + const separator = this.value_scaled() ? '' : ' '; + const name_fields = []; + if (value && unit) { + name_fields.push(`${value}${separator}${unit}`); + } else if (value) { + name_fields.push(value); + } + + if (this.variant.unit_description) { + name_fields.push(this.variant.unit_description); + } + return name_fields.join(' '); + } + + value_scaled() { + return !!this.variant.product.variant_unit_scale; + } + + option_value_value_unit() { + let value, unit_name; + if (this.variant.unit_value) { + if (this.variant.product.variant_unit === "weight" || this.variant.product.variant_unit === "volume") { + [value, unit_name] = this.option_value_value_unit_scaled(); + } else { + value = this.variant.unit_value; + unit_name = this.pluralize(this.variant.product.variant_unit_name, value); + } + if (value == parseInt(value, 10)) { + value = parseInt(value, 10); + } + } else { + value = unit_name = null; + } + return [value, unit_name]; + } + + pluralize(unit_name, count) { + if (count == null) { + return unit_name; + } + const unit_key = this.unit_key(unit_name); + if (!unit_key) { + return unit_name; + } + return I18n.t(["inflections", unit_key], { + count: count, + defaultValue: unit_name + }); + } + + unit_key(unit_name) { + if (!I18n.unit_keys) { + I18n.unit_keys = {}; + for (const [key, translations] of Object.entries(I18n.t("inflections"))) { + for (const [quantifier, translation] of Object.entries(translations)) { + I18n.unit_keys[translation.toLowerCase()] = key; + } + } + } + return I18n.unit_keys[unit_name.toLowerCase()]; + } + + option_value_value_unit_scaled() { + const [unit_scale, unit_name] = this.scale_for_unit_value(); + + const value = Math.round((this.variant.unit_value / unit_scale) * 100) / 100; + return [value, unit_name]; + } + + scale_for_unit_value() { + // Find the largest available and compatible unit where unit_value comes + // to >= 1 when expressed in it. + // If there is none available where this is true, use the smallest + // available unit. + const product = this.variant.product; + const scales = this.variantUnitManager.compatibleUnitScales(product.variant_unit_scale, product.variant_unit); + const variantUnitValue = this.variant.unit_value; + + // sets largestScale = last element in filtered scales array + const largestScale = scales.filter(s => variantUnitValue / s >= 1).slice(-1)[0]; + if (largestScale) { + return [largestScale, this.variantUnitManager.getUnitName(largestScale, product.variant_unit)]; + } else { + return [scales[0], this.variantUnitManager.getUnitName(scales[0], product.variant_unit)]; + } + } +} + diff --git a/app/webpacker/js/services/variant_unit_manager.js b/app/webpacker/js/services/variant_unit_manager.js new file mode 100644 index 0000000000..1711025fcd --- /dev/null +++ b/app/webpacker/js/services/variant_unit_manager.js @@ -0,0 +1,40 @@ +// Requires global variable from page: ofn_available_units_sorted + +export default class VariantUnitManager { + constructor() { + this.units = this.#loadUnits(ofn_available_units_sorted); + } + + getUnitName(scale, unitType) { + if (this.units[unitType][scale]) { + return this.units[unitType][scale]['name']; + } else { + return ''; + } + }; + + // Filter by measurement system + compatibleUnitScales(scale, unitType) { + const scaleSystem = this.units[unitType][scale]['system']; + + return Object.entries(this.units[unitType]) + .filter(([scale, scaleInfo]) => { + return scaleInfo['system'] == scaleSystem; + }) + .map(([scale, _]) => parseFloat(scale)) + .sort(); + } + + // private + + #loadUnits(units) { + // Transform unit scale to a JS Number for compatibility. This would be way simpler in Ruby or Coffeescript!! + const unitsTransformed = Object.entries(units).map(([measurement, measurementInfo]) => { + const measurementInfoTransformed = Object.fromEntries(Object.entries(measurementInfo).map(([scale, unitInfo]) => + [ parseFloat(scale), unitInfo ] + )); + return [ measurement, measurementInfoTransformed ]; + }); + return Object.fromEntries(unitsTransformed); + } +} diff --git a/config/application.rb b/config/application.rb index 1146d04c77..09d8fb5abe 100644 --- a/config/application.rb +++ b/config/application.rb @@ -249,6 +249,7 @@ module Openfoodnetwork config.active_storage.content_types_to_serve_as_binary -= ["image/svg+xml"] config.active_storage.variable_content_types += ["image/svg+xml"] config.active_storage.url_options = config.action_controller.default_url_options + config.active_storage.variant_processor = :mini_magick config.exceptions_app = self.routes diff --git a/config/initializers/haml.rb b/config/initializers/haml.rb new file mode 100644 index 0000000000..ec536959f1 --- /dev/null +++ b/config/initializers/haml.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Haml 6 treats only a small set of standard boolean attributes as such. +# Other attributes are added in full. But AngularJS distinguishes between +#
+# and +#
+# +# The latter raises errors. +# +# Adding to these attributes is officially supported: +# - https://github.com/haml/haml/releases/tag/v6.2.2 +# +Haml::BOOLEAN_ATTRIBUTES.push( + *%w[ + mailto + new-tag-rule-dialog + ng-cloak + ng-transclude + offcanvas + ofn-disable-enter + question-mark-with-tooltip-animation + scroll-after-load + textangular-links-target-blank + ] +) diff --git a/config/initializers/pagy.rb b/config/initializers/pagy.rb index ff9ed076e6..cd18f12b32 100644 --- a/config/initializers/pagy.rb +++ b/config/initializers/pagy.rb @@ -1,15 +1,18 @@ # frozen_string_literal: true +require 'pagy/extras/arel' +require 'pagy/extras/items' +require 'pagy/extras/overflow' + + # Pagy Variables # See https://ddnexus.github.io/pagy/api/pagy#variables Pagy::DEFAULT[:items] = 100 # Items extra: Allow the client to request a custom number of items per page with an optional selector UI # See https://ddnexus.github.io/pagy/extras/items -require 'pagy/extras/items' Pagy::DEFAULT[:items_param] = :per_page Pagy::DEFAULT[:max_items] = 100 # For handling requests for non-existant pages eg: page 35 when there are only 4 pages of results -require 'pagy/extras/overflow' Pagy::DEFAULT[:overflow] = :empty_page diff --git a/config/locales/ar.yml b/config/locales/ar.yml index 15acfbe95c..be4307484d 100644 --- a/config/locales/ar.yml +++ b/config/locales/ar.yml @@ -48,6 +48,9 @@ ar: variant_unit: "وحدة النوع" variant_unit_name: "اسم وحدة النوع" unit_value: "قيمةالوحدة" + spree/variant: + primary_taxon: "نوع المنتج " + shipping_category_id: "نوع الشحن" spree/credit_card: base: "بطاقة ائتمان" number: "رقم " @@ -448,6 +451,7 @@ ar: columns: name: الاسم unit: وحدة + unit_value: قيمةالوحدة price: السعر producer: المنتج category: الفئة @@ -691,15 +695,15 @@ ar: index: header: title: تحرير المنتجات بالجملة - sort: - pagination: - clear_search: مسح البحث filters: producers: label: المنتجين categories: label: التصنيفات search: بحث + sort: + pagination: + clear_search: مسح البحث table: new_variant: نوع جديد edit_image: @@ -745,6 +749,9 @@ ar: product_categories: فئات المنتجات tax_categories: فئات الضرائب shipping_categories: فئات الشحن + dfc_import_form: + enterprise: "الشركة" + import: "استيراد" import: review: مراجعة import: استيراد @@ -3596,6 +3603,7 @@ ar: new_taxon: "اصنوفة جديدة" new_user: "مستخدم جديد" no_pending_payments: "لا توجد دفعات معلقة" + remove: "إزالة" none: "لا شيء" not_found: "غير موجود" notice_messages: @@ -3612,8 +3620,6 @@ ar: start_date: "تاريخ البدء" successfully_removed: "تمت الإزالة بنجاح" taxonomy_edit: "التصنيف" - taxonomy_tree_error: "خطأ شجرة التصنيف" - taxonomy_tree_instruction: "تعليمات شجرة التصنيف" tree: "شجرة" updating: "تحديث" your_order_is_empty_add_product: "طلبك فارغ ، يرجى البحث عن المنتج أعلاه وإضافته" diff --git a/config/locales/ca.yml b/config/locales/ca.yml index c552703236..1522484fc1 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -48,6 +48,9 @@ ca: variant_unit: "Unitat de la variant" variant_unit_name: "Nom de la unitat de la variant" unit_value: "Valor de la unitat" + spree/variant: + primary_taxon: "Categoria del producte" + shipping_category_id: "Categoria d'enviament" spree/credit_card: base: "Targeta de crèdit" number: "Número" @@ -475,6 +478,7 @@ ca: columns: name: Nom unit: Unitat + unit_value: Valor de la unitat price: Preu producer: Productora category: Categoria @@ -733,13 +737,6 @@ ca: prompt: "Això l'eliminarà permanentment de la vostra llista." confirmation_text: "Suprimeix la variant" cancellation_text: "Mantenir la variant" - sort: - pagination: - total_html: "%{total} productes trobats pels vostres criteris de cerca. Mostrant de %{from} a %{to} ." - per_page: - show: Mostra - per_page: "%{num} per pàgina" - clear_search: Esborra la cerca filters: search_products: Cerca de productes search_for_producers: Cercar productors @@ -751,6 +748,13 @@ ca: categories: label: Categories search: Cerca + sort: + pagination: + total_html: "%{total} productes trobats pels vostres criteris de cerca. Mostrant de %{from} a %{to} ." + per_page: + show: Mostra + per_page: "%{num} per pàgina" + clear_search: Esborra la cerca no_products: no_products_found: No hem trobat productes table: @@ -809,6 +813,9 @@ ca: product_categories: Tipus de productes tax_categories: Tipus d'impostos shipping_categories: Tipus d'enviament + dfc_import_form: + enterprise: "Organització" + import: "Importa" import: review: Revisa import: Importa @@ -3479,6 +3486,7 @@ ca: new_taxon: "Nou tàxon" new_user: "Nou usuari" no_pending_payments: "No hi ha pagaments pendents" + remove: "Eliminar" none: "Cap" not_found: "No trobat" notice_messages: @@ -3495,8 +3503,6 @@ ca: start_date: "Data d'inici" successfully_removed: "S'ha suprimit correctament" taxonomy_edit: "Edició de taxonomia" - taxonomy_tree_error: "Error d'arbre de taxonomia" - taxonomy_tree_instruction: "Instrucció d'arbre de taxonomia" tree: "Arbre" updating: "Actualitzant" your_order_is_empty_add_product: "La comanda està buida, si us plau cerca i afegeix un producte a dalt" diff --git a/config/locales/cy.yml b/config/locales/cy.yml index a9f0b4db3f..2d774a500f 100644 --- a/config/locales/cy.yml +++ b/config/locales/cy.yml @@ -1,5 +1,8 @@ cy: language_name: "Cymraeg" + time: + formats: + long: "%B %d, %Y %-l:%M %p" activerecord: models: spree/product: Cynnyrch @@ -48,6 +51,9 @@ cy: variant_unit: "Uned Amrywiol" variant_unit_name: "Enw Uned Amrywiol" unit_value: "Gwerth yr uned" + spree/variant: + primary_taxon: "Categori Cynnyrch" + shipping_category_id: "Categori Anfon" spree/credit_card: base: "Cerdyn credyd" number: "Rhif" @@ -502,6 +508,7 @@ cy: columns: name: Enw unit: Uned + unit_value: Gwerth yr uned price: Pris producer: Cynhyrchydd category: Categori @@ -760,13 +767,6 @@ cy: prompt: "Caiff ei ddileu’n barhaol o’ch rhestr." confirmation_text: "Dileu amrywiolyn" cancellation_text: "Cadw amrywiolyn" - sort: - pagination: - total_html: "%{total}Cafwyd hyd i cynnyrch ar gyfer eich meini prawf chwilio. Yn dangos %{from} i %{to}." - per_page: - show: Dangos - per_page: "%{num} fesul tudalen" - clear_search: Clirio'r chwiliad filters: search_products: Chwilio am gynnyrch search_for_producers: Chwilio am gynhyrchwyr @@ -778,6 +778,13 @@ cy: categories: label: Categorïau search: Chwilio + sort: + pagination: + total_html: "%{total}Cafwyd hyd i cynnyrch ar gyfer eich meini prawf chwilio. Yn dangos %{from} i %{to}." + per_page: + show: Dangos + per_page: "%{num} fesul tudalen" + clear_search: Clirio'r chwiliad no_products: no_products_found: Ni chafwyd hyd i gynnyrch import_products: Mewnforio cynnyrch lluosog @@ -846,6 +853,9 @@ cy: product_categories: Categorïau Cynnyrch tax_categories: Categorïau Treth shipping_categories: Categorïau Cludo + dfc_import_form: + enterprise: "Menter" + import: "Mewnforio" import: review: Adolygu import: Mewnforio @@ -3714,6 +3724,7 @@ cy: new_taxon: "Tacson newydd" new_user: "Defnyddiwr newydd" no_pending_payments: "Dim taliadau yn yr arfaeth" + remove: "Dileu" none: "Dim" not_found: "Heb ei ganfod" notice_messages: @@ -3730,8 +3741,6 @@ cy: start_date: "Dyddiad cychwyn" successfully_removed: "Llwyddwyd i ddileu" taxonomy_edit: "Golygu tacsonomi" - taxonomy_tree_error: "Gwall - coeden tacsonomi" - taxonomy_tree_instruction: "Cyfarwyddyd - coeden tacsonomi" tree: "Coeden" updating: "Yn diweddaru" your_order_is_empty_add_product: "Mae eich archeb yn wag, chwiliwch am ac ychwanegwch gynnyrch uchod" @@ -4323,6 +4332,9 @@ cy: form: name: Enw permalink: Permalink + meta_title: Meta Title + meta_description: Meta Description + meta_keywords: Meta Keywords description: Disgrifiad general_settings: edit: diff --git a/config/locales/de_CH.yml b/config/locales/de_CH.yml index c95ba52c40..64385cd440 100644 --- a/config/locales/de_CH.yml +++ b/config/locales/de_CH.yml @@ -38,6 +38,9 @@ de_CH: shipping_category_id: "Lieferkategorie" variant_unit: "Varianteneinheit" variant_unit_name: "Name der Varianteneinheit" + spree/variant: + primary_taxon: "Produktkategorie" + shipping_category_id: "Lieferkategorie" spree/credit_card: base: "Kreditkarte" number: "Kreditkartennummer" @@ -681,15 +684,15 @@ de_CH: index: header: title: Produkte verwalten - sort: - pagination: - clear_search: Suche zurücksetzen filters: producers: label: Unsere Produzenten categories: label: Lieferkategorien search: Suche + sort: + pagination: + clear_search: Suche zurücksetzen no_products: no_products_found: Keine Produkte gefunden. table: @@ -735,6 +738,9 @@ de_CH: product_categories: Produktkategorien tax_categories: Steuerkategorien shipping_categories: Lieferkategorien + dfc_import_form: + enterprise: "Unternehmen" + import: "Importieren" import: review: Überprüfung import: Importieren @@ -881,7 +887,7 @@ de_CH: legend: "Adresse" business_details: legend: "Geschäftsdetails" - abn: USt-IdNr. + abn: MWST nr. abn_placeholder: z. B. DE999999999 acn: St.-Nr. acn_placeholder: z. B. 93815/08152 @@ -1720,7 +1726,7 @@ de_CH: invoice_shipping_category_pickup: "Abholen" total_excl_tax: "Netto (zzgl. Steuern):" total_incl_tax: "GESAMT (inkl. Steuern):" - abn: "USt-IdNr.:" + abn: "MWST nr." acn: "St.-Nr.:" invoice_issued_on: "Rechnungsdatum:" date_of_transaction: "Bestelldatum:" @@ -2351,7 +2357,7 @@ de_CH: enterprise_long_desc: "Ausführliche Beschreibung (empfohlen)" enterprise_long_desc_placeholder: "Erzählen Sie hier die Geschichte Ihres Unternehmens - was macht Sie anders und wunderbar? Wir empfehlen, die Beschreibung unter 600 Zeichen oder 150 Wörtern zu halten." enterprise_long_desc_length: "%{num} Zeichen/bis zu 600 empfohlen" - enterprise_abn: "USt-IdNr. (optional für Rechnungserstellung)" + enterprise_abn: "MWST nr. (optional für Rechnungserstellung)" enterprise_abn_placeholder: "z. B. DE999999999" enterprise_acn: "St.-Nr. (optional für Rechnungserstellung)" enterprise_acn_placeholder: "z. B. 93815/08152" @@ -3406,6 +3412,7 @@ de_CH: new_taxon: "Neue Kategorie" new_user: "Neuer Benutzer" no_pending_payments: "Keine ausstehenden Zahlungen." + remove: "Löschen" none: "Keine" not_found: "Nicht gefunden" notice_messages: @@ -3420,8 +3427,6 @@ de_CH: start_date: "Anfangsdatum" successfully_removed: "Erfolgreich gelöscht" taxonomy_edit: "Kategorien bearbeiten" - taxonomy_tree_error: "Fehler in Struktur der Kategorien" - taxonomy_tree_instruction: "Anleitung zur Struktur der Kategorien" tree: "Struktur" updating: "Aktualisierung" your_order_is_empty_add_product: "Ihre Bestellung ist leer. Suchen Sie oben ein Produkt und fügen Sie es hinzu." diff --git a/config/locales/de_DE.yml b/config/locales/de_DE.yml index 36019f4511..fde7a15eb1 100644 --- a/config/locales/de_DE.yml +++ b/config/locales/de_DE.yml @@ -51,6 +51,9 @@ de_DE: variant_unit: "Varianteneinheit" variant_unit_name: "Name der Varianteneinheit" unit_value: "Menge" + spree/variant: + primary_taxon: "Produktkategorie" + shipping_category_id: "Lieferkategorie" spree/credit_card: base: "Kreditkarte" number: "Kreditkartennummer" @@ -505,6 +508,7 @@ de_DE: columns: name: Name unit: Einheit + unit_value: Menge price: Preis producer: Produzent category: Kategorie @@ -633,7 +637,7 @@ de_DE: configuration_explanation_html: Detaillierte Anweisungen zur Konfiguration der Stripe Connect-Integration finden Sie in der Anleitung. status: Status ok: OK - instance_secret_key: Instanzgeheimschlüssel + instance_secret_key: Geheimer Schlüssel der Instanz account_id: Konto-ID business_name: Unternehmensname charges_enabled: Gebühren aktiviert @@ -752,13 +756,6 @@ de_DE: header: title: Produkte verwalten loading: Produkte werden geladen... - sort: - pagination: - total_html: "%{total} Produkte für Ihre Suchkriterien gefunden. Zeige %{from} bis %{to}." - per_page: - show: Zeige - per_page: "%{num} pro Seite" - clear_search: Suche zurücksetzen filters: search_products: Nach Produkten suchen all_producers: Alle Produzenten @@ -768,6 +765,13 @@ de_DE: categories: label: Lieferkategorien search: Suche + sort: + pagination: + total_html: "%{total} Produkte für Ihre Suchkriterien gefunden. Zeige %{from} bis %{to}." + per_page: + show: Zeige + per_page: "%{num} pro Seite" + clear_search: Suche zurücksetzen no_products: no_products_found: Keine Produkte gefunden. import_products: Produkte importieren @@ -831,6 +835,9 @@ de_DE: product_categories: Produktkategorien tax_categories: Steuerkategorien shipping_categories: Lieferkategorien + dfc_import_form: + enterprise: "Unternehmen" + import: "Importieren" import: review: Überprüfung import: Importieren @@ -1249,7 +1256,7 @@ de_DE: sell_your_produce: Verkaufen Sie Ihre eigenen Produkte producer_shop_description_text: Verkaufen Sie Ihre eigenen Produkte direkt an Ihre Kunden durch Ihren eigenen Produzentenladen im Open Food Network. producer_shop_description_text2: Ein Produzentenladen ist nur für Ihre eigenen Produkte bestimmt. Wenn Sie nur oder auch Produkte anderer verkaufen möchten, wählen Sie "Laden". - producer_hub: Produzentenladen + producer_hub: Laden producer_hub_text: Verkaufen Sie eigene Produkte und Produkte anderer producer_hub_description_text: Verkaufen Sie eigene Produkte und Produkte anderer Produzenten oder Läden im Open Food Network. Mit Ihrem Laden sind Sie ein zentraler Bestandteil Ihres lokalen Lebensmittelsystems. profile: Profil @@ -2880,7 +2887,7 @@ de_DE: report_header_billing_state: Rechnungsadresse Bundesland report_header_incoming_transport: Eingehender Transport report_header_special_instructions: Besondere Hinweise - report_header_order_number: Bestell-Nummer + report_header_order_number: Bestellnummer report_header_date: Datum report_header_confirmation_date: Bestätigungsdatum report_header_tags: Stichwörter @@ -2955,7 +2962,7 @@ de_DE: report_header_units_required: Benötigte Einheiten report_header_remainder: Rest report_header_order_date: Bestelldatum - report_header_order_id: Bestell-Nummer + report_header_order_id: Bestellnummer report_header_item_name: Produktname report_header_temp_controlled_items: Temperaturüberwachte Produkte? report_header_customer_name: Kundenname @@ -3079,7 +3086,7 @@ de_DE: order_cycles_no_permission_to_coordinate_error: "Keines Ihrer Unternehmen ist berechtigt, einen Bestellzyklus zu koordinieren." order_cycles_no_permission_to_create_error: "Sie sind nicht berechtigt, einen von diesem Unternehmen koordinierten Bestellzyklus zu erstellen." order_cycle_closed: "Der von Ihnen ausgewählte Bestellzyklus wurde gerade geschlossen. Bitte versuchen Sie es später noch einmal!" - back_to_orders_list: "Zurück zur Bestellliste" + back_to_orders_list: "Zurück zur Bestellübersicht" no_orders_found: "Keine Bestellungen gefunden." order_information: "Bestellinformationen" new_payment: "Neue Zahlung" @@ -3212,7 +3219,7 @@ de_DE: producer_shop_text2: > Ein Produzentenladen ist nur für Ihre eigenen Produkte bestimmt. Wenn Sie Produkte anderer verkaufen möchten, wählen Sie "Laden". - producer_hub: Produzentenladen + producer_hub: Laden producer_hub_text1: > Verkaufen Sie eigene Produkte und Produkte anderer Produzenten oder Läden im Open Food Network. Mit Ihrem Laden sind Sie ein zentraler Bestandteil @@ -3515,7 +3522,7 @@ de_DE: other: "Schalen" piece: one: "Stück" - other: "Stücke" + other: "Stück" pot: one: "Topf" other: "Töpfe" @@ -3656,6 +3663,7 @@ de_DE: new_taxon: "Neue Kategorie" new_user: "Neuer Benutzer" no_pending_payments: "Keine ausstehenden Zahlungen." + remove: "Löschen" none: "Keine" not_found: "Nicht gefunden" notice_messages: @@ -3672,15 +3680,13 @@ de_DE: start_date: "Anfangsdatum" successfully_removed: "Erfolgreich gelöscht" taxonomy_edit: "Kategorien bearbeiten" - taxonomy_tree_error: "Fehler in Struktur der Kategorien" - taxonomy_tree_instruction: "Anleitung zur Struktur der Kategorien" tree: "Struktur" updating: "Aktualisierung" your_order_is_empty_add_product: "Ihre Bestellung ist leer. Suchen Sie oben ein Produkt und fügen Sie es hinzu." add_product: "Produkt hinzufügen" name_or_sku: "Produktname oder Artikelnummer (geben Sie mindestens die ersten 3 Zeichen des Produktnamens ein)" resend: "Erneut senden" - back_to_orders_list: "Zurück zur Bestellliste" + back_to_orders_list: "Zurück zur Bestellübersicht" back_to_payments_list: "Zurück zur Zahlungsliste" return_authorizations: "Retouren" cannot_create_returns: "Retouren können nicht erstellt werden, da für diese Bestellung keine Lieferung bestätigt wurde." @@ -3933,7 +3939,7 @@ de_DE: index: new_return_authorization: "Neue Retour" return_authorizations: "Retouren" - back_to_orders_list: "Zurück zur Bestellliste" + back_to_orders_list: "Zurück zur Bestellübersicht" rma_number: "RMA-Nummer" status: "Status" amount: "Betrag" diff --git a/config/locales/el.yml b/config/locales/el.yml index 78961a8c1e..f8e2a3864d 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -29,6 +29,9 @@ el: shipping_category_id: "Κατηγορία μεταφορικών" variant_unit: "Μονάδα μέτρησης μεταβλητής" variant_unit_name: "Όνομα μεταβλητής" + spree/variant: + primary_taxon: "Κατηγορία προϊόντων" + shipping_category_id: "Κατηγορία μεταφορικών" spree/credit_card: base: "Κάρτα πιστωτική/χρεωστική" number: "Αριθμός" @@ -630,6 +633,9 @@ el: product_categories: Κατηγορίες προϊόντος tax_categories: Κατηγορίες Φορολόγησης shipping_categories: Κατηγορίες Μεταφορικών + dfc_import_form: + enterprise: "Επιχείρηση" + import: "Εισαγωγή" import: review: Αναθεώρηση import: Εισαγωγή @@ -3032,6 +3038,7 @@ el: new_taxon: "Νέο ταξί" new_user: "Νέος χρήστης" no_pending_payments: "Δεν υπάρχουν πληρωμές σε εκκρεμότητα" + remove: "Αφαίρεση" none: "Κανένας" not_found: "Δεν βρέθηκε" notice_messages: @@ -3046,8 +3053,6 @@ el: start_date: "Ημερομηνία έναρξης" successfully_removed: "Καταργήθηκε επιτυχώς" taxonomy_edit: "Επεξεργασία ταξινόμησης" - taxonomy_tree_error: "Σφάλμα δέντρου ταξινόμησης" - taxonomy_tree_instruction: "Οδηγίες δέντρων ταξινομίας" tree: "Δέντρο" updating: "Ενημέρωση" your_order_is_empty_add_product: "Η παραγγελία σας είναι κενή, αναζητήστε και προσθέστε ένα προϊόν παραπάνω" diff --git a/config/locales/en.yml b/config/locales/en.yml index 8d88ce2cd7..e20236b1d9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -72,6 +72,9 @@ en: variant_unit: "Variant Unit" variant_unit_name: "Variant Unit Name" unit_value: "Unit value" + spree/variant: + primary_taxon: "Product Category" + shipping_category_id: "Shipping Category" spree/credit_card: base: "Credit Card" number: "Number" @@ -232,6 +235,9 @@ en: transaction_not_allowed: "The card has been declined for an unknown reason." try_again_later: "The card has been declined for an unknown reason." withdrawal_count_limit_exceeded: "The customer has exceeded the balance or credit limit available on their card." + disconnect_failure: "Failed to disconnect Stripe." + success_code: + disconnected: "Stripe account disconnected." activemodel: errors: @@ -258,10 +264,16 @@ en: not_available_to_shop: "is not available to %{shop}" card_details: "Card details" card_type: "Card type" + card_type_is: "Card type is" + unrecognized_card_type: "Unrecognized card type" + use_new_cc: "Use a new credit card" + what_is_this: "What is this?" cardholder_name: "Cardholder name" community_forum_url: "Community forum URL" customer_instructions: "Customer instructions" additional_information: "Additional Information" + connect_app: + url: "https://n8n.openfoodnetwork.org/webhook/regen/connect-enterprise" devise: passwords: spree_user: @@ -559,7 +571,10 @@ en: colums: Columns columns: name: Name + unit_scale: Unit scale unit: Unit + unit_value: Unit value + display_as: Display unit as price: Price producer: Producer category: Category @@ -701,6 +716,7 @@ en: status: Status ok: Ok instance_secret_key: Instance Secret Key + instance_publishable_key: Instance Publishable Key account_id: Account ID business_name: Business Name charges_enabled: Charges Enabled @@ -756,6 +772,10 @@ en: user_guide: User Guide map: Map + dfc_product_imports: + index: + title: "Importing a DFC product catalog" + imported_products: "Imported products:" enterprise_fees: index: title: "Enterprise Fees" @@ -824,6 +844,7 @@ en: index: header: title: Bulk Edit Products + content: loading: Loading your products delete_modal: delete_product_modal: @@ -836,13 +857,6 @@ en: prompt: "This will permanently remove it from your list." confirmation_text: "Delete variant" cancellation_text: "Keep variant" - sort: - pagination: - total_html: "%{total} products found for your search criteria. Showing %{from} to %{to}." - per_page: - show: Show - per_page: "%{num} per page" - clear_search: Clear search filters: search_products: Search for products search_for_producers: Search for producers @@ -854,7 +868,13 @@ en: categories: label: Categories search: Search - content: + sort: + pagination: + total_html: "%{total} products found for your search criteria. Showing %{from} to %{to}." + per_page: + show: Show + per_page: "%{num} per page" + clear_search: Clear search no_products: no_products_found: No products found import_products: Import multiple products @@ -887,6 +907,8 @@ en: delete_variant: success: Successfully deleted the variant error: Unable to delete the variant + variant_row: + none_tax_category: None product_import: title: Product Import file_not_found: File not found or could not be opened @@ -928,6 +950,11 @@ en: product_categories: Product Categories tax_categories: Tax Categories shipping_categories: Shipping Categories + dfc_import_form: + title: "Import from DFC catalog" + enterprise: "Enterprise" + catalog_url: "DFC catalog URL" + import: "Import" import: review: Review import: Import @@ -1234,6 +1261,7 @@ en: open_date: "Open Date" close_date: "Close Date" display_ordering_in_shopfront: "Display ordering in shopfront:" + shopfront_sort_by_product: "By product" shopfront_sort_by_category: "By category" shopfront_sort_by_producer: "By producer" shopfront_sort_by_category_placeholder: "Category" @@ -2608,6 +2636,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using orders_bought_already_confirmed: "* already confirmed" orders_confirm_cancel: "Are you sure you want to cancel this order?" order_processed_successfully: "Your order has been processed successfully" + thank_you_for_your_order: "Thank you for your order" products_cart_distributor_choice: "Distributor for your order:" products_cart_distributor_change: "Your distributor for this order will be changed to %{name} if you add this product to your cart." @@ -3852,6 +3881,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using editing_tax_category: "Editing tax category" editing_tax_rate: "Editing tax rate" editing_zone: "Editing zone" + editing_state: "Editing State" expiration: "Expiration" invalid_payment_provider: "Invalid payment provider" items_cannot_be_shipped: "Items cannot be shipped" @@ -3863,7 +3893,8 @@ See the %{link} to find out more about %{sitename}'s features and to start using new_taxon: "New taxon" new_user: "New user" no_pending_payments: "No pending payments" - "none": "None" + remove: "Remove" + none: "None" not_found: "Not found" notice_messages: variant_deleted: "Variant deleted" @@ -3879,8 +3910,8 @@ See the %{link} to find out more about %{sitename}'s features and to start using start_date: "Start date" successfully_removed: "Successfully Removed" taxonomy_edit: "Taxonomy edit" - taxonomy_tree_error: "Taxonomy tree error" - taxonomy_tree_instruction: "Taxonomy tree instruction" + taxonomy_tree_error: "There was an error updating the taxonomy tree." + taxonomy_tree_instruction: "Right-click on an item to add, rename, remove or edit." tree: "Tree" updating: "Updating" your_order_is_empty_add_product: "Your order is empty, please search for and add a product above" @@ -3889,6 +3920,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using resend: "Resend" back_to_orders_list: "Back To Orders List" back_to_payments_list: "Back To Payments List" + back_to_states_list: "Back To States List" return_authorizations: "Return Authorizations" cannot_create_returns: "Cannot create returns as this order has no shipped units." select_stock: "Select stock" diff --git a/config/locales/en_AU.yml b/config/locales/en_AU.yml index 21963297cd..553225c846 100644 --- a/config/locales/en_AU.yml +++ b/config/locales/en_AU.yml @@ -33,6 +33,9 @@ en_AU: shipping_category_id: "Shipping Category" variant_unit: "Variant Unit" variant_unit_name: "Variant Unit Name" + spree/variant: + primary_taxon: "Product Category" + shipping_category_id: "Shipping Category" spree/credit_card: base: "Credit Card" number: "Number" @@ -410,7 +413,7 @@ en_AU: enable_embedded_shopfronts: "Enable Embedded Shopfronts" embedded_shopfronts_whitelist: "External Domains Whitelist" number_localization: - number_localization_settings: "Number Localization Settings" + number_localization_settings: "Number Localisation Settings" enable_localized_number: "Use the international thousand/decimal separator logic" invoice_settings: edit: @@ -542,15 +545,15 @@ en_AU: index: header: title: Bulk Edit Products - sort: - pagination: - clear_search: Clear search filters: producers: label: Producers categories: label: Categories search: Search + sort: + pagination: + clear_search: Clear search table: new_variant: New variant edit_image: @@ -594,6 +597,9 @@ en_AU: product_categories: Product Categories tax_categories: Tax Categories shipping_categories: Shipping Categories + dfc_import_form: + enterprise: "Enterprise" + import: "Import" import: review: Review import: Import @@ -743,7 +749,7 @@ en_AU: acn: ACN acn_placeholder: eg. 123 456 789 display_invoice_logo: Display logo in invoices - invoice_text: Add customized text at the end of invoices + invoice_text: Add customised text at the end of invoices terms_and_conditions: "Terms and Conditions" remove_terms_and_conditions: "Remove File" uploaded_on: "uploaded on" @@ -3100,6 +3106,7 @@ en_AU: credit: "Credit" more: "More" no_pending_payments: "No pending payments" + remove: "Remove" none: "None" updating: "Updating" your_order_is_empty_add_product: "Your order is empty, please search for and add a product above" diff --git a/config/locales/en_BE.yml b/config/locales/en_BE.yml index d34967e6ae..3eedba8b4e 100644 --- a/config/locales/en_BE.yml +++ b/config/locales/en_BE.yml @@ -32,6 +32,9 @@ en_BE: shipping_category_id: "Shipping Category" variant_unit: "Variant Unit" variant_unit_name: "Variant Unit Name" + spree/variant: + primary_taxon: "Product Category" + shipping_category_id: "Shipping Category" spree/credit_card: base: "Credit Card" number: "Number" @@ -552,6 +555,9 @@ en_BE: product_categories: Product Categories tax_categories: Tax Categories shipping_categories: Shipping Categories + dfc_import_form: + enterprise: "Enterprise" + import: "Import" import: review: Review import: Import @@ -2853,6 +2859,7 @@ en_BE: category: "Category" credit: "Credit" more: "More" + remove: "Remove" none: "None" updating: "Updating" your_order_is_empty_add_product: "Your order is empty, please search for and add a product above" diff --git a/config/locales/en_CA.yml b/config/locales/en_CA.yml index 386ae48429..29a11fa88f 100644 --- a/config/locales/en_CA.yml +++ b/config/locales/en_CA.yml @@ -51,6 +51,9 @@ en_CA: variant_unit: "Variant Unit" variant_unit_name: "Variant Unit Name" unit_value: "Unit value" + spree/variant: + primary_taxon: "Product Category" + shipping_category_id: "Shipping Category" spree/credit_card: base: "Credit Card" number: "Number" @@ -191,6 +194,9 @@ en_CA: transaction_not_allowed: "The card has been declined for an unknown reason." try_again_later: "The card has been declined for an unknown reason." withdrawal_count_limit_exceeded: "The customer has exceeded the balance or credit limit available on their card." + disconnect_failure: "Failed to disconnecct Stripe." + success_code: + disconnected: "Stripe account disconnected." activemodel: errors: messages: @@ -220,6 +226,8 @@ en_CA: community_forum_url: "Community forum URL" customer_instructions: "Customer instructions" additional_information: "Additional information" + connect_app: + url: "https://n8n.opernfoodnetwork.org/webhook/regen-CAN/connect-enterprise" devise: passwords: spree_user: @@ -509,7 +517,10 @@ en_CA: colums: Columns columns: name: Name + unit_scale: Unit scale unit: Unit + unit_value: Unit value + display_as: Display unit as price: Price producer: Producer category: Category @@ -691,6 +702,10 @@ en_CA: your_content: Your content user_guide: User Guide map: Map + dfc_product_imports: + index: + title: "Importing a DFC product catalog" + imported_products: "Imported products:" enterprise_fees: index: title: "Enterprise Fees" @@ -768,13 +783,6 @@ en_CA: prompt: "This will permanently remove it from your list." confirmation_text: "Delete variant" cancellation_text: "Keep variant" - sort: - pagination: - total_html: "%{total} products found for your search criteria. Showing %{from} to %{to}." - per_page: - show: Show - per_page: "%{num} per page" - clear_search: Clear search filters: search_products: Search for products search_for_producers: Search for producers @@ -786,6 +794,13 @@ en_CA: categories: label: Categories search: Search + sort: + pagination: + total_html: "%{total} products found for your search criteria. Showing %{from} to %{to}." + per_page: + show: Show + per_page: "%{num} per page" + clear_search: Clear search no_products: no_products_found: No products found import_products: Import multiple products @@ -857,6 +872,11 @@ en_CA: product_categories: Product Categories tax_categories: Tax Categories shipping_categories: Shipping Categories + dfc_import_form: + title: "Import from DFC catalog" + enterprise: "Enterprise" + catalog_url: "DFC catalog URL" + import: "Import" import: review: Review import: Import @@ -1165,6 +1185,7 @@ en_CA: open_date: "Open Date" close_date: "Close Date" display_ordering_in_shopfront: "Display ordering in shopfront:" + shopfront_sort_by_product: "By product" shopfront_sort_by_category: "By category" shopfront_sort_by_producer: "By producer" shopfront_sort_by_category_placeholder: "Category" @@ -1640,9 +1661,15 @@ en_CA: index: title: "OIDC Settings" connect: "Connect Your Account" + disconnect: "Disconnect" + connected: "Your account is linked to %{uid}." les_communs_link: "Les Communs Open ID server" link_your_account: "First you need to link your account with the authorization provider used by DFC (Les Communs Open ID Connect)." link_account_button: "Link your Les Communs OIDC Account" + note_expiry: | + Tokens to access connected apps have expired. Please refresh your + account connection to keep all integrations working. + refresh: "Refresh authorisation" view_account: "To view your account, see:" subscriptions: index: @@ -3699,6 +3726,7 @@ en_CA: new_taxon: "New taxon" new_user: "New user" no_pending_payments: "No pending payments" + remove: "Remove" none: "None" not_found: "Not found" notice_messages: @@ -3715,8 +3743,8 @@ en_CA: start_date: "Start date" successfully_removed: "Successfully Removed" taxonomy_edit: "Taxonomy edit" - taxonomy_tree_error: "Taxonomy tree error" - taxonomy_tree_instruction: "Taxonomy tree instruction" + taxonomy_tree_error: "There was an error updating the taxonomy tree." + taxonomy_tree_instruction: "Right-click on an item to add, rename, remove or edit." tree: "Tree" updating: "Updating" your_order_is_empty_add_product: "Your order is empty, please search for and add a product above" diff --git a/config/locales/en_DE.yml b/config/locales/en_DE.yml index 68cb723338..80ac27c6ed 100644 --- a/config/locales/en_DE.yml +++ b/config/locales/en_DE.yml @@ -32,6 +32,9 @@ en_DE: shipping_category_id: "Shipping Category" variant_unit: "Variant Unit" variant_unit_name: "Variant Unit Name" + spree/variant: + primary_taxon: "Product Category" + shipping_category_id: "Shipping Category" spree/credit_card: base: "Credit Card" number: "Number" @@ -559,6 +562,9 @@ en_DE: product_categories: Product Categories tax_categories: Tax Categories shipping_categories: Shipping Categories + dfc_import_form: + enterprise: "Enterprise" + import: "Import" import: review: Review import: Import @@ -2862,6 +2868,7 @@ en_DE: category: "Category" credit: "Credit" more: "More" + remove: "Remove" none: "None" updating: "Updating" your_order_is_empty_add_product: "Your order is empty, please search for and add a product above" diff --git a/config/locales/en_FR.yml b/config/locales/en_FR.yml index 7206cfc306..1a50fd6267 100644 --- a/config/locales/en_FR.yml +++ b/config/locales/en_FR.yml @@ -51,6 +51,9 @@ en_FR: variant_unit: "Variant Unit" variant_unit_name: "Variant Unit Name" unit_value: "Unit value" + spree/variant: + primary_taxon: "Product Category" + shipping_category_id: "Shipping Category" spree/credit_card: base: "Credit Card" number: "Number" @@ -191,6 +194,9 @@ en_FR: transaction_not_allowed: "The card has been declined for an unknown reason." try_again_later: "The card has been declined for an unknown reason." withdrawal_count_limit_exceeded: "The customer has exceeded the balance or credit limit available on their card." + disconnect_failure: "Failed to disconnect Stripe." + success_code: + disconnected: "Stripe account disconnected." activemodel: errors: messages: @@ -216,10 +222,16 @@ en_FR: not_available_to_shop: "is not available to %{shop}" card_details: "Card details" card_type: "Card type" + card_type_is: "Card type is" + unrecognized_card_type: "Unrecognized card type" + use_new_cc: "Use a new credit card" + what_is_this: "What is this?" cardholder_name: "Cardholder name" community_forum_url: "Community forum URL" customer_instructions: "Customer instructions" additional_information: "Additional Information" + connect_app: + url: "https://n8n.openfoodnetwork.org/webhook/regen/connect-enterprise" devise: passwords: spree_user: @@ -509,7 +521,10 @@ en_FR: colums: Columns columns: name: Name + unit_scale: Unit scale unit: Unit + unit_value: Unit value + display_as: Display unit as price: Price producer: Producer category: Category @@ -639,6 +654,7 @@ en_FR: status: Status ok: Ok instance_secret_key: Instance Secret Key + instance_publishable_key: Instance Publishable Key account_id: Account ID business_name: Business Name charges_enabled: Charges Enabled @@ -691,6 +707,10 @@ en_FR: your_content: Your content user_guide: User Guide map: Map + dfc_product_imports: + index: + title: "Importing a DFC product catalog" + imported_products: "Imported products:" enterprise_fees: index: title: "Enterprise Fees" @@ -768,13 +788,6 @@ en_FR: prompt: "This will permanently remove it from your list." confirmation_text: "Delete variant" cancellation_text: "Keep variant" - sort: - pagination: - total_html: "%{total} products found for your search criteria. Showing %{from} to %{to}." - per_page: - show: Show - per_page: "%{num} per page" - clear_search: Clear search filters: search_products: Search for products search_for_producers: Search for producers @@ -786,6 +799,13 @@ en_FR: categories: label: Categories search: Search + sort: + pagination: + total_html: "%{total} products found for your search criteria. Showing %{from} to %{to}." + per_page: + show: Show + per_page: "%{num} per page" + clear_search: Clear search no_products: no_products_found: No products found import_products: Import multiple products @@ -857,6 +877,11 @@ en_FR: product_categories: Product Categories tax_categories: Tax Categories shipping_categories: Shipping Categories + dfc_import_form: + title: "Import from DFC catalog" + enterprise: "Enterprise" + catalog_url: "DFC catalog URL" + import: "Import" import: review: Review import: Import @@ -1165,6 +1190,7 @@ en_FR: open_date: "Open Date" close_date: "Close Date" display_ordering_in_shopfront: "Display ordering in shopfront:" + shopfront_sort_by_product: "By product" shopfront_sort_by_category: "By category" shopfront_sort_by_producer: "By producer" shopfront_sort_by_category_placeholder: "Category" @@ -2471,6 +2497,7 @@ en_FR: orders_bought_already_confirmed: "* already confirmed" orders_confirm_cancel: "Are you sure you want to cancel this order?" order_processed_successfully: "Your order has been processed successfully" + thank_you_for_your_order: "Thank you for your order" products_cart_distributor_choice: "Distributor for your order:" products_cart_distributor_change: "Your distributor for this order will be changed to %{name} if you add this product to your cart." products_cart_distributor_is: "Your distributor for this order is %{name}." @@ -3695,6 +3722,7 @@ en_FR: editing_tax_category: "Editing tax category" editing_tax_rate: "Editing tax rate" editing_zone: "Editing zone" + editing_state: "Editing State" expiration: "Expiration" invalid_payment_provider: "Invalid payment provider" items_cannot_be_shipped: "Items cannot be shipped" @@ -3706,6 +3734,7 @@ en_FR: new_taxon: "New taxon" new_user: "New user" no_pending_payments: "No pending payments" + remove: "Remove" none: "None" not_found: "Not found" notice_messages: @@ -3722,8 +3751,8 @@ en_FR: start_date: "Start date" successfully_removed: "Successfully Removed" taxonomy_edit: "Taxonomy edit" - taxonomy_tree_error: "Taxonomy tree error" - taxonomy_tree_instruction: "Taxonomy tree instruction" + taxonomy_tree_error: "There was an error updating the taxonomy tree." + taxonomy_tree_instruction: "Right-click on an item to add, rename, remove or edit." tree: "Tree" updating: "Updating" your_order_is_empty_add_product: "Your order is empty, please search for and add a product above" @@ -3732,6 +3761,7 @@ en_FR: resend: "Resend" back_to_orders_list: "Back To Orders List" back_to_payments_list: "Back To Payments List" + back_to_states_list: "Back To States List" return_authorizations: "Return Authorizations" cannot_create_returns: "Cannot create returns as this order has no shipped units." select_stock: "Select stock" diff --git a/config/locales/en_GB.yml b/config/locales/en_GB.yml index 054eb82938..3530fc640f 100644 --- a/config/locales/en_GB.yml +++ b/config/locales/en_GB.yml @@ -48,6 +48,9 @@ en_GB: variant_unit: "Variant Unit" variant_unit_name: "Variant Unit Name" unit_value: "Unit value" + spree/variant: + primary_taxon: "Product Category" + shipping_category_id: "Shipping Category" spree/credit_card: base: "Credit Card" number: "Number" @@ -75,6 +78,10 @@ en_GB: models: enterprise_fee: inherit_tax_requires_per_item_calculator: "Inheriting the tax category requires a per-item calculator." + spree/image: + attributes: + attachment: + integrity_error: "failed to load. Please check to ensure the file is not corrupt, and try again." spree/user: attributes: email: @@ -384,6 +391,7 @@ en_GB: cancel_order: "Cancel Order" confirm_send_invoice: "An invoice for this order will be sent to the customer. Are you sure you want to continue?" confirm_resend_order_confirmation: "Are you sure you want to resend the order confirmation email?" + must_have_valid_business_number: "%{enterprise_name} must have a valid company number or charity number before invoices can be used." invoice: "Invoice" invoices: "Invoices" file: "File" @@ -501,7 +509,10 @@ en_GB: colums: Columns columns: name: Name + unit_scale: Unit scale unit: Unit + unit_value: Unit value + display_as: Display unit as price: Price producer: Producer category: Category @@ -683,6 +694,9 @@ en_GB: your_content: Your content user_guide: User Guide map: Map + dfc_product_imports: + index: + imported_products: "Imported products:" enterprise_fees: index: title: "Enterprise Fees" @@ -759,13 +773,7 @@ en_GB: heading: "Delete variant" prompt: "This will permanently remove it from your list." confirmation_text: "Delete variant" - sort: - pagination: - total_html: "%{total}productsfound for your search criteria. Showing %{from}to%{to}." - per_page: - show: Show - per_page: "%{num}per page" - clear_search: Clear search + cancellation_text: "Keep variant" filters: search_products: Search for products search_for_producers: Search for producers @@ -777,6 +785,13 @@ en_GB: categories: label: Categories search: Search + sort: + pagination: + total_html: "%{total}productsfound for your search criteria. Showing %{from}to%{to}." + per_page: + show: Show + per_page: "%{num}per page" + clear_search: Clear search no_products: no_products_found: No products found import_products: Import multiple products @@ -845,6 +860,9 @@ en_GB: product_categories: Product Categories tax_categories: Tax Categories shipping_categories: Shipping Categories + dfc_import_form: + enterprise: "Enterprise" + import: "Import" import: review: Review import: Import @@ -1628,9 +1646,15 @@ en_GB: index: title: "OIDC Settings" connect: "Connect Your Account" + disconnect: "Disconnect" + connected: "Your account is linked to %{uid}" les_communs_link: "Les Communs Open ID server" link_your_account: "You need first to link your account with the authorisation provider used by DFC (Les Communs Open ID Connect)." link_account_button: "Link your Les Communs OIDC Account" + note_expiry: | + Tokens to access connected apps have expired. Please refresh your account + connection to keep all integrations working. + refresh: "Refresh authorisation" view_account: "To view your account, see:" subscriptions: index: @@ -2173,6 +2197,7 @@ en_GB: order_back_to_website: Back To Website checkout_details_title: Checkout Details checkout_payment_title: Checkout Payment + checkout_summary_title: Checkout Summary bom_tip: "Use this page to alter product quantities across multiple orders. Products may also be removed from orders entirely, if required." unsaved_changes_warning: "Unsaved changes exist and will be lost if you continue." unsaved_changes_error: "Fields with red borders contain errors." @@ -3693,6 +3718,7 @@ en_GB: new_taxon: "New taxon" new_user: "New user" no_pending_payments: "No pending payments" + remove: "Remove" none: "None" not_found: "Not found" notice_messages: @@ -3709,8 +3735,8 @@ en_GB: start_date: "Start date" successfully_removed: "Successfully Removed" taxonomy_edit: "Taxonomy edit" - taxonomy_tree_error: "Taxonomy tree error" - taxonomy_tree_instruction: "Taxonomy tree instruction" + taxonomy_tree_error: "There was an error updating the taxonomy tree." + taxonomy_tree_instruction: "Right-click on an item to add, rename, remove or edit." tree: "Tree" updating: "Updating" your_order_is_empty_add_product: "Your order is empty, please search for and add a product above" @@ -4005,6 +4031,9 @@ en_GB: add_product: cannot_add_item_to_canceled_order: "Cannot add item to canceled order" include_out_of_stock_variants: "Include variants with no available stock" + shipment: + mark_as_shipped_message_html: "This will mark the order as Shipped.
Are you sure you want to proceed?" + mark_as_shipped_label_message: "Send a shipment/pick up notification email to the customer." index: listing_orders: "Listing Orders" new_order: "New Order" @@ -4302,7 +4331,11 @@ en_GB: form: name: Name permalink: Permalink + meta_title: Meta Title + meta_description: Meta Description + meta_keywords: Meta Keywords description: Description + dfc_id: DFC URI general_settings: edit: legal_settings: "Legal Settings" @@ -4598,3 +4631,6 @@ en_GB: pagination: next: Next previous: Previous + invisible_captcha: + sentence_for_humans: "Please leave empty" + timestamp_error_message: "Please try again after 5 seconds." diff --git a/config/locales/en_IE.yml b/config/locales/en_IE.yml index 92b1d59807..d58402827c 100644 --- a/config/locales/en_IE.yml +++ b/config/locales/en_IE.yml @@ -1,5 +1,8 @@ en_IE: language_name: "English" + time: + formats: + long: "%B %d, %Y %-l:%M %p" activerecord: models: spree/product: Product @@ -48,6 +51,9 @@ en_IE: variant_unit: "Variant Unit" variant_unit_name: "Variant Unit Name" unit_value: "Unit value" + spree/variant: + primary_taxon: "Product Category" + shipping_category_id: "Shipping Category" spree/credit_card: base: "Credit Card" number: "Number" @@ -75,6 +81,10 @@ en_IE: models: enterprise_fee: inherit_tax_requires_per_item_calculator: "Inheriting the tax categeory requires a per-item calculator." + spree/image: + attributes: + attachment: + integrity_error: "failed to load. Please check to ensure the file is not corrupt, and try again." spree/user: attributes: email: @@ -384,6 +394,7 @@ en_IE: cancel_order: "Cancel Order" confirm_send_invoice: "An invoice for this order will be sent to the customer. Are you sure you want to continue?" confirm_resend_order_confirmation: "Are you sure you want to resend the order confirmation email?" + must_have_valid_business_number: "%{enterprise_name} must have a company number before invoices can be used." invoice: "Invoice" invoices: "Invoices" file: "File" @@ -501,7 +512,9 @@ en_IE: colums: Columns columns: name: Name + unit_scale: Unit scale unit: Unit + unit_value: Unit value price: Price producer: Producer category: Category @@ -593,6 +606,9 @@ en_IE: has_n_rules: "has %{num} rules" unsaved_confirm_leave: "There are unsaved changed on this page. Continue without saving?" available_units: "Available Units" + terms_of_service_have_been_updated_html: "Open Food Network's Terms of Service have been updated: %{tos_link}" + terms_of_service: Read Terms of Service + accept_terms_of_service: Accept Terms of Service shopfront_settings: embedded_shopfront_settings: "Embedded Shopfront Settings" enable_embedded_shopfronts: "Enable Embedded Shopfronts" @@ -617,7 +633,7 @@ en_IE: title: "Invoice Settings" enable_invoices?: "Enable Invoices?" invoice_style2?: "Use the alternative invoice model that includes total tax breakdown per rate and tax rate info per item (not yet suitable for countries displaying prices excluding tax)" - enterprise_number_required_on_invoices?: "Require an ABN to generate an invoice?" + enterprise_number_required_on_invoices?: "Require a company number to generate an invoice?" stripe_connect_settings: edit: title: "Stripe Connect" @@ -746,6 +762,28 @@ en_IE: header: title: Bulk Edit Products loading: Loading your products + delete_modal: + delete_product_modal: + heading: "Delete product" + prompt: "This will permanently remove it from your list." + confirmation_text: "Delete product" + cancellation_text: "Keep product" + delete_variant_modal: + heading: "Delete variant" + prompt: "This will permanently remove it from your list." + confirmation_text: "Delete variant" + cancellation_text: "Keep variant" + filters: + search_products: Search for products + search_for_producers: Search for producers + all_producers: All producers + search_for_categories: Search for categories + all_categories: All categories + producers: + label: Producers + categories: + label: Categories + search: Search sort: pagination: total_html: "%{total} products found for your search criteria. Showing %{from} to %{to}." @@ -753,15 +791,6 @@ en_IE: show: Show per_page: "%{num} per page" clear_search: Clear search - filters: - search_products: Search for products - all_producers: All producers - all_categories: All categories - producers: - label: Producers - categories: - label: Categories - search: Search no_products: no_products_found: No products found import_products: Import multiple products @@ -780,8 +809,18 @@ en_IE: reset: Discard changes save: Save changes new_variant: New variant + bulk_update: + success: Changes saved edit_image: + title: Edit product photo close: Back + upload: Upload photo + delete_product: + success: Successfully deleted the product + error: Unable to delete the product + delete_variant: + success: Successfully deleted the variant + error: Unable to delete the variant product_import: title: Product Import file_not_found: File not found or could not be opened @@ -823,6 +862,9 @@ en_IE: product_categories: Product Categories tax_categories: Tax Categories shipping_categories: Shipping Categories + dfc_import_form: + enterprise: "Enterprise" + import: "Import" import: review: Review import: Import @@ -1027,6 +1069,7 @@ en_IE: images: legend: "Images" logo: Logo + logo_size: "300 x 300 pixels" promo_image_placeholder: 'This image is displayed in "About Us"' promo_image_note1: 'PLEASE NOTE:' promo_image_note2: Any promo image uploaded here will be cropped to 1200 x 260. @@ -1212,7 +1255,28 @@ en_IE: custom_tab_title: "Title for custom tab" custom_tab_content: "Content for custom tab" connected_apps: + legend: "Connected apps" + title: "Discover Regenerative" + tagline: "Allow Discover Regenerative to publish your enterprise information." + enable: "Allow data sharing" + disable: "Stop sharing" loading: "Loading" + note: | + Your Open Food Network account is connected to Discover Regenerative. + Add or update information on your Discover Regenerative listing here. + link_label: "Manage listing" + description_html: | +

+ Eligible producers can showcase their regenerative credentials, + farming practices and more through a profile listing. + Simplifying how buyers can find regenerative produce and connect + with producers of interest. +

+

+ Learn more about Discover Regenerative + +

actions: edit_profile: Settings properties: Properties @@ -1442,6 +1506,8 @@ en_IE: has_no_payment_methods: "%{enterprise} has no payment methods" has_no_shipping_methods: "%{enterprise} has no shipping methods" has_no_enterprise_fees: "%{enterprise} has no enterprise fees" + flashes: + dismiss: Dismiss side_menu: enterprise: primary_details: "Primary Details" @@ -1462,6 +1528,7 @@ en_IE: users: "Users" vouchers: Vouchers white_label: "White Label" + connected_apps: "Connected apps" enterprise_group: primary_details: "Primary Details" users: "Users" @@ -1581,9 +1648,15 @@ en_IE: index: title: "OIDC Settings" connect: "Connect Your Account" + disconnect: "Disconnect" + connected: "Your account is linked to %{uid}." les_communs_link: "Les Communs Open ID server" link_your_account: "You need first to link your account with the authorization provider used by DFC (Les Communs Open ID Connect)." link_account_button: "Link your Les Communs OIDC Account" + note_expiry: | + Tokens to access connected apps have expired. Please refresh your + account connection to keep all integrations working. + refresh: "Refresh authorisation" view_account: "To view your account, see:" subscriptions: index: @@ -1900,6 +1973,7 @@ en_IE: invoice_column_price_per_unit_without_taxes: "Price Per unit (Excl. tax)" invoice_column_tax_rate: "Tax rate" invoice_tax_total: "VAT Total:" + invoice_cancel_and_replace_invoice: "cancels and replaces invoice" tax_invoice: "TAX INVOICE" tax_total: "Total tax (%{rate}):" invoice_shipping_category_delivery: "Delivery" @@ -1922,8 +1996,8 @@ en_IE: menu_4_url: "/groups" menu_5_title: "About" menu_5_url: "https://about.openfoodnetwork.ie" - menu_6_title: "Blog" - menu_6_url: "https://about.openfoodnetwork.ie/blog" + menu_6_title: "Resources" + menu_6_url: "https://about.openfoodnetwork.ie/resources" menu_7_title: "Support" menu_7_url: "https://about.openfoodnetwork.ie/support" logo: "Logo (640x130)" @@ -2123,6 +2197,9 @@ en_IE: order_back_to_store: Back To Store order_back_to_cart: Back To Cart order_back_to_website: Back To Website + checkout_details_title: Checkout Details + checkout_payment_title: Checkout Payment + checkout_summary_title: Checkout Summary bom_tip: "Use this page to alter product quantities across multiple orders. Products may also be removed from orders entirely, if required." unsaved_changes_warning: "Unsaved changes exist and will be lost if you continue." unsaved_changes_error: "Fields with red borders contain errors." @@ -2985,6 +3062,8 @@ en_IE: report_header_transaction_fee: Transaction Fee (no tax) report_header_total_untaxable_admin: Total untaxable admin adjustments (no tax) report_header_total_taxable_admin: Total taxable admin adjustments (tax inclusive) + report_header_voucher_label: Voucher Label + report_header_voucher_amount: "Voucher Amount (%{currency_symbol})" report_line_cost_of_produce: Cost of produce report_line_line_items: line items report_header_last_completed_order_date: Last completed order date @@ -3306,6 +3385,7 @@ en_IE: processing: "processing" void: "void" invalid: "invalid" + quantity_unavailable: "Insufficient stock available. Line item unsaved!" quantity_unchanged: "Quantity unchanged from previous amount." cancel_the_order_html: "This will cancel the current order.
Are you sure you want to proceed?" cancel_the_order_send_cancelation_email: "Send a cancellation email to the customer" @@ -3640,6 +3720,7 @@ en_IE: new_taxon: "New taxon" new_user: "New user" no_pending_payments: "No pending payments" + remove: "Remove" none: "None" not_found: "Not found" notice_messages: @@ -3656,8 +3737,8 @@ en_IE: start_date: "Start date" successfully_removed: "Successfully Removed" taxonomy_edit: "Taxonomy edit" - taxonomy_tree_error: "Taxonomy tree error" - taxonomy_tree_instruction: "Taxonomy tree instruction" + taxonomy_tree_error: "There was an error updating the taxonomy tree." + taxonomy_tree_instruction: "Right-click on an item to add, rename, remove or edit." tree: "Tree" updating: "Updating" your_order_is_empty_add_product: "Your order is empty, please search for and add a product above" @@ -3710,6 +3791,7 @@ en_IE: credit_card: "Credit Card" new_payment: "New Payment" capture: "Capture" + capture_and_complete_order: "Capture and complete order" void: "Void" login: "Login" password: "Password" @@ -3951,6 +4033,9 @@ en_IE: add_product: cannot_add_item_to_canceled_order: "Cannot add item to canceled order" include_out_of_stock_variants: "Include variants with no available stock" + shipment: + mark_as_shipped_message_html: "This will mark the order as Shipped.
Are you sure you want to proceed?" + mark_as_shipped_label_message: "Send a shipment/pick up notification email to the customer." index: listing_orders: "Listing Orders" new_order: "New Order" @@ -4009,6 +4094,9 @@ en_IE: line_item_adjustments: "Line Item Adjustments" order_adjustments: "Order Adjustments" order_total: "Order Total" + invoices: + index: + order_has_changed: "The order has changed since the last invoice update. The invoice shown here might not be up-to-date anymore." overview: enterprises_header: ofn_with_tip: Enterprises are Producers and/or Hubs and are the basic unit of organisation within the Open Food Network. @@ -4017,6 +4105,7 @@ en_IE: has_no_payment_methods: "has no payment methods" has_no_shipping_methods: "has no shipping methods" products: + products_tip: "The products that you sell through the Open Food Network." active_products: zero: "You don't have any active products." one: "You have one active product" @@ -4169,6 +4258,8 @@ en_IE: bulk_unit_size: Bulk unit size display_as: display_as: Display As + clone: + success: Product cloned reports: table: select_and_search: "Select filters and click on %{option} to access your data." @@ -4242,7 +4333,11 @@ en_IE: form: name: Name permalink: Permalink + meta_title: Meta Title + meta_description: Meta Description + meta_keywords: Meta Keywords description: Description + dfc_id: DFC URI general_settings: edit: legal_settings: "Legal Settings" @@ -4538,3 +4633,6 @@ en_IE: pagination: next: Next previous: Previous + invisible_captcha: + sentence_for_humans: "Please leave empty" + timestamp_error_message: "Please try again after 5 seconds." diff --git a/config/locales/en_IN.yml b/config/locales/en_IN.yml index e139bb021d..64b8d02c11 100644 --- a/config/locales/en_IN.yml +++ b/config/locales/en_IN.yml @@ -32,6 +32,9 @@ en_IN: shipping_category_id: "Shipping Category" variant_unit: "Variant Unit" variant_unit_name: "Variant Unit Name" + spree/variant: + primary_taxon: "Product Category" + shipping_category_id: "Shipping Category" spree/credit_card: base: "Credit Card" number: "Number" @@ -526,15 +529,15 @@ en_IN: index: header: title: Bulk Edit Products - sort: - pagination: - clear_search: Clear search filters: producers: label: Producers categories: label: Categories search: Search + sort: + pagination: + clear_search: Clear search table: new_variant: New variant edit_image: @@ -578,6 +581,9 @@ en_IN: product_categories: Product Categories tax_categories: Tax Categories shipping_categories: Shipping Categories + dfc_import_form: + enterprise: "Enterprise" + import: "Import" import: review: Review import: Import @@ -3027,6 +3033,7 @@ en_IN: credit: "Credit" more: "More" no_pending_payments: "No pending payments" + remove: "Remove" none: "None" updating: "Updating" your_order_is_empty_add_product: "Your order is empty, please search for and add a product above" diff --git a/config/locales/en_NZ.yml b/config/locales/en_NZ.yml index 4f54e8810b..0abd85c023 100644 --- a/config/locales/en_NZ.yml +++ b/config/locales/en_NZ.yml @@ -34,6 +34,9 @@ en_NZ: shipping_category_id: "Shipping Category" variant_unit: "Variant Unit" variant_unit_name: "Variant Unit Name" + spree/variant: + primary_taxon: "Product Category" + shipping_category_id: "Shipping Category" spree/credit_card: base: "Credit Card" number: "Number" @@ -679,15 +682,15 @@ en_NZ: index: header: title: Bulk Edit Products - sort: - pagination: - clear_search: Clear search filters: producers: label: Producers categories: label: Categories search: Search + sort: + pagination: + clear_search: Clear search table: new_variant: New variant edit_image: @@ -731,6 +734,9 @@ en_NZ: product_categories: Product Categories tax_categories: Tax Categories shipping_categories: Shipping Categories + dfc_import_form: + enterprise: "Enterprise" + import: "Import" import: review: Review import: Import @@ -3345,6 +3351,7 @@ en_NZ: credit: "Credit" more: "More" no_pending_payments: "No pending payments" + remove: "Remove" none: "None" refund: "Refund" updating: "Updating" diff --git a/config/locales/en_PH.yml b/config/locales/en_PH.yml index 2d6c548ccd..c492d71a9f 100644 --- a/config/locales/en_PH.yml +++ b/config/locales/en_PH.yml @@ -32,6 +32,9 @@ en_PH: shipping_category_id: "Shipping Category" variant_unit: "Variant Unit" variant_unit_name: "Variant Unit Name" + spree/variant: + primary_taxon: "Product Category" + shipping_category_id: "Shipping Category" spree/credit_card: base: "Credit Card" number: "Number" @@ -569,6 +572,9 @@ en_PH: product_categories: Product Categories tax_categories: Tax Categories shipping_categories: Shipping Categories + dfc_import_form: + enterprise: "Enterprise" + import: "Import" import: review: Review import: Import @@ -2985,6 +2991,7 @@ en_PH: credit: "Credit" more: "More" no_pending_payments: "No pending payments" + remove: "Remove" none: "None" updating: "Updating" your_order_is_empty_add_product: "Your order is empty, please search for and add a product above" diff --git a/config/locales/en_US.yml b/config/locales/en_US.yml index e2718b81c2..58e3454eba 100644 --- a/config/locales/en_US.yml +++ b/config/locales/en_US.yml @@ -34,6 +34,9 @@ en_US: shipping_category_id: "Shipping Category" variant_unit: "Variant Unit" variant_unit_name: "Variant Unit Name" + spree/variant: + primary_taxon: "Product Category" + shipping_category_id: "Shipping Category" spree/credit_card: base: "Credit Card" number: "Number" @@ -657,15 +660,15 @@ en_US: index: header: title: Bulk Edit Products - sort: - pagination: - clear_search: Clear search filters: producers: label: Producers categories: label: Categories search: Search + sort: + pagination: + clear_search: Clear search table: new_variant: New variant edit_image: @@ -709,6 +712,9 @@ en_US: product_categories: Product Categories tax_categories: Tax Categories shipping_categories: Shipping Categories + dfc_import_form: + enterprise: "Enterprise" + import: "Import" import: review: Review import: Import @@ -3337,6 +3343,7 @@ en_US: new_taxon: "New taxon" new_user: "New user" no_pending_payments: "No pending payments" + remove: "Remove" none: "None" not_found: "Not found" notice_messages: @@ -3351,8 +3358,6 @@ en_US: start_date: "Start date" successfully_removed: "Successfully Removed" taxonomy_edit: "Taxonomy edit" - taxonomy_tree_error: "Taxonomy tree error" - taxonomy_tree_instruction: "Taxonomy tree instruction" tree: "Tree" updating: "Updating" your_order_is_empty_add_product: "Your cart is empty, please search for and add a product above" diff --git a/config/locales/en_ZA.yml b/config/locales/en_ZA.yml index bc36137e74..0d920527ad 100644 --- a/config/locales/en_ZA.yml +++ b/config/locales/en_ZA.yml @@ -32,6 +32,9 @@ en_ZA: shipping_category_id: "Shipping Category" variant_unit: "Variant Unit" variant_unit_name: "Variant Unit Name" + spree/variant: + primary_taxon: "Product Category" + shipping_category_id: "Shipping Category" spree/credit_card: base: "Credit Card" number: "Number" @@ -522,15 +525,15 @@ en_ZA: index: header: title: Bulk Edit Products - sort: - pagination: - clear_search: Clear search filters: producers: label: Pricing categories: label: Categories search: Search + sort: + pagination: + clear_search: Clear search table: new_variant: New variant edit_image: @@ -573,6 +576,9 @@ en_ZA: product_categories: Product Categories tax_categories: Tax Categories shipping_categories: Shipping Categories + dfc_import_form: + enterprise: "Enterprise" + import: "Import" import: review: Review import: Import @@ -2927,6 +2933,7 @@ en_ZA: credit: "Credit" more: "More" no_pending_payments: "No pending payments" + remove: "Remove" none: "None" updating: "Updating" your_order_is_empty_add_product: "Your order is empty, please search for and add a product above" diff --git a/config/locales/es.yml b/config/locales/es.yml index 0bc3c30e4e..7c3473f7c2 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -48,6 +48,9 @@ es: variant_unit: "Unidad Variante" variant_unit_name: "Nombre de la unidad de la variante" unit_value: "Valor unidad" + spree/variant: + primary_taxon: "categoría del producto" + shipping_category_id: "Categoría de envío" spree/credit_card: base: "Tarjeta de crédito" number: "Número" @@ -449,6 +452,7 @@ es: columns: name: Nombre unit: Unidad + unit_value: Valor unidad price: Precio producer: Productora category: Categoría @@ -691,15 +695,15 @@ es: header: title: Editar varios Productos loading: Cargando tus productos - sort: - pagination: - clear_search: Limpiar la búsqueda filters: producers: label: Productoras categories: label: Categorías search: Buscar + sort: + pagination: + clear_search: Limpiar la búsqueda no_products: no_products_found: No se encontraron productos import_products: Importar varios productos @@ -748,6 +752,9 @@ es: product_categories: Categorías de Producto tax_categories: Categorías de impuestos shipping_categories: Categorías de envío + dfc_import_form: + enterprise: "Organización" + import: "Importar" import: review: Revisión import: Importar @@ -3477,6 +3484,7 @@ es: new_taxon: "Nuevo taxón" new_user: "Nuevo usuario" no_pending_payments: "No tiene pagos pendientes" + remove: "Eliminar" none: "Ninguno" not_found: "No encontrado" notice_messages: @@ -3492,8 +3500,6 @@ es: start_date: "Fecha de inicio" successfully_removed: "Eliminado con éxito" taxonomy_edit: "editar taxonomía" - taxonomy_tree_error: "Error del árbol de taxonomía" - taxonomy_tree_instruction: "Instrucción del árbol de taxonomía" tree: "Árbol" updating: "Actualizando" your_order_is_empty_add_product: "Su pedido está vacío, busque y añada un producto arriba" diff --git a/config/locales/es_CO.yml b/config/locales/es_CO.yml index 1d1d4a2af0..964ea1c945 100644 --- a/config/locales/es_CO.yml +++ b/config/locales/es_CO.yml @@ -34,6 +34,9 @@ es_CO: shipping_category_id: "Categoría de envío" variant_unit: "Unidad Variante" variant_unit_name: "Nombre de la unidad de la variante" + spree/variant: + primary_taxon: "Categoría del producto" + shipping_category_id: "Categoría de envío" spree/credit_card: base: "Tarjeta de crédito" number: "Número" @@ -598,6 +601,9 @@ es_CO: product_categories: Categorías de producto tax_categories: Categorías de impuestos shipping_categories: Categorías de envío + dfc_import_form: + enterprise: "Organización" + import: "Importar" import: review: Revisión import: Importar @@ -3086,6 +3092,7 @@ es_CO: credit: "Crédito" more: "Más" no_pending_payments: "No tiene pagos pendientes" + remove: "Eliminar" none: "Ninguno" updating: "Actualizando" your_order_is_empty_add_product: "Su pedido está vacío, busque y añada un producto arriba" diff --git a/config/locales/es_CR.yml b/config/locales/es_CR.yml index caf1766932..3b903b274c 100644 --- a/config/locales/es_CR.yml +++ b/config/locales/es_CR.yml @@ -34,6 +34,9 @@ es_CR: shipping_category_id: "Categoría de envío" variant_unit: "Unidad Variante" variant_unit_name: "Nombre de la unidad de la variante" + spree/variant: + primary_taxon: "Categoría del producto" + shipping_category_id: "Categoría de envío" spree/credit_card: base: "Tarjeta de crédito" number: "Número" @@ -683,15 +686,15 @@ es_CR: index: header: title: Editar productos por volumen - sort: - pagination: - clear_search: Borrar búsqueda filters: producers: label: Productores categories: label: Categorías search: Buscar + sort: + pagination: + clear_search: Borrar búsqueda table: new_variant: Nueva variante edit_image: @@ -735,6 +738,9 @@ es_CR: product_categories: Categorías de producto tax_categories: Categorías de impuestos shipping_categories: Categorías de envío + dfc_import_form: + enterprise: "Organización" + import: "Importar" import: review: Revisión import: Importar @@ -3436,6 +3442,7 @@ es_CR: new_taxon: "Nuevo taxon" new_user: "Nuevo usuari" no_pending_payments: "No tiene pagos pendientes" + remove: "Eliminar" none: "Ninguno" not_found: "No encontrado" notice_messages: diff --git a/config/locales/es_US.yml b/config/locales/es_US.yml index 196864cf35..35e2dc488b 100644 --- a/config/locales/es_US.yml +++ b/config/locales/es_US.yml @@ -34,6 +34,9 @@ es_US: shipping_category_id: "Categoría de envío" variant_unit: "Unidad Variante" variant_unit_name: "Nombre de la unidad de la variante" + spree/variant: + primary_taxon: "categoría del producto" + shipping_category_id: "Categoría de envío" spree/credit_card: base: "Tarjeta de crédito" number: "Número" @@ -655,15 +658,15 @@ es_US: index: header: title: Editar varios Productos - sort: - pagination: - clear_search: Limpiar la búsqueda filters: producers: label: Productoras categories: label: Categorías search: Buscar + sort: + pagination: + clear_search: Limpiar la búsqueda table: new_variant: Nueva variante edit_image: @@ -707,6 +710,9 @@ es_US: product_categories: Categorías de Producto tax_categories: Categorías de impuestos shipping_categories: Categorías de envío + dfc_import_form: + enterprise: "Organización" + import: "Importar" import: review: Revisión import: Importar @@ -3294,6 +3300,7 @@ es_US: new_tax_category: "Nueva categoría de impuestos" new_user: "Nuevo usuario" no_pending_payments: "No tiene pagos pendientes" + remove: "Eliminar" none: "Ninguno" not_found: "no encontrado" notice_messages: diff --git a/config/locales/fil_PH.yml b/config/locales/fil_PH.yml index 6e7b0726db..13c709fda4 100644 --- a/config/locales/fil_PH.yml +++ b/config/locales/fil_PH.yml @@ -32,6 +32,9 @@ fil_PH: shipping_category_id: "Kategorya ng Pagpapadala" variant_unit: "Yunit ng variant" variant_unit_name: "pangalan ng yunit ng variant" + spree/variant: + primary_taxon: "Kategorya ng Produkto" + shipping_category_id: "Kategorya ng Pagpapadala" spree/credit_card: base: "Credit Card" number: "Bilang" @@ -570,6 +573,9 @@ fil_PH: product_categories: kategorya ng produkto tax_categories: kategorya ng tax shipping_categories: mga kategorya ng pagpapadala + dfc_import_form: + enterprise: "Enterprise" + import: "ilipat" import: review: suriin import: i-import @@ -2997,6 +3003,7 @@ fil_PH: credit: "utang" more: "Karagdagang Impormasyon" no_pending_payments: "walang nakabinbin na mga bayad" + remove: "Tanggalin" none: "wala" updating: "ina-update" your_order_is_empty_add_product: "ang iyong order ay walang laman, humanap at magdagdag ng produkto sa itaas." diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 6a1f99273d..74a8d86f47 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -51,6 +51,9 @@ fr: variant_unit: "Unité" variant_unit_name: "Unité de la variante" unit_value: "Nb unités" + spree/variant: + primary_taxon: "Catégorie Produit" + shipping_category_id: "Condition de transport" spree/credit_card: base: "Carte de crédit" number: "N° commande" @@ -191,6 +194,9 @@ fr: transaction_not_allowed: "La carte a été refusée pour une raison inconnue." try_again_later: "La carte a été refusée pour une raison inconnue." withdrawal_count_limit_exceeded: "L'acheteur a dépassé son plafond de carte bancaire." + disconnect_failure: "Déconnecter Stripe a échoué." + success_code: + disconnected: "Le compte Stripe est déconnecté." activemodel: errors: messages: @@ -216,10 +222,16 @@ fr: not_available_to_shop: "n'est pas disponible pour %{shop}" card_details: "Détalis de la carte" card_type: "Type de carte" + card_type_is: "Type de carte" + unrecognized_card_type: "Type de carte non reconnu" + use_new_cc: "Utilisez une nouvelle carte bancaire" + what_is_this: "Qu'est-ce que c'est ?" cardholder_name: "Titulaire de la carte" community_forum_url: "Lien vers le forum" customer_instructions: "Précisions pour l'acheteur" additional_information: "Informations additionnelles" + connect_app: + url: "https://n8n.openfoodnetwork.org/webhook/regen/connect-enterprise" devise: passwords: spree_user: @@ -310,9 +322,9 @@ fr: email_registered: "va, dès que vous aurez choisi un type d'entreprise, être créé sur" email_userguide_html: "Le Guide Utilisateur est là pour vous accompagner dans la prise en main de la plateforme. Vous y trouverez les informations détaillées de paramétrage de votre entreprise, de vos produits si vous êtes producteur, et éventuellement de votre boutique. Pour accéder au guide en français, cliquez ici : %{link}" userguide: "Guide utilisateur" - email_admin_html: "Pour gérez votre entreprise, rendez-vous sur l’%{link}. Si vous choisissez CoopCircuits pour organiser vos ventes, l’utilisation est gratuite les 3 premiers mois pour vous permettre de tester notre solution. Au-delà, vous devrez choisir une de nos offres pour continuer à utiliser le service (voir rubrique “nos offres” sur notre site internet)." + email_admin_html: "Pour gérer votre entreprise, rendez-vous sur l’%{link}. Si vous choisissez CoopCircuits pour organiser vos ventes, l’utilisation est gratuite les 3 premiers mois après la première vente pour vous permettre de tester notre solution. Vous pouvez faire des \"vraies commandes\" pour tester à condition de les annuler juste après pour ne pas démarrer les 3 mois. Consultez la rubrique \"Nos offres & tarifs\" du site internet pour en connaître les détails." admin_panel: "interface d'administration" - email_community_html: "Nous avons aussi un forum de discussion en ligne pour échanger avec la communauté sur des questions liées à la plateforme ou aux défis de la gestion d'un circuit court. Nous vous invitons à y participer ! %{link}" + email_community_html: "Nous avons aussi un forum de discussion en ligne pour échanger avec la communauté sur des questions liées à la plateforme ou aux défis de la gestion d'un circuit court. Nous vous invitons à y participer ! %{link}\nSi vous avez besoin d'aide,  nous proposons des démonstrations hebdomadaires en visio, où nous vous présentons la coopérative CoopCircuits, et vous donnons tous les trucs et astuces sur l'outil et ses fonctionnalités. Inscrivez-vous via le lien présent sur la page Aide&FAQ de notre site.\nSi vous préférez un rdv individuel - par téléphone ou visio - n'hésitez-pas à nous proposer un créneau pour vous rappeler \U0001F917" join_community: "Accéder au forum" invite_manager: subject: "%{enterprise} vous a invité comme gestionnaire" @@ -508,7 +520,10 @@ fr: colums: Colonnes columns: name: Nom + unit_scale: Échelle d'unité unit: Unité + unit_value: Nb unités + display_as: 'Afficher l''unité en ' price: Prix producer: Producteur category: Catégorie @@ -638,6 +653,7 @@ fr: status: Statut ok: Ok instance_secret_key: Clé Secrète de l'Instance + instance_publishable_key: Clé publique de l'instance account_id: Identifiant Compte business_name: Nom de l'entreprise charges_enabled: Frais activés @@ -690,6 +706,10 @@ fr: your_content: Votre contenu user_guide: Guide utilisateur map: Carte + dfc_product_imports: + index: + title: "Importation d'un produit du catalogue DFC" + imported_products: "Produits importés :" enterprise_fees: index: title: "Marges et Commissions" @@ -767,13 +787,6 @@ fr: prompt: "Cette action va supprimer ceci de façon permanente de votre liste." confirmation_text: "Supprimer la variante" cancellation_text: "Conserver la variante" - sort: - pagination: - total_html: "%{total} produits trouvés selon vos critères de recherche. Montrer %{from} à %{to}." - per_page: - show: Montrer - per_page: "%{num} par page" - clear_search: Annuler la recherche filters: search_products: Chercher des produits search_for_producers: Rechercher des producteurs @@ -785,6 +798,13 @@ fr: categories: label: Conditions de transport search: Rechercher + sort: + pagination: + total_html: "%{total} produits trouvés selon vos critères de recherche. Résultats %{from} à %{to}." + per_page: + show: Montrer + per_page: "%{num} par page" + clear_search: Annuler la recherche no_products: no_products_found: Pas de produits trouvés import_products: Importer plusieurs produits @@ -857,6 +877,11 @@ fr: product_categories: Catégorie Produit tax_categories: TVA applicable shipping_categories: Conditions de transport + dfc_import_form: + title: "Importer depuis le catalogue DFC" + enterprise: "Entreprise" + catalog_url: "URL du catalogue DFC" + import: "Importer" import: review: Vérifier import: Importer @@ -1153,7 +1178,7 @@ fr: Vous pouvez indiquer ici un message de bienvenue ou un message expliquant les particularités de votre boutique. Ce message s'affiche dans l'onglet Accueil de votre boutique. Si aucun message n'est affiché, l'onglet - Accueil n'apparaitra pas. + Accueil n’apparaîtra pas. shopfront_message_link_tooltip: "Insérer / modifier un lien" shopfront_message_link_prompt: "Veuillez entrer l'URL à insérer" shopfront_closed_message: "Message d'accueil ventes terminées" @@ -1166,6 +1191,7 @@ fr: open_date: "Date d'ouverture" close_date: "Date de fermeture" display_ordering_in_shopfront: "Ordre d'affichage sur la boutique en ligne :" + shopfront_sort_by_product: "Par produit" shopfront_sort_by_category: "Par catégorie" shopfront_sort_by_producer: "Par producteur" shopfront_sort_by_category_placeholder: "Catégorie" @@ -1187,7 +1213,7 @@ fr: disconnect: "Déconnecter le compte" confirm_modal: title: Connecter avec Stripe - part1: Stripe est un système de paiement qui permet aux boutiques sur CoopCircuits d'accepter des paiements par carte bancaire de leurs acheteurs. + part1: Stripe est un système de paiement en ligne qui permet aux boutiques sur CoopCircuits d'accepter des paiements par carte bancaire de leurs acheteurs. part2: Pour utiliser cette fonctionnalité, vous devez connecter votre compte Stripe à CoopCircuits. En cliquant sur "J'accepte" ci-dessous, vous serez redirigé vers le site internet de Stripe, où vous pourrez connecter votre compte existant ou en créer un si vous n'en avez pas encore. part3: Cela permettra à CoopCircuits d'accepter en votre nom les paiements par carte de crédit en provenance de vos acheteurs. Veuillez noter que c'est à vous de gérer votre compte Stripe, de payer les frais dus à Stripe et de gérer les éventuels remboursements et le service après vente. i_agree: J'accepte @@ -2476,6 +2502,7 @@ fr: orders_bought_already_confirmed: "* déjà confirmé" orders_confirm_cancel: "Voulez-vous vraiment annuler cette commande ?" order_processed_successfully: "Votre commande a été traitée avec succès" + thank_you_for_your_order: "Merci pour votre commande" products_cart_distributor_choice: "Distributeur pour votre commande:" products_cart_distributor_change: "Vore distributeur pour cette commande sera dorénavant %{name} si vous ajoutez ce produit à votre panier." products_cart_distributor_is: "Votre distributeur pour cette commande est %{name}." @@ -3646,7 +3673,7 @@ fr: bulk_coop: filters: bulk_coop_allocation: "Achats groupés Allocation" - bulk_coop_customer_payments: "Achats groupés - Paiement des acheteurs" + bulk_coop_customer_payments: "Achats groupés - Paiements des acheteurs" bulk_coop_packing_sheets: "Achats groupés - Feuilles de préparation des paniers" bulk_coop_supplier_report: "Achats groupés - Totaux par Producteur" enterprise_fee_summaries: @@ -3752,6 +3779,7 @@ fr: editing_tax_category: "Modifier une catégorie de taxe" editing_tax_rate: "Modifier un taux" editing_zone: "Modifier une zone" + editing_state: "Modifier département" expiration: "Expiration" invalid_payment_provider: "Fournisseur de paiement invalide" items_cannot_be_shipped: "Les produits ne peuvent pas être envoyés" @@ -3763,6 +3791,7 @@ fr: new_taxon: "Nouvelle taxonomie" new_user: "Nouvel utilisateur" no_pending_payments: "Aucun paiement en attente." + remove: "Supprimer" none: "Aucun" not_found: "Non trouvé" notice_messages: @@ -3779,8 +3808,8 @@ fr: start_date: "Date de début" successfully_removed: "Supprimé avec succès" taxonomy_edit: "Modifier la taxonomie" - taxonomy_tree_error: "Erreur de l'arbre de toxonomie" - taxonomy_tree_instruction: "Consignes pour l'arbre de taxonomie" + taxonomy_tree_error: "Erreur lors de la mise à jour de l'arbre de taxonomie." + taxonomy_tree_instruction: "Faites un clic droit sur un article pour ajouter, renommer, supprimer ou modifier." tree: "Arbre" updating: "Mettre à jour" your_order_is_empty_add_product: "Votre commande est vide, veuillez ajouter des produits" @@ -3789,6 +3818,7 @@ fr: resend: "Renvoyer" back_to_orders_list: "Retour à la liste des commandes" back_to_payments_list: "Retour à la liste des paiements" + back_to_states_list: "Retour à la liste" return_authorizations: "Autorisations de retours" cannot_create_returns: "Impossible de créer une autorisation de retour car aucun produit n'a été livré pour cette commande." select_stock: "Sélectionner le stock" diff --git a/config/locales/fr_BE.yml b/config/locales/fr_BE.yml index 22eeb32b54..4e08d7b657 100644 --- a/config/locales/fr_BE.yml +++ b/config/locales/fr_BE.yml @@ -48,6 +48,9 @@ fr_BE: variant_unit: "Unité de variante" variant_unit_name: "Nom de la variante" unit_value: "Valeur unitaire" + spree/variant: + primary_taxon: "Catégorie de Produit" + shipping_category_id: "Catégorie de livraison" spree/credit_card: base: "Carte de crédit" number: "N° commande" @@ -438,6 +441,7 @@ fr_BE: columns: name: Nom unit: Unité + unit_value: Valeur unitaire price: Prix producer: Producteur·trice category: Catégorie @@ -678,15 +682,15 @@ fr_BE: index: header: title: Gestion du catalogue produits - sort: - pagination: - clear_search: Effacer recherche filters: producers: label: Producteur·trice·s categories: label: Les catégories search: Rechercher + sort: + pagination: + clear_search: Effacer recherche table: new_variant: Nouvelle variante edit_image: @@ -712,7 +716,7 @@ fr_BE: none_saved: n'a pu sauvegarder aucun produit :-( line_number: "Ligne %{number} :" encoding_error: "Veuillez vérifier la langage de votre fichier source et l'enregistrer avec un encodage UTF-8" - unexpected_error: "L'import du produit à provoqué une erreur à l'ouverture du fichier: %{error_message}" + unexpected_error: "L'import du produit a provoqué une erreur à l'ouverture du fichier: %{error_message}" malformed_csv: "L'import du produit a rencontré une erreur a l'ouverture du fichier:%{error_message}" index: notice: "Remarque" @@ -732,6 +736,9 @@ fr_BE: product_categories: Catégorie Produit tax_categories: TVA applicable shipping_categories: Condition de transport + dfc_import_form: + enterprise: "Entreprise" + import: "Importer" import: review: Vérifier import: Importer @@ -2519,6 +2526,7 @@ fr_BE: calculator: "Calculateur" calculator_values: "Valeurs applicables" calculator_settings_warning: "Si vous changez le type de calculatrice, vous devez d'abord enregistrer avant de pouvoir modifier les paramètres de la calculatrice" + calculator_preferred_unit_error: "doit être en kg ou en lb" flat_percent_per_item: "Pourcentage net" flat_rate_per_item: "Montant fixe (par article)" flat_rate_per_order: "Montant fixe (par commande)" @@ -3367,6 +3375,7 @@ fr_BE: new_adjustment: "Nouvel ajustement" new_tax_category: "Nouvelle catégorie de taxe" no_pending_payments: "Aucun paiement en attente" + remove: "Supprimer" none: "Aucun" notice_messages: variant_deleted: "Variante supprimée" @@ -3526,6 +3535,7 @@ fr_BE: inventory_error_flash_for_insufficient_quantity: "Une donnée n'est plus disponible sur votre carte." inventory: Catalogue boutique zipcode: Code postal + weight: Poids (par kg ou lb) error_user_destroy_with_orders: "Les utilisateurs avec une commande finalisée ne peuvent pas être supprimés" cannot_create_payment_without_payment_methods: "Vous ne pouvez pas créer un paiement pour une commande sans qu'aucun mode de paiement ne soit défini." please_define_payment_methods: "Veuillez d'abord définir certains modes de paiement." diff --git a/config/locales/fr_CA.yml b/config/locales/fr_CA.yml index 8cf09ffb8f..7f9b2fe62c 100644 --- a/config/locales/fr_CA.yml +++ b/config/locales/fr_CA.yml @@ -1,5 +1,8 @@ fr_CA: language_name: "Français" + time: + formats: + long: "%B %d, %Y %-l:%M %p" activerecord: models: spree/product: Produit @@ -48,6 +51,9 @@ fr_CA: variant_unit: "Unité" variant_unit_name: "Unité de la variante" unit_value: "Nb unités" + spree/variant: + primary_taxon: "Catégorie Produit" + shipping_category_id: "Condition de transport" spree/credit_card: base: "Carte de crédit" number: "N° commande" @@ -75,6 +81,10 @@ fr_CA: models: enterprise_fee: inherit_tax_requires_per_item_calculator: "Déterminer la catégorie de taxe requiert l'utilisation du calculateur par article" + spree/image: + attributes: + attachment: + integrity_error: "failed to load. Please check to ensure the file is not corrupt, and try again." spree/user: attributes: email: @@ -131,6 +141,7 @@ fr_CA: unprocessable_entity: title: "La modification réalisée a été rejetée (erreur 422)" message_html: "

La modification souhaitée a été refusée. Peut-être avez-vous essayé de faire quelque chose sans avoir les droits d'accès suffisants ?

Retourner à l'accueil

" + stimulus_reflex_error: "Nous sommes désolés mais quelque chose s'est mal passé.\n\n C'est un problème temporaire, merci donc de réessayer ou de recharger la page. \nNous enregistrons toutes les erreurs et travaillons sur les améliorations nécessaires.\nSi le problème persiste ou est urgent, merci de nous contacter.\n " stripe: error_code: incorrect_number: "e numéro de carte bancaire est incorrect." @@ -183,6 +194,9 @@ fr_CA: transaction_not_allowed: "La carte bancaire a été refusée pour une raison inconnue." try_again_later: "La carte bancaire a été refusée pour une raison inconnue." withdrawal_count_limit_exceeded: "L'acheteur a dépassé son plafond de carte bancaire." + disconnect_failure: "Déconnecter Stripe a échoué." + success_code: + disconnected: "Le compte Stripe est déconnecté." activemodel: errors: messages: @@ -212,6 +226,8 @@ fr_CA: community_forum_url: "Lien vers le forum" customer_instructions: "Précisions pour l'acheteur" additional_information: "Informations additionnelles" + connect_app: + url: "https://n8n.openfoodnetwork.org/webhook/regen-CAN/connect-enterprise" devise: passwords: spree_user: @@ -291,6 +307,9 @@ fr_CA: integer_array_validator: not_array_error: "doit être une séquence" invalid_element_error: "doit contenir uniquement des nombres entiers" + report_job: + report_failed: | + L'édition de ce rapport a échoué. Il est probablement trop volumineux. Nous allons examiner cela, mais faites-nous signe si le problème persiste. enterprise_mailer: confirmation_instructions: subject: "Confirmez l'adresse email pour %{enterprise}" @@ -380,6 +399,7 @@ fr_CA: cancel_order: "Annuler la commande" confirm_send_invoice: "La facture de cette commande va être transmise à l'acheteur. Etes-vous sûr de vouloir continuer ?" confirm_resend_order_confirmation: "Etes-vous sûr de vouloir renvoyer le mail de confirmation de commande ?" + must_have_valid_business_number: "%{enterprise_name} doit avoir un SIRET valide avant que les factures puissent être envoyées. " invoice: "Facture" invoices: "Factures" file: "fichier" @@ -497,7 +517,10 @@ fr_CA: colums: Colonnes columns: name: Nom + unit_scale: Échelle d'unité unit: Unité + unit_value: Nb unités + display_as: 'Afficher l''unité en ' price: Prix producer: Producteur category: Catégorie @@ -589,6 +612,9 @@ fr_CA: has_n_rules: "a %{num} règles" unsaved_confirm_leave: "Des modifications n'ont pas été sauvegardées et seront perdues si vous quittez la page. Souhaitez-vous quitter la page?" available_units: "Unités disponibles" + terms_of_service_have_been_updated_html: "Les conditions d'utilisation de CoopCircuits ont été mises à jour : %{tos_link}" + terms_of_service: Lire les conditions d'utilisation + accept_terms_of_service: Accepter les conditions d'utilisation shopfront_settings: embedded_shopfront_settings: "Paramètres Boutiques Intégrées" enable_embedded_shopfronts: "Autoriser l'intégration des boutiques" @@ -676,6 +702,10 @@ fr_CA: your_content: Votre contenu user_guide: Guide utilisateur map: Carte + dfc_product_imports: + index: + title: "Importation d'un produit du catalogue DFC" + imported_products: "Produits importés :" enterprise_fees: index: title: "Marges et Commissions" @@ -742,6 +772,28 @@ fr_CA: header: title: Gestion du catalogue produits loading: Vos produits sont en cours de chargement + delete_modal: + delete_product_modal: + heading: "Supprimer produit" + prompt: "Cette action va supprimer ceci de façon permanente de votre liste." + confirmation_text: "Supprimer produit" + cancellation_text: "Conserver le produit" + delete_variant_modal: + heading: "Supprimer la variante" + prompt: "Cette action va supprimer ceci de façon permanente de votre liste." + confirmation_text: "Supprimer la variante" + cancellation_text: "Conserver la variante" + filters: + search_products: Chercher des produits + search_for_producers: Rechercher des producteurs + all_producers: Tous les producteurs + search_for_categories: Rechercher des catégories + all_categories: Toutes les catégories + producers: + label: Producteurs + categories: + label: Conditions de transport + search: Chercher sort: pagination: total_html: "%{total} produits trouvés selon vos critères de recherche. Montrer %{from} à %{to}." @@ -749,15 +801,6 @@ fr_CA: show: Montrer per_page: "%{num} par page" clear_search: Annuler la recherche - filters: - search_products: Chercher des produits - all_producers: Tous les producteurs - all_categories: Toutes les catégories - producers: - label: Producteurs - categories: - label: Conditions de transport - search: Chercher no_products: no_products_found: Pas de produits trouvés import_products: Importer plusieurs produits @@ -766,11 +809,29 @@ fr_CA: changed_summary: one: "%{count} produits modifiés" other: "%{count} produits modifiés" + error_summary: + saved: + one: "%{count}le produit a été sauvegardé correctement, mais " + other: "%{count} les produits ont été sauvegardés correctement, mais" + invalid: + one: "%{count} produit n'a pas pu être sauvegardé. Veuillez examiner les erreurs et réessayer." + many: "%{count} produits n'ont pas pu être sauvegardés. Veuillez examiner les erreurs et réessayer." + other: "%{count} produits n'ont pas pu être sauvegardés. Veuillez examiner les erreurs et réessayer." reset: Annuler les changements save: Sauvegarder les changements new_variant: Nouvelle variante + bulk_update: + success: Changements sauvegardés edit_image: + title: Modifier la photo du produit close: Retour + upload: Télécharger la photo + delete_product: + success: Le produit a bien été supprimé + error: Le produit n'a pas pu être supprimé + delete_variant: + success: La variante a bien été supprimée + error: La variante n'a pas pu être supprimée product_import: title: import produit file_not_found: Fichier non trouvé ou impossible à ouvrir @@ -812,6 +873,11 @@ fr_CA: product_categories: Catégorie Produit tax_categories: Taxe applicable shipping_categories: Condition de transport + dfc_import_form: + title: "Importer depuis le catalogue DFC" + enterprise: "Entreprise" + catalog_url: "URL du catalogue DFC" + import: "Importer" import: review: Vérifier import: Importer @@ -913,6 +979,7 @@ fr_CA: orders: edit: order_sure_want_to: Etes-vous sûr de vouloir %{event} cette commande ? + voucher_tax_included_in_price: "%{label} (taxe inclue dans le bon de réduction)" invoice_email_sent: 'L''email de facturation a bien été envoyé' order_email_resent: 'L''email de commande a de nouveau été envoyé' bulk_management: @@ -1015,6 +1082,7 @@ fr_CA: images: legend: "Images" logo: Logo + logo_size: "300 x 300 pixels" promo_image_placeholder: 'Cette image est affichée dans "A propos"' promo_image_note1: 'ATTENTION:' promo_image_note2: Votre bannière doit mesurer 1200 x 260, toute image non conforme sera rognée. @@ -1120,6 +1188,7 @@ fr_CA: open_date: "Date d'ouverture" close_date: "Date de fermeture" display_ordering_in_shopfront: "Ordre d'affichage sur la boutique en ligne:" + shopfront_sort_by_product: "Par produit" shopfront_sort_by_category: "Par catégorie" shopfront_sort_by_producer: "Par producteur" shopfront_sort_by_category_placeholder: "Catégorie" @@ -1202,7 +1271,28 @@ fr_CA: custom_tab_title: "Titre de l'onglet personnalisé" custom_tab_content: "Contenu de l'onglet personnalisé" connected_apps: + legend: "Connected apps https://n8n.openfoodnetwork.org.uk/webhook-test/regen/connect-enterprise/can" + title: "Discover Regenerative" + tagline: "Autoriser Discover Regenerative à publier les informations de votre entreprise" + enable: "Autoriser le partage de données" + disable: "Arrêter le partage" loading: "Chargement en cours" + note: | + Votre compte Open Food Network est connecté à Discover Regenerative. + Ajouter et mettre à jour les informations sur votre liste Discover Regenerative ici. + link_label: "Gérer la liste" + description_html: | +

+ Les producteurs éligibles peuvent mettre en avant leurs références Regenerative, + pratiques agricoles et plus à travers le listing du profil. + Simplifier comment les acheteurs peuvent trouver les produits regeneratives et se connecter + avec des producteurs. +

+

+ En savoir plus sur Discover Regenerative + +

actions: edit_profile: Paramètres properties: Labels / propriétés @@ -1432,6 +1522,8 @@ fr_CA: has_no_payment_methods: "%{enterprise} n'a pas défini de méthode de paiement" has_no_shipping_methods: "%{enterprise} n'a pas défini de méthode de livraison" has_no_enterprise_fees: "%{enterprise} n'a pas défini de marges et commissions" + flashes: + dismiss: Masquer side_menu: enterprise: primary_details: "Informations de base" @@ -1452,6 +1544,7 @@ fr_CA: users: "Utilisateurs" vouchers: Bon de réduction white_label: "Marque blanche" + connected_apps: "Connected apps https://n8n.openfoodnetwork.org.uk/webhook-test/regen/connect-enterprise/can" enterprise_group: primary_details: "Informations de base" users: "Utilisateurs" @@ -1573,9 +1666,15 @@ fr_CA: index: title: "OIDC" connect: "Connecter votre compte" + disconnect: "Déconnecter" + connected: "Votre compte est relié à %{uid}." les_communs_link: "Serveur OIDC Les Communs" link_your_account: "Vous devez d'abord vous connecter avec le serveur des Communs." link_account_button: "Relier votre compte OIDC Les Communs" + note_expiry: | + Les approbations permettant d'accéder aux applications connectées ont expiré. Veuillez rafraîchir + la connexion à votre compte pour que toutes les intégrations fonctionnent. + refresh: "Rafraichir l'autorisation" view_account: "Pour voir votre compte, consultez :" subscriptions: index: @@ -1885,18 +1984,22 @@ fr_CA: invoice_column_price: "Prix" invoice_column_item: "Produit" invoice_column_qty: "Qté" + invoice_column_weight_volume: "Poids / volume" invoice_column_unit_price_with_taxes: "Prix unitaire TTC" invoice_column_unit_price_without_taxes: "Prix unitaire HT" invoice_column_price_with_taxes: "Prix total TTC" invoice_column_price_without_taxes: "Prix total HT" + invoice_column_price_per_unit_without_taxes: "Prix par unité (hors taxe)" invoice_column_tax_rate: "Taux de taxe" invoice_tax_total: "Total Taxe :" + invoice_cancel_and_replace_invoice: "annule et remplace la facture" tax_invoice: "FACTURE" tax_total: "Total taxe (%{rate}) :" invoice_shipping_category_delivery: "Livraison" invoice_shipping_category_pickup: "Retrait" total_excl_tax: "Total HT :" total_incl_tax: "Total TTC :" + total_all_tax: "Total taxe" abn: "SIRET" acn: "n° TVA intracommunautaire" invoice_issued_on: "Date de facture :" @@ -2113,6 +2216,9 @@ fr_CA: order_back_to_store: Retour à la boutique order_back_to_cart: Retour au panier order_back_to_website: Retour vers le site + checkout_details_title: Détails de la commande + checkout_payment_title: Paiement de la commande + checkout_summary_title: Résumé de la commande bom_tip: "Utilisez cette page pour modifier les quantités sur plusieurs commandes à la fois. Les produits peuvent aussi être supprimés des commandes si nécessaire." unsaved_changes_warning: "Des modifications n'ont pas été enregistrées et seront perdues si vous continuez." unsaved_changes_error: "Les champs entourés en rouge contiennent des erreurs." @@ -2975,6 +3081,8 @@ fr_CA: report_header_transaction_fee: Frais de Transaction (Taxes non incluses) report_header_total_untaxable_admin: Total ajustements non taxables report_header_total_taxable_admin: Total ajustments soumis aux taxes (taxes incluses) + report_header_voucher_label: Label de la réduction + report_header_voucher_amount: "Montant de la réduction (%{currency_symbol})" report_line_cost_of_produce: 'Coût des produits hors ' report_line_line_items: produits report_header_last_completed_order_date: Date dernière commande @@ -3300,6 +3408,7 @@ fr_CA: processing: "en traitement" void: "faire un avoir" invalid: "invalide" + quantity_unavailable: "Stock disponible insuffisant. La ligne produit ne peut pas être sauvegardée." quantity_unchanged: "La quantité n'a pas été modifiée." cancel_the_order_html: "Cette action va annuler la commande.
Etes-vous sûr de vouloir continuer ?" cancel_the_order_send_cancelation_email: "Envoyer un email d'annulation à l'acheteur" @@ -3660,6 +3769,7 @@ fr_CA: new_taxon: "Nouvelle taxonomie" new_user: "Nouvel utilisateur" no_pending_payments: "Aucun paiement en attente." + remove: "Supprimer" none: "Aucun" not_found: "Non trouvé" notice_messages: @@ -3676,8 +3786,8 @@ fr_CA: start_date: "Date de début" successfully_removed: "Supprimé avec succès" taxonomy_edit: "Modifier la taxonomie" - taxonomy_tree_error: "Erreur de l'arbre de toxonomie" - taxonomy_tree_instruction: "Consignes pour l'arbre de taxonomie" + taxonomy_tree_error: "Erreur lors de la mise à jour de l'arbre de taxonomie." + taxonomy_tree_instruction: "Faites un clic droit sur un article pour ajouter, renommer, supprimer ou modifier." tree: "Arbre" updating: "Mettre à jour" your_order_is_empty_add_product: "Votre commande est vide, veuillez ajouter des produits" @@ -3730,6 +3840,7 @@ fr_CA: credit_card: "Carte de crédit" new_payment: "Nouveau paiement" capture: "Payée" + capture_and_complete_order: "Capturer et terminer la commande" void: "Annulé" login: "Se connecter" password: "Mot de passe" @@ -3971,6 +4082,9 @@ fr_CA: add_product: cannot_add_item_to_canceled_order: "Il n'est pas possible d'ajouter des produits sur une commande annulée." include_out_of_stock_variants: "Inclure les variantes sans stock" + shipment: + mark_as_shipped_message_html: "Cette action marque la commande comme livrée.
Etes-vous certain de vouloir faire ceci? " + mark_as_shipped_label_message: "Etes-vous certain de vouloir faire ceci? " index: listing_orders: "Liste des commandes" new_order: "Nouvelle commande" @@ -4029,6 +4143,9 @@ fr_CA: line_item_adjustments: "Ajustements sur la ligne produit" order_adjustments: "Ajustements sur la commande" order_total: "Total Commande:" + invoices: + index: + order_has_changed: "La commande a changé depuis la dernière mise à jour de la facture. La facture affichée ici risque donc de ne pas être à jour." overview: enterprises_header: ofn_with_tip: Les Entreprises sont des Producteurs et/ou Hubs distributeurs, et sont donc les organisations de base qui utilisent Open Food Network. @@ -4037,6 +4154,7 @@ fr_CA: has_no_payment_methods: "n'a pas de méthode de paiement" has_no_shipping_methods: "n'a pas de méthode de livraison" products: + products_tip: "Les produits que vous vendez via Open Food Network." active_products: zero: "Vous n'avez aucun produit actif." one: "Vous avez un produit actif" @@ -4189,6 +4307,8 @@ fr_CA: bulk_unit_size: Quantité totale du lot display_as: display_as: Unité affichéé + clone: + success: Produit dupliqué reports: table: select_and_search: "Sélectionner les filtres et cliquez sur %{option} pour accéder aux données." @@ -4262,7 +4382,11 @@ fr_CA: form: name: Nom permalink: Nom pour URL (sans espace) + meta_title: Méta titre + meta_description: Méta description + meta_keywords: Méta mots clés description: Description + dfc_id: URI DFC general_settings: edit: legal_settings: "Configuration légales" @@ -4572,3 +4696,6 @@ fr_CA: pagination: next: Suivant previous: Précédent + invisible_captcha: + sentence_for_humans: "Merci de laisser ce champ libre" + timestamp_error_message: "S'il vous plaît réessayez après 5 secondes." diff --git a/config/locales/fr_CH.yml b/config/locales/fr_CH.yml index 28e1ee256d..f89193fb84 100644 --- a/config/locales/fr_CH.yml +++ b/config/locales/fr_CH.yml @@ -34,6 +34,9 @@ fr_CH: shipping_category_id: "Condition de transport" variant_unit: "Unité" variant_unit_name: "Unité de la variante" + spree/variant: + primary_taxon: "Catégorie Produit" + shipping_category_id: "Condition de transport" spree/credit_card: base: "Carte de crédit" number: "N° commande" @@ -677,15 +680,15 @@ fr_CH: index: header: title: Gestion du catalogue produits - sort: - pagination: - clear_search: Annuler la recherche filters: producers: label: Producteurs categories: label: Conditions de transport search: Rechercher + sort: + pagination: + clear_search: Annuler la recherche table: new_variant: Nouvelle variante edit_image: @@ -729,6 +732,9 @@ fr_CH: product_categories: Catégorie Produit tax_categories: TVA applicable shipping_categories: Conditions de transport + dfc_import_form: + enterprise: "Entreprise" + import: "Importer" import: review: Vérifier import: Importer @@ -3443,6 +3449,7 @@ fr_CH: new_taxon: "Nouvelle taxonomie" new_user: "Nouvel utilisateur" no_pending_payments: "Aucun paiement en attente." + remove: "Supprimer" none: "Aucun" not_found: "Non trouvé" notice_messages: @@ -3457,8 +3464,6 @@ fr_CH: start_date: "Date de début" successfully_removed: "Supprimé avec succès" taxonomy_edit: "Modifier la taxonomie" - taxonomy_tree_error: "Erreur de l'arbre de toxonomie" - taxonomy_tree_instruction: "Consignes pour l'arbre de taxonomie" tree: "Arbre" updating: "Mettre à jour" your_order_is_empty_add_product: "Votre commande est vide, veuillez ajouter des produits" diff --git a/config/locales/fr_CM.yml b/config/locales/fr_CM.yml index fa8b672a09..981cbe5f31 100644 --- a/config/locales/fr_CM.yml +++ b/config/locales/fr_CM.yml @@ -34,6 +34,9 @@ fr_CM: shipping_category_id: "Condition de transport" variant_unit: "Unité" variant_unit_name: "Unité de la variante" + spree/variant: + primary_taxon: "Catégorie Produit" + shipping_category_id: "Condition de transport" spree/credit_card: base: "Carte de crédit" number: "N° commande" @@ -614,15 +617,15 @@ fr_CM: index: header: title: Gestion du catalogue produits - sort: - pagination: - clear_search: Annuler la recherche filters: producers: label: Producteurs categories: label: Conditions de transport search: Rechercher + sort: + pagination: + clear_search: Annuler la recherche table: new_variant: Nouvelle variante edit_image: @@ -666,6 +669,9 @@ fr_CM: product_categories: Catégorie Produit tax_categories: TVA applicable shipping_categories: Conditions de transport + dfc_import_form: + enterprise: "Entreprise" + import: "Importer" import: review: Vérifier import: Importer @@ -3337,6 +3343,7 @@ fr_CM: new_taxon: "Nouvelle taxonomie" new_user: "Nouvel utilisateur" no_pending_payments: "Aucun paiement en attente." + remove: "Supprimer" none: "Aucun" not_found: "Non trouvé" notice_messages: @@ -3351,8 +3358,6 @@ fr_CM: start_date: "Date de début" successfully_removed: "Supprimé avec succès" taxonomy_edit: "Modifier la taxonomie" - taxonomy_tree_error: "Erreur de l'arbre de toxonomie" - taxonomy_tree_instruction: "Consignes pour l'arbre de taxonomie" tree: "Arbre" updating: "Mettre à jour" your_order_is_empty_add_product: "Votre commande est vide, veuillez ajouter des produits" diff --git a/config/locales/hi.yml b/config/locales/hi.yml index ca846a1cb9..182872feb8 100644 --- a/config/locales/hi.yml +++ b/config/locales/hi.yml @@ -51,6 +51,9 @@ hi: variant_unit: "वेरिएंट यूनिट" variant_unit_name: "वेरिएंट यूनिट का नाम" unit_value: "यूनिट वैल्यू" + spree/variant: + primary_taxon: "उत्पाद की श्रेणी" + shipping_category_id: "शिपिंग श्रेणी" spree/credit_card: base: "क्रेडिट कार्ड" number: "नंबर" @@ -505,6 +508,7 @@ hi: columns: name: नाम unit: यूनिट + unit_value: यूनिट वैल्यू price: कीमत producer: उत्पादक category: श्रेणी @@ -749,13 +753,6 @@ hi: header: title: बल्क उत्पाद एडिट करें loading: अपने उत्पादों को लोड कर रहा है - sort: - pagination: - total_html: "%{total} उत्पाद आपके सर्च क्राइटेरिया के लिए मिले। %{from} से %{to} दिखा रहा है।" - per_page: - show: दिखाएं - per_page: "%{num} प्रति पेज" - clear_search: सर्च साफ़ करें filters: search_products: उत्पादों के लिए सर्च करें all_producers: सभी उत्पादक @@ -765,6 +762,13 @@ hi: categories: label: श्रेणियां search: सर्च + sort: + pagination: + total_html: "%{total} उत्पाद आपके सर्च क्राइटेरिया के लिए मिले। %{from} से %{to} दिखा रहा है।" + per_page: + show: दिखाएं + per_page: "%{num} प्रति पेज" + clear_search: सर्च साफ़ करें no_products: no_products_found: कोई उत्पाद नहीं मिला import_products: कई उत्पाद इम्पोर्ट करें @@ -826,6 +830,9 @@ hi: product_categories: उत्पाद श्रेणियां tax_categories: टैक्स श्रेणियां shipping_categories: शिपिंग श्रेणियां + dfc_import_form: + enterprise: "एंटरप्राइज़" + import: "इम्पोर्ट करें" import: review: रिव्यू import: इम्पोर्ट करें @@ -3641,6 +3648,7 @@ hi: new_taxon: "नया टैक्सोन" new_user: "नया यूज़र" no_pending_payments: "कोई पेंडिंग भुगतान नहीं" + remove: "मिटाएँ" none: "कोई नहीं" not_found: "नहीं मिला" notice_messages: @@ -3657,8 +3665,6 @@ hi: start_date: "शुरू होने की तिथि" successfully_removed: "सफलतापूर्वक हटाया गया" taxonomy_edit: "टैक्सोनॉमी एडिट करें" - taxonomy_tree_error: "टैक्सोनॉमी ट्री त्रुटि" - taxonomy_tree_instruction: "टैक्सोनॉमी ट्री निर्देश" tree: "ट्री" updating: "अपडेट किया जा रहा है" your_order_is_empty_add_product: "आपका ऑर्डर खाली है, कृपया ऊपर दिए गए उत्पाद को सर्च करें और जोड़ें" diff --git a/config/locales/hu.yml b/config/locales/hu.yml index 17699cbfb5..a1a84a4054 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -6,9 +6,22 @@ hu: spree/shipping_method: Szállítási Mód attributes: spree/order/ship_address: + address1: "Szállítási cím (utca és házszám)" + address2: "Szállítási cím 2. sor" + city: "Szállítási cím város" + country: "Szállítási cím ország" phone: "Telefonszám" firstname: "Keresztnév" lastname: "Vezetéknév" + zipcode: "Szállítási cím irányítószám" + spree/order/bill_address: + address1: "Számlázási cím (Utca és Házszám)" + zipcode: "Számlázási cím Irányítószám" + city: "Számlázási cím Város" + country: "Számlázási cím Ország" + firstname: "Számlázási név Keresztnév" + lastname: "Számlázási cím Vezetéknév" + phone: Vásárlói telefonszám spree/user: password: "Jelszó" password_confirmation: "Jelszó megerősítése" @@ -34,6 +47,10 @@ hu: shipping_category_id: "Szállítási mód" variant_unit: "Változatos egység" variant_unit_name: "Változat egység neve" + unit_value: "Egység értéke" + spree/variant: + primary_taxon: "Termékkategória" + shipping_category_id: "Szállítási mód" spree/credit_card: base: "Hitelkártya" number: "Szám" @@ -253,6 +270,10 @@ hu: order_cycle: subject: "Rendelési ciklus jelentés a következőhöz: %{producer}" provider_settings: "Szolgáltató beállításai" + report_mailer: + report_ready: + subject: "A jelentés kész" + heading: "A jelentés letöltésre kész" shipment_mailer: shipped_email: dear_customer: "Tisztelt Ügyfelünk," @@ -427,6 +448,7 @@ hu: columns: name: Név unit: Mértékegység + unit_value: Egység értéke price: Ár producer: Termelő category: Kategória @@ -670,19 +692,39 @@ hu: index: header: title: Termékek tömeges szerkesztése - sort: - pagination: - clear_search: Keresés törlése + delete_modal: + delete_product_modal: + heading: "Termék törlése" + confirmation_text: "Termék törlése" + delete_variant_modal: + heading: "Változat törlése" + confirmation_text: "Változat törlése" filters: producers: label: Termelők categories: label: Kategóriák search: Keresés + sort: + pagination: + clear_search: Keresés törlése table: + error_summary: + saved: + one: "a termék helyesen lett elmentve, de" + other: "a termékek helyesen lettek elmentve, de" + save: Változások mentése new_variant: Új variáns + bulk_update: + success: Változtatások mentve edit_image: close: Vissza + delete_product: + success: Sikeresen törölte a terméket + error: A terméket nem lehet törölni + delete_variant: + success: Sikeresen törölte a terméket + error: A változatot nem lehet törölni product_import: title: Termék importálása file_not_found: A fájl nem található vagy nem nyitható meg @@ -722,6 +764,9 @@ hu: product_categories: termék kategóriák tax_categories: Adókategóriák shipping_categories: Szállítási módok + dfc_import_form: + enterprise: "Vállalkozás" + import: "Importálás" import: review: Felülvizsgálat import: Importálás @@ -3107,6 +3152,7 @@ hu: processing: "feldolgozás" void: "üres" invalid: "érvénytelen" + quantity_unavailable: "Nem áll rendelkezésre elegendő készlet. A tétel nem menthető!" quantity_unchanged: "A mennyiség nem változott az előző mennyiséghez képest." cancel_the_order_html: "Ez megszakítja a vásárlási folyamatot. Biztosan folytatja?" cancel_the_order_send_cancelation_email: "A törlés elküldése a vásárlónak, emailben." @@ -3431,6 +3477,7 @@ hu: new_taxon: "Új taxon" new_user: "Új felhasználó" no_pending_payments: "Nincsenek függőben lévő kifizetések" + remove: "eltávolítás" none: "Egyik sem" not_found: "Nem található" notice_messages: @@ -3445,8 +3492,6 @@ hu: start_date: "Kezdő dátum" successfully_removed: "Sikeresen eltávolítva" taxonomy_edit: "Termék kategória szerkesztés" - taxonomy_tree_error: "Termék kategória fa hiba" - taxonomy_tree_instruction: "Termék kategória fa" tree: "Fa" updating: "Frissítés" your_order_is_empty_add_product: "Rendelése üres, kérjük keressen és adjon hozzá egy terméket fent" diff --git a/config/locales/it.yml b/config/locales/it.yml index 965a021e85..c5ad8a82e2 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -48,6 +48,9 @@ it: variant_unit: "Unità Variante" variant_unit_name: "Nome Unità Variante" unit_value: "Valore unità" + spree/variant: + primary_taxon: "Categoria Prodotto" + shipping_category_id: "Categoria Spedizioni" spree/credit_card: base: "Carta di Credito" number: "Numero" @@ -469,6 +472,7 @@ it: columns: name: Nome unit: Unità + unit_value: Valore unità price: Prezzo producer: Produttore category: Categoria @@ -712,15 +716,15 @@ it: index: header: title: Modifica prodotti tabella - sort: - pagination: - clear_search: Pulisci ricerca filters: producers: label: Produttori categories: label: categorie search: Cerca + sort: + pagination: + clear_search: Pulisci ricerca table: new_variant: Nuova variante edit_image: @@ -766,6 +770,9 @@ it: product_categories: Categorie Prodotti tax_categories: Categorie imposte shipping_categories: Categorie Spedizioni + dfc_import_form: + enterprise: "Azienda" + import: "Importazione" import: review: Revisione import: Importazione @@ -3509,6 +3516,7 @@ it: new_taxon: "Nuova tassonomia" new_user: "Nuovo utente" no_pending_payments: "Nessun pagamento in sospeso" + remove: "Rimuovi" none: "Nessuno" not_found: "Non trovato" notice_messages: @@ -3525,8 +3533,6 @@ it: start_date: "Data inizio" successfully_removed: "Rimosso con successo" taxonomy_edit: "Modifica tassonomia" - taxonomy_tree_error: "Errore schema tassonomia" - taxonomy_tree_instruction: "Istruzioni schema tassonomia" tree: "Schema" updating: "In aggiornamento" your_order_is_empty_add_product: "Il tuo ordine è vuoto, cerca e aggiungi un prodotto qui sopra" diff --git a/config/locales/it_CH.yml b/config/locales/it_CH.yml index 3856beaa28..ea951827a5 100644 --- a/config/locales/it_CH.yml +++ b/config/locales/it_CH.yml @@ -34,6 +34,9 @@ it_CH: shipping_category_id: "Categoria Spedizioni" variant_unit: "Unità Variante" variant_unit_name: "Nome Unità Variante" + spree/variant: + primary_taxon: "Categoria prodotto" + shipping_category_id: "Categoria Spedizioni" spree/credit_card: base: "Carta di Credito" number: "Numero" @@ -655,15 +658,15 @@ it_CH: index: header: title: Modifica prodotti tabella - sort: - pagination: - clear_search: Pulisci ricerca filters: producers: label: Produttori categories: label: categorie search: Cerca + sort: + pagination: + clear_search: Pulisci ricerca table: new_variant: Nuova variante edit_image: @@ -707,6 +710,9 @@ it_CH: product_categories: Categorie Prodotti tax_categories: Categorie imposte shipping_categories: Categorie Spedizioni + dfc_import_form: + enterprise: "Azienda" + import: "Importazione" import: review: Revisione import: Importazione @@ -3372,6 +3378,7 @@ it_CH: new_taxon: "Nuova tassonomia" new_user: "Nuovo utente" no_pending_payments: "Nessun pagamento in sospeso" + remove: "Rimuovi" none: "Nessuno" not_found: "Non trovato" notice_messages: @@ -3386,8 +3393,6 @@ it_CH: start_date: "Data inizio" successfully_removed: "Rimosso con successo" taxonomy_edit: "Modifica tassonomia" - taxonomy_tree_error: "Errore schema tassonomia" - taxonomy_tree_instruction: "Istruzioni schema tassonomia" tree: "Schema" updating: "In aggiornamento" your_order_is_empty_add_product: "Il tuo ordine è vuoto, cerca e aggiungi un prodotto qui sopra" diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 5342544798..2484c4f61f 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -34,6 +34,9 @@ ko: shipping_category_id: "전송물품 목록" variant_unit: "구성 단위 변경" variant_unit_name: "변경된 구성 단위 이름" + spree/variant: + primary_taxon: "물품 목록" + shipping_category_id: "전송물품 목록" spree/credit_card: base: "신용카드" number: "숫자" @@ -678,15 +681,15 @@ ko: index: header: title: 제품 대량 편집 - sort: - pagination: - clear_search: 검색 지우기 filters: producers: label: 생산자들 categories: label: 카테고리 search: 탐색 + sort: + pagination: + clear_search: 검색 지우기 table: new_variant: 새로운 변경사항 edit_image: @@ -730,6 +733,9 @@ ko: product_categories: 제품 카테고리 tax_categories: 세금 카테고리 shipping_categories: 배송 카테고리 + dfc_import_form: + enterprise: "회사" + import: "수입" import: review: 리뷰 import: 수입 @@ -3338,6 +3344,7 @@ ko: new_taxon: "새 분류군" new_user: "신규 사용자" no_pending_payments: "미지금급" + remove: "제거" none: "아니다" not_found: "찾을 수 없습니다" notice_messages: @@ -3352,8 +3359,6 @@ ko: start_date: "시작 날짜" successfully_removed: "성공적으로 제거됨" taxonomy_edit: "분류법 편집" - taxonomy_tree_error: "분류법 트리 오류" - taxonomy_tree_instruction: "분류법 트리 소개" tree: "트리" updating: "업데이트 중" your_order_is_empty_add_product: "주문이 비어 있습니다. 위의 제품을 검색하여 추가하십시오." diff --git a/config/locales/ml.yml b/config/locales/ml.yml index 9b4f01cd72..7126238da9 100644 --- a/config/locales/ml.yml +++ b/config/locales/ml.yml @@ -51,6 +51,9 @@ ml: variant_unit: "വേരിയന്റ് യൂണിറ്റ്" variant_unit_name: "വേരിയന്റ് യൂണിറ്റിന്റെ പേര്" unit_value: "യൂണിറ്റ് മൂല്യം" + spree/variant: + primary_taxon: "ഉൽപ്പന്ന വിഭാഗം" + shipping_category_id: "അയക്കൽ വിഭാഗം" spree/credit_card: base: "ക്രെഡിറ്റ് കാർഡ്" number: "നമ്പർ" @@ -505,6 +508,7 @@ ml: columns: name: പേര് unit: യൂണിറ്റ് + unit_value: യൂണിറ്റ് മൂല്യം price: വില producer: പ്രൊഡ്യൂസർ category: വിഭാഗം @@ -752,13 +756,6 @@ ml: header: title: ഉൽപ്പന്നങ്ങൾ മൊത്തമായി തിരുത്തുക loading: നിങ്ങളുടെ ഉൽപ്പന്നങ്ങൾ ലോഡ് ചെയ്യുന്നു - sort: - pagination: - total_html: "നിങ്ങളുടെ തിരയൽ മാനദണ്ഡങ്ങൾക്കനുസരിച്ച് %{total} ഉൽപ്പന്നങ്ങൾ കണ്ടെത്തി. %{from} മുതൽ %{to} വരെ കാണിക്കുന്നു." - per_page: - show: കാണിക്കുക - per_page: "ഓരോ പേജിലും %{num}" - clear_search: തിരയൽ മായ്‌ക്കുക filters: search_products: ഉൽപ്പന്നങ്ങൾക്കായി തിരയുക all_producers: എല്ലാ പ്രൊഡ്യൂസേഴ്‌സും @@ -768,6 +765,13 @@ ml: categories: label: വിഭാഗങ്ങൾ search: തിരയുക + sort: + pagination: + total_html: "നിങ്ങളുടെ തിരയൽ മാനദണ്ഡങ്ങൾക്കനുസരിച്ച് %{total} ഉൽപ്പന്നങ്ങൾ കണ്ടെത്തി. %{from} മുതൽ %{to} വരെ കാണിക്കുന്നു." + per_page: + show: കാണിക്കുക + per_page: "ഓരോ പേജിലും %{num}" + clear_search: തിരയൽ മായ്‌ക്കുക no_products: no_products_found: ഉൽപ്പന്നങ്ങളൊന്നും കണ്ടെത്തിയില്ല import_products: ഒന്നിലധികം ഉൽപ്പന്നങ്ങൾ ഇറക്കുമതി ചെയ്യുക @@ -831,6 +835,9 @@ ml: product_categories: ഉൽപ്പന്ന വിഭാഗങ്ങൾ tax_categories: നികുതി വിഭാഗങ്ങൾ shipping_categories: ഷിപ്പിംഗ് വിഭാഗങ്ങൾ + dfc_import_form: + enterprise: "എന്റർപ്രൈസ്" + import: "ഇറക്കുമതി ചെയ്യുക" import: review: അവലോകനം import: ഇറക്കുമതി ചെയ്യുക @@ -3665,6 +3672,7 @@ ml: new_taxon: "പുതിയ ടാക്സൺ" new_user: "പുതിയ ഉപയോക്താവ്" no_pending_payments: "തീർപ്പാക്കാത്ത പേയ്‌മെന്റുകളൊന്നുമില്ല" + remove: "നീക്കം ചെയ്യുക" none: "ഒന്നുമില്ല" not_found: "കണ്ടെത്തിയില്ല" notice_messages: @@ -3681,8 +3689,6 @@ ml: start_date: "ആരംഭിക്കുന്ന തീയതി" successfully_removed: "വിജയകരമായി നീക്കം ചെയ്തു" taxonomy_edit: "ടാക്സോണമി എഡിറ്റ്" - taxonomy_tree_error: "ടാക്സോണമി ട്രീ തകരാർ" - taxonomy_tree_instruction: "ടാക്സോണമി ട്രീ നിർദ്ദേശം" tree: "ട്രീ" updating: "അപ്ഡേറ്റ് ചെയ്യുന്നു" your_order_is_empty_add_product: "നിങ്ങളുടെ ഓർഡർ ശൂന്യമാണ്, മുകളിൽ ഒരു ഉൽപ്പന്നം തിരയുകയും ചേർക്കുകയും ചെയ്യുക" diff --git a/config/locales/mr.yml b/config/locales/mr.yml index a8d0b9bc12..df80ca985c 100644 --- a/config/locales/mr.yml +++ b/config/locales/mr.yml @@ -51,6 +51,9 @@ mr: variant_unit: "व्हेरिएंट युनिट" variant_unit_name: "वेरिएंट युनिटचे नाव" unit_value: "युनिट मूल्य" + spree/variant: + primary_taxon: "उत्पादन श्रेणी" + shipping_category_id: "शिपिंग श्रेणी" spree/credit_card: base: "क्रेडीट कार्ड" number: "क्रमांक" @@ -505,6 +508,7 @@ mr: columns: name: नाव unit: युनिट + unit_value: युनिट मूल्य price: किंमत producer: उत्पादक category: श्रेणी @@ -748,13 +752,6 @@ mr: header: title: मोठ्या प्रमाणात उत्पादने संपादित करा loading: तुमची उत्पादने लोड करत आहे - sort: - pagination: - total_html: "तुमच्या शोध निकषांसाठी %{total} उत्पादने आढळली. %{from} ते %{to} दाखवत आहे." - per_page: - show: दाखवा - per_page: "%{num} प्रति पृष्ठ" - clear_search: सर्च क्लिअर करा filters: search_products: उत्पादने शोधा all_producers: सर्व उत्पादक @@ -764,6 +761,13 @@ mr: categories: label: श्रेण्या search: शोधा + sort: + pagination: + total_html: "तुमच्या शोध निकषांसाठी %{total} उत्पादने आढळली. %{from} ते %{to} दाखवत आहे." + per_page: + show: दाखवा + per_page: "%{num} प्रति पृष्ठ" + clear_search: सर्च क्लिअर करा no_products: no_products_found: कोणतीही उत्पादने आढळली नाहीत import_products: अनेक उत्पादने आयात करा @@ -822,6 +826,9 @@ mr: product_categories: उत्पादन श्रेणी tax_categories: कर श्रेणी shipping_categories: शिपिंग श्रेण्या + dfc_import_form: + enterprise: "एंटरप्राइझ" + import: "Import करा" import: review: पुनरावलोकन करा import: आयात करा @@ -3588,8 +3595,6 @@ mr: start_date: "प्रारंभ तारीख" successfully_removed: "यशस्वीरित्या काढले" taxonomy_edit: "वर्गीकरण संपादन" - taxonomy_tree_error: "वर्गीकरण वृक्ष त्रुटी" - taxonomy_tree_instruction: "वर्गीकरण वृक्ष सूचना" tree: "वृक्ष" updating: "अपडेट करत आहे" your_order_is_empty_add_product: "तुमची ऑर्डर रिकामी आहे, कृपया उत्पादन शोधा आणि वर समाविष्ट करा" diff --git a/config/locales/nb.yml b/config/locales/nb.yml index 8d77563952..3fe54ffd61 100644 --- a/config/locales/nb.yml +++ b/config/locales/nb.yml @@ -51,6 +51,9 @@ nb: variant_unit: "Variant Enhet" variant_unit_name: "Enhetsnavn Variant" unit_value: "Enhetsverdi" + spree/variant: + primary_taxon: "Produktkategori" + shipping_category_id: "Leveringskategori" spree/credit_card: base: "Kredittkort" number: "Antall" @@ -510,6 +513,7 @@ nb: columns: name: Navn unit: Enhet + unit_value: Enhetsverdi price: Pris producer: Produsent category: Kategori @@ -768,13 +772,6 @@ nb: prompt: "Dette vil fjerne den permanent fra listen din." confirmation_text: "Slett variant" cancellation_text: "Behold variant" - sort: - pagination: - total_html: "%{total} produkter funnet for søkekriteriene dine. Viser %{from} til %{to} ." - per_page: - show: Vis - per_page: "%{num} per side" - clear_search: Tøm søk filters: search_products: Søk etter produkter search_for_producers: Søk etter produsenter @@ -786,6 +783,13 @@ nb: categories: label: Kategorier search: Søk + sort: + pagination: + total_html: "%{total} produkter funnet for søkekriteriene dine. Viser %{from} til %{to} ." + per_page: + show: Vis + per_page: "%{num} per side" + clear_search: Tøm søk no_products: no_products_found: Ingen produkter funnet import_products: Importer flere produkter @@ -857,6 +861,9 @@ nb: product_categories: Produktkategorier tax_categories: Avgiftskategorier shipping_categories: Fraktkategorier + dfc_import_form: + enterprise: "Bedrift" + import: "Import" import: review: Anmeldelse import: Import @@ -3703,6 +3710,7 @@ nb: new_taxon: "Ny kategori" new_user: "Ny bruker" no_pending_payments: "Ingen ventende betalinger" + remove: "Fjern" none: "Ingen" not_found: "Ikke funnet" notice_messages: @@ -3719,8 +3727,6 @@ nb: start_date: "Startdato" successfully_removed: "Fjernet OK" taxonomy_edit: "Rediger kategori" - taxonomy_tree_error: "Feil i kategoritre" - taxonomy_tree_instruction: "Instruksjon for kategoritre" tree: "Tre" updating: "Oppdaterer" your_order_is_empty_add_product: "Bestillingen din er tom, vennligst søk etter og legg til et produkt over" diff --git a/config/locales/nl_BE.yml b/config/locales/nl_BE.yml index d55114fb4a..df9de41f92 100644 --- a/config/locales/nl_BE.yml +++ b/config/locales/nl_BE.yml @@ -34,6 +34,9 @@ nl_BE: shipping_category_id: "Verzendcategorie" variant_unit: "Eénheid" variant_unit_name: "Variant Unit Name" + spree/variant: + primary_taxon: "Product categorie" + shipping_category_id: "Verzendcategorie" spree/credit_card: base: "Kredietkaart" number: "Nummer" @@ -535,15 +538,15 @@ nl_BE: index: header: title: Beheer van de productencatalogus - sort: - pagination: - clear_search: Verwijder zoektermen filters: producers: label: Producenten categories: label: Categorieën search: Zoeken + sort: + pagination: + clear_search: Verwijder zoektermen table: new_variant: Nieuw variant edit_image: @@ -587,6 +590,9 @@ nl_BE: product_categories: Productcategorieën tax_categories: Belastingcategorieën shipping_categories: Verzendingscategorieën + dfc_import_form: + enterprise: "Onderneming" + import: "Importeren" import: review: Beoordeling import: Importeren @@ -2984,6 +2990,7 @@ nl_BE: credit: "Krediet" more: "Meer" no_pending_payments: "Geen betaling in afhandeling" + remove: "Verwijderen" none: "Geen enkele" updating: "Updatend" your_order_is_empty_add_product: "Je bestelling is leeg, gelieve hierboven een product te zoeken en toe te voegen " diff --git a/config/locales/pa.yml b/config/locales/pa.yml index a257e79bc2..426a227655 100644 --- a/config/locales/pa.yml +++ b/config/locales/pa.yml @@ -48,6 +48,9 @@ pa: variant_unit: "ਵੇਰੀਐਂਟ ਯੂਨਿਟ" variant_unit_name: "ਵੇਰੀਐਂਟ ਯੂਨਿਟ ਦਾ ਨਾਮ" unit_value: "ਯੂਨਿਟ ਵੈਲਯੂ" + spree/variant: + primary_taxon: "ਉਤਪਾਦ ਸ਼੍ਰੇਣੀ" + shipping_category_id: "ਸ਼ਿਪਿੰਗ ਸ਼੍ਰੇਣੀ" spree/credit_card: base: "ਕਰੇਡਿਟ ਕਾਰਡ" number: "ਨੰਬਰ" @@ -498,6 +501,7 @@ pa: columns: name: ਨਾਮ unit: ਯੂਨਿਟ + unit_value: ਯੂਨਿਟ ਵੈਲਯੂ price: ਕੀਮਤ producer: ਉਤਪਾਦਕ category: ਸ਼੍ਰੇਣੀ @@ -741,13 +745,6 @@ pa: header: title: ਥੋਕ ਸੰਪਾਦਿਤ ਉਤਪਾਦ loading: ਤੁਹਾਡੇ ਉਤਪਾਦ ਲੋਡ ਕੀਤੇ ਜਾ ਰਹੇ ਹਨ - sort: - pagination: - total_html: "ਤੁਹਾਡੇ ਖੋਜ ਮਾਪਦੰਡ ਲਈ %{total} ਉਤਪਾਦ ਮਿਲੇ ਹਨ। %{from} ਤੋਂ %{to} ਦਿਖਾ ਰਹੇ ਹਨ।" - per_page: - show: ਵਿਖਾਓ - per_page: "%{num} ਪ੍ਰਤੀ ਪੇਜ" - clear_search: ਖੋਜ ਮਿਟਾਓ filters: search_products: ਉਤਪਾਦਾਂ ਦੀ ਖੋਜ ਕਰੋ all_producers: ਸਾਰੇ ਉਤਪਾਦਕ @@ -757,6 +754,13 @@ pa: categories: label: ਸ਼੍ਰੇਣੀਆਂ search: ਖੋਜੋ + sort: + pagination: + total_html: "ਤੁਹਾਡੇ ਖੋਜ ਮਾਪਦੰਡ ਲਈ %{total} ਉਤਪਾਦ ਮਿਲੇ ਹਨ। %{from} ਤੋਂ %{to} ਦਿਖਾ ਰਹੇ ਹਨ।" + per_page: + show: ਵਿਖਾਓ + per_page: "%{num} ਪ੍ਰਤੀ ਪੇਜ" + clear_search: ਖੋਜ ਮਿਟਾਓ no_products: no_products_found: ਕੋਈ ਉਤਪਾਦ ਨਹੀਂ ਲੱਭੇ import_products: ਇੱਕ ਤੋਂ ਜ਼ਿਆਦਾ ਉਤਪਾਦ ਇਮਪੋਰਟ ਕਰੋ @@ -810,6 +814,9 @@ pa: product_categories: ਉਤਪਾਦ ਸ਼੍ਰੇਣੀਆਂ tax_categories: ਟੈਕਸ ਸ਼੍ਰੇਣੀਆਂ shipping_categories: ਸ਼ਿਪਿੰਗ ਸ਼੍ਰੇਣੀਆਂ + dfc_import_form: + enterprise: "ਐਂਟਰਪ੍ਰਾਈਜ਼" + import: "ਇਮਪੋਰਟ" import: review: ਸਮੀਖਿਆ import: ਇਮਪੋਰਟ @@ -3535,6 +3542,7 @@ pa: new_taxon: "ਨਵਾਂ ਟੈਕਸੋਨ" new_user: "ਨਵਾਂ ਉਪਭੋਗਤਾ" no_pending_payments: "ਕੋਈ ਬਕਾਇਆ ਭੁਗਤਾਨ ਨਹੀਂ ਹੈ" + remove: "Remove" none: "ਕੋਈ ਨਹੀਂ" not_found: "ਨਹੀਂ ਲਭਿਆ" notice_messages: @@ -3551,8 +3559,6 @@ pa: start_date: "ਸ਼ੁਰੂ ਕਰਨ ਦੀ ਮਿਤੀ" successfully_removed: "ਸਫਲਤਾਪੂਰਵਕ ਹਟਾਇਆ ਗਿਆ" taxonomy_edit: "ਟੈਕਸੋਨੌਮੀ ਸੰਪਾਦਨ" - taxonomy_tree_error: "ਟੈਕਸੋਨੌਮੀ ਟ੍ਰੀ ਗਲਤੀ" - taxonomy_tree_instruction: "ਟੈਕਸੋਨੌਮੀ ਟ੍ਰੀ ਹਿਦਾਇਤ" tree: "ਟ੍ਰੀ" updating: "ਅੱਪਡੇਟ ਹੋ ਰਿਹਾ ਹੈ" your_order_is_empty_add_product: "ਤੁਹਾਡਾ ਆਰਡਰ ਖਾਲੀ ਹੈ, ਕਿਰਪਾ ਕਰਕੇ ਉਪਰ ਇੱਕ ਉਤਪਾਦ ਦੀ ਖੋਜ ਕਰੋ ਅਤੇ ਜੋੜੋ" diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 36c2f9d75e..8348a75138 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -29,6 +29,9 @@ pl: shipping_category_id: "Kategoria dostawy" variant_unit: "Jednostka wariantu" variant_unit_name: "Nazwa jednostki wariantu" + spree/variant: + primary_taxon: "Kategoria produktu" + shipping_category_id: "Kategoria dostawy" spree/credit_card: base: "Karta kredytowa" number: "Numer zamówienia" @@ -561,6 +564,9 @@ pl: product_categories: Kategorie produktów tax_categories: Kategorie podatków shipping_categories: Kategorie dostaw + dfc_import_form: + enterprise: "Podmiot" + import: "Import" import: review: Przejrzyj import: Import @@ -2972,6 +2978,7 @@ pl: category: "Kategoria" more: "Więcej" no_pending_payments: "Brak oczekujących płatności" + remove: "Usuń" none: "Nic" your_order_is_empty_add_product: "Twoje zamówienie jest puste, wyszukaj i dodaj produkt powyżej" add_product: "Dodaj produkt" diff --git a/config/locales/pt.yml b/config/locales/pt.yml index ea7a09d3fb..00ab7fc455 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -34,6 +34,9 @@ pt: shipping_category_id: "Categoria de Envio" variant_unit: "Unidade da Variante" variant_unit_name: "Nome da Unidade da Variante" + spree/variant: + primary_taxon: "Categoria de Produto" + shipping_category_id: "Categoria de Envio" spree/credit_card: base: "Cartão de Crédito" number: "Número" @@ -623,6 +626,9 @@ pt: product_categories: Categorias de Produtos tax_categories: Categorias de Impostos shipping_categories: Categorias de Envio + dfc_import_form: + enterprise: "Organização" + import: "Importar" import: review: Rever import: Importar @@ -3007,6 +3013,7 @@ pt: credit: "Crédito" more: "Mais" no_pending_payments: "Sem pagamentos pendentes" + remove: "Remover" none: "Nenhum" updating: "Atualizando" your_order_is_empty_add_product: "A sua encomenda está vazia, por favor procure e adicione um produto em cima" diff --git a/config/locales/pt_BR.yml b/config/locales/pt_BR.yml index 61bad0de0e..01c66c961e 100644 --- a/config/locales/pt_BR.yml +++ b/config/locales/pt_BR.yml @@ -32,6 +32,9 @@ pt_BR: shipping_category_id: "Tipos de Frete" variant_unit: "Unidade variante" variant_unit_name: "Nome da unidade variante" + spree/variant: + primary_taxon: "Categoria de Produto" + shipping_category_id: "Tipos de Frete" spree/credit_card: base: "Cartão de Crédito" number: "Número" @@ -616,13 +619,13 @@ pt_BR: index: header: title: Editar Produtos em Atacado - sort: - pagination: - clear_search: Nova busca filters: producers: label: Produtores search: Buscar + sort: + pagination: + clear_search: Nova busca edit_image: close: Voltar product_import: @@ -664,6 +667,9 @@ pt_BR: product_categories: Categorias de Produtos tax_categories: Categorias fiscais shipping_categories: Categorias de Remessa + dfc_import_form: + enterprise: "Iniciativas" + import: "Importar" import: review: Reveja import: Importar @@ -3232,6 +3238,7 @@ pt_BR: new_taxon: "Nova taxonomia" new_user: "Novo usuário" no_pending_payments: "Nenhum pagamento pendente" + remove: "Remover" none: "Nenhum" not_found: "Não encontrado" notice_messages: @@ -3243,8 +3250,6 @@ pt_BR: start_date: "Data de início" successfully_removed: "Removido com Sucesso" taxonomy_edit: "Editar Taxonomia" - taxonomy_tree_error: "Erro na árvore taxonômica" - taxonomy_tree_instruction: "Guia para a árvore taxonômica" tree: "Árvore" updating: "Atualizando" your_order_is_empty_add_product: "Seu pedido está vazio, pesquise e adicione um produto acima" diff --git a/config/locales/ru.yml b/config/locales/ru.yml index fd1c94e793..76076fc356 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -1,5 +1,8 @@ ru: language_name: "Русский" + time: + formats: + long: "%B %d, %Y %-l:%M %p" activerecord: models: spree/product: Товар @@ -48,6 +51,9 @@ ru: variant_unit: "Единица Варианта" variant_unit_name: "Название Единицы Варианта" unit_value: "Значение товара" + spree/variant: + primary_taxon: "Категория Товара" + shipping_category_id: "Категория Доставки" spree/credit_card: base: "Кредитная Карта" number: "Номер" @@ -75,6 +81,10 @@ ru: models: enterprise_fee: inherit_tax_requires_per_item_calculator: "Для наследования налоговой категории требуется поэлементный калькулятор." + spree/image: + attributes: + attachment: + integrity_error: "ошибка загрузки. Пожалуйста, проверьте, не поврежден ли файл и повторите попытку." spree/user: attributes: email: @@ -97,7 +107,9 @@ ru: on_demand_but_count_on_hand_set: "должен быть пустым, если по требованию'" limited_stock_but_no_count_on_hand: "необходимо указать, поскольку принудительный ограниченный запас" messages: + confirmation: "не соответствует %{attribute}" blank: "не может быть пустым" + too_short: "слишком короткий (минимум %{count} символов)" errors: messages: content_type_invalid: "имеет неверный тип контента" @@ -129,6 +141,7 @@ ru: unprocessable_entity: title: "Требуемое изменение было отклонено (422)" message_html: "

Требуемое изменение было отклонено. Возможно, вы пытались изменить что-то, к чему у вас нет доступа.

Вернуться домой

" + stimulus_reflex_error: "Нам очень жаль, но что-то пошло не так.\n\n Возможно, это временная проблема, поэтому повторите попытку или перезагрузите страницу.\n Мы записываем все ошибки и возможно уже работаем над их исправлением.\n Если проблема не устранена или срочная, пожалуйста, свяжитесь с нами." stripe: error_code: incorrect_number: "Номер карты неверный." @@ -289,6 +302,10 @@ ru: integer_array_validator: not_array_error: "должен быть массивом" invalid_element_error: "должен содержать только правильные целые числа" + report_job: + report_failed: | + Ошибка создания отчета. Возможно, он слишком велик для обработки. + Мы рассмотрим эту проблему, но, пожалуйста, сообщите нам, если проблема не исчезнет. enterprise_mailer: confirmation_instructions: subject: "Пожалуйста, подтвердите адрес электронной почты для %{enterprise}" @@ -378,6 +395,7 @@ ru: cancel_order: "Отменить Заказ" confirm_send_invoice: "Счет на этот заказ будет отправлен клиенту. Вы уверены что хотите продолжить?" confirm_resend_order_confirmation: "Вы уверены, что хотите повторно отправить письмо с подтверждением заказа?" + must_have_valid_business_number: "Чтобы можно было использовать счета, %{enterprise_name} должен иметь корректный ИНН." invoice: "Счёт" invoices: "Счета" file: "Файл" @@ -495,7 +513,10 @@ ru: colums: Колонки columns: name: Название + unit_scale: Единицы unit: Единица измерения + unit_value: Значение товара + display_as: Отображать единицы как price: Цена producer: Производитель category: Категория @@ -587,6 +608,9 @@ ru: has_n_rules: "имеет %{num} правил" unsaved_confirm_leave: "На этой странице есть несохранённые изменения. Продолжить без сохранения?" available_units: "Доступные Единицы" + terms_of_service_have_been_updated_html: "Обновлены Условия Сервиса Открытой Сети Продуктов: %{tos_link}" + terms_of_service: Прочтите Условия Сервиса + accept_terms_of_service: Принять Условия Сервиса shopfront_settings: embedded_shopfront_settings: "Настройки Встроенного Магазина" enable_embedded_shopfronts: "Включить Встроенные Витрины" @@ -674,6 +698,10 @@ ru: your_content: Ваше Содержимое user_guide: Руководство Пользователя map: Карта + dfc_product_imports: + index: + title: "Импорт каталога продуктов DFC" + imported_products: "Внесенные товары:" enterprise_fees: index: title: "Сборы Предприятия" @@ -740,22 +768,67 @@ ru: header: title: Массовое редактирование товаров loading: Загрузка ваших товаров - sort: - pagination: - clear_search: Сбросить поиск + delete_modal: + delete_product_modal: + heading: "Удалить товар" + prompt: "Это навсегда удалит его из вашего списка." + confirmation_text: "Удалить товар" + cancellation_text: "Сохранить товар" + delete_variant_modal: + heading: "Удалить вариант" + prompt: "Это навсегда удалит его из вашего списка." + confirmation_text: "Удалить вариант" + cancellation_text: "Сохранить вариант" filters: + search_products: Поиск товаров + search_for_producers: Поиск производителей + all_producers: Все производители + search_for_categories: Поиск категорий + all_categories: Все категории producers: label: Производители categories: label: Категории search: Поиск + sort: + pagination: + total_html: "%{total} товаров найдено по вашим критериям поиска. Показаны %{from} до %{to} ." + per_page: + show: Показывать + per_page: "%{num} на странице" + clear_search: Сбросить поиск no_products: no_products_found: Товары не найдены import_products: Импорт нескольких товаров + no_products_found_for_search: По вашим критериям поиска товары не найдены table: + changed_summary: + one: "%{count} товар изменен." + other: "%{count} товары изменены." + error_summary: + saved: + one: "%{count} товар был сохранен правильно, но " + other: "%{count} товары сохранились корректно, но " + invalid: + one: "%{count} продукт не удалось сохранить. Пожалуйста, просмотрите ошибки и повторите попытку." + few: "%{count} продукты не удалось сохранить. Пожалуйста, просмотрите ошибки и повторите попытку." + many: "%{count} продукты не удалось сохранить. Пожалуйста, просмотрите ошибки и повторите попытку." + other: "%{count} товары не удалось сохранить. Пожалуйста, просмотрите ошибки и повторите попытку." + reset: Отменить изменения + save: Сохранить изменения new_variant: Новый вариант + bulk_update: + success: Изменения сохранены edit_image: + title: Изменить фотографию товара close: Назад + upload: Загрузить фото + delete_product: + success: Товар успешно удален + error: Невозможно удалить товар + delete_variant: + success: Вариант успешно удален. + error: Невозможно удалить вариант product_import: title: Импорт Товара file_not_found: Файл не найден или не может быть открыт @@ -797,6 +870,11 @@ ru: product_categories: Категории Товаров tax_categories: Налоговые Категории shipping_categories: Категории Доставки + dfc_import_form: + title: "Импорт из каталога DFC" + enterprise: "Предприятие" + catalog_url: "URL-адрес каталога DFC" + import: "Импорт" import: review: Просмотр import: Импорт @@ -898,6 +976,7 @@ ru: orders: edit: order_sure_want_to: Вы уверены, что хотите %{event} этот заказ? + voucher_tax_included_in_price: "%{label} (налог включен в купон)" invoice_email_sent: 'Письмо Счета отправлено' order_email_resent: 'Письмо Заказа отправлено' bulk_management: @@ -1000,6 +1079,7 @@ ru: images: legend: "Изображения" logo: Логотип + logo_size: "300 х 300 пикселей" promo_image_placeholder: 'Это изображение будет отображаться в "О Нас"' promo_image_note1: 'ОБРАТИТЕ ВНИМАНИЕ:' promo_image_note2: Любое загруженное здесь промо изображение будет обрезано до 1200x260. @@ -1104,6 +1184,7 @@ ru: open_date: "Время Открытия" close_date: "Время Закрытия" display_ordering_in_shopfront: "Отображение заказа на витрине:" + shopfront_sort_by_product: "По товару" shopfront_sort_by_category: "По категории" shopfront_sort_by_producer: "По производителю" shopfront_sort_by_category_placeholder: "Категория" @@ -1186,7 +1267,16 @@ ru: custom_tab_title: "Название пользовательской вкладки" custom_tab_content: "Контент для пользовательской вкладки" connected_apps: + legend: "Подключенные приложения" + title: "Discover Regenerative" + tagline: "Разрешите Discover Regenerative публиковать информацию о вашем предприятии." + enable: "Разрешить обмен данными" + disable: "Прекратить обмен данными" loading: "Загружается" + note: | + Ваша учетная запись Открытой Сети Продуктов подключена к Discover Regenerative. + Добавьте или обновите информацию о своем списке Discover Regenerative здесь. + link_label: "Управление списком" actions: edit_profile: Настройки properties: Свойства @@ -1416,6 +1506,8 @@ ru: has_no_payment_methods: "%{enterprise} не имеет способов оплаты" has_no_shipping_methods: "%{enterprise} не имеет способов доставки" has_no_enterprise_fees: "%{enterprise} не имеет сборов предприятия" + flashes: + dismiss: Отклонять side_menu: enterprise: primary_details: "Основная Информация" @@ -1436,6 +1528,7 @@ ru: users: "Пользователи" vouchers: Купоны white_label: "Белая Этикетка" + connected_apps: "Подключенные приложения" enterprise_group: primary_details: "Основная Информация" users: "Пользователи" @@ -1519,6 +1612,7 @@ ru: name: "Сводка Сборов Предприятия" description: "Сводная Информация о Сборах с Предприятия" enterprise_fees_with_tax_report_by_order: "Сборы Предприятия с Налоговым Отчетом по Заказу" + enterprise_fees_with_tax_report_by_producer: "Комиссионные Сборы Предприятия С Налоговым Отчетом По Производителю" errors: no_report_type: "Укажите тип отчета" report_not_found: "Отчет не найден" @@ -1555,9 +1649,15 @@ ru: index: title: "Настройки OIDC" connect: "Подключить свою учетную запись" + disconnect: "Отключить" + connected: "Ваша учетная запись связана с %{uid} ." les_communs_link: "Les Communs Open ID сервер" link_your_account: "Сначала вам необходимо связать свою учетную запись с поставщиком авторизации, используемым DFC (Les Communs Open ID Connect)." link_account_button: "Свяжите свою учетную запись Les Communs OIDC" + note_expiry: | + Срок действия токенов для доступа к подключенным приложениям истек. Пожалуйста, обновите ваше + подключение учетной записи для поддержания работы всех интеграций. + refresh: "Обновить авторизацию" view_account: "Чтобы просмотреть свою учетную запись, см.:" subscriptions: index: @@ -1662,6 +1762,9 @@ ru: save: Сохранить voucher_code: Код Купона voucher_amount: Количество + voucher_type: Тип Купона + flat_rate: Плоский + percentage_rate: Процент (%) controllers: enterprises: stripe_connect_cancelled: "Подключение к Stripe было отменено" @@ -1868,21 +1971,26 @@ ru: invoice_column_price: "Цена" invoice_column_item: "Позиция" invoice_column_qty: "Кол-во" + invoice_column_weight_volume: "Вес / ОБЪЕМ." invoice_column_unit_price_with_taxes: "Цена за единицу (Вкл. налоги)" invoice_column_unit_price_without_taxes: "Цена за единицу (Искл. налоги)" invoice_column_price_with_taxes: "Итоговая цена (Искл. налоги)" invoice_column_price_without_taxes: "Итоговая цена (Вкл. налоги)" + invoice_column_price_per_unit_without_taxes: "Цена За Единицу (без налога)" invoice_column_tax_rate: "Налоговая ставка" invoice_tax_total: "Всего налогов:" + invoice_cancel_and_replace_invoice: "отменяет и заменяет счет" tax_invoice: "СЧЁТ" tax_total: "Всего налога (%{rate}):" invoice_shipping_category_delivery: "Доставка" invoice_shipping_category_pickup: "Самовывоз" total_excl_tax: "Всего (Искл. налог):" total_incl_tax: "Всего (Вкл. налог):" + total_all_tax: "Общий налог:" abn: "ИНН" acn: "Юридическое название" invoice_issued_on: "Счёт выписан:" + order_number: "Номер заказа:" date_of_transaction: "Дата операции:" menu_1_title: "Магазины" menu_1_url: "/shops" @@ -2095,6 +2203,9 @@ ru: order_back_to_store: Назад В Магазин order_back_to_cart: Назад В Корзину order_back_to_website: Вернуться На Сайт + checkout_details_title: Детали Заказа + checkout_payment_title: Оплата Заказа + checkout_summary_title: Информация по заказу bom_tip: "Используйте эту страницу для изменения количества товара в нескольких заказах. Если необходимо, Товары могут быть полностью удалены из заказов." unsaved_changes_warning: "Есть несохраненные изменения, которые будут потеряны, если вы продолжите." unsaved_changes_error: "Поля с красными границами содержат ошибки." @@ -2957,6 +3068,11 @@ ru: report_header_transaction_fee: Комиссия за Операцию (без налога) report_header_total_untaxable_admin: Всего необлагаемых налогом административных корректировок (без налогов) report_header_total_taxable_admin: Всего налогооблагаемых административных корректировок (включая налоги) + report_header_voucher_label: Этикетка Купона + report_header_voucher_amount: "Сумма Купона ( %{currency_symbol} )" + report_line_cost_of_produce: Стоимость продукции + report_line_line_items: позиции + report_header_last_completed_order_date: Дата последнего выполненного заказа report_xero_configuration: Xero Конфигурация initial_invoice_number: "Начальный номер счета" invoice_date: "Дата Счёта" @@ -3039,10 +3155,12 @@ ru: no_orders_found: "Заказов Не Найдено" order_information: "Информация по Заказу" new_payment: "Новый Платёж" + create_or_update_invoice: "Создать или Обновить счет" date_completed: "Дата Завершения" amount: "К оплате" invoice_number: "Номер Счета" invoice_file: "Файл" + invalid_url: "' %{url} ' — неверный URL-адрес." state_names: ready: Готово pending: В ожидании @@ -3214,6 +3332,8 @@ ru: select_all_variants: "Выбрать Все %{total_number_of_variants} Варианты" variants_loaded: "Загружено %{num_of_variants_loaded} из %{total_number_of_variants} Вариантов" loading_variants: "Загрузка Вариантов" + no_variants: "Для этого товара нет доступных вариантов (скрыт в настройках инвентаря)." + some_variants_hidden: "(Некоторые варианты могут быть скрыты в настройках инвентаря)" tag_rules: shipping_method_tagged_top: "Способы доставки помечены" shipping_method_tagged_bottom: "являются:" @@ -3270,6 +3390,7 @@ ru: processing: "в обработке" void: "аннулирован" invalid: "Недействительный" + quantity_unavailable: "Недостаточно товаров на складе. Позиция не сохранена!" quantity_unchanged: "Количество не изменилось по сравнению с предыдущим." cancel_the_order_html: "Это отменит текущий заказ.
Вы уверены, что хотите продолжить?" cancel_the_order_send_cancelation_email: "Отправить клиенту электронное письмо об отмене" @@ -3626,6 +3747,7 @@ ru: success: Конечная точка веб-хука успешно удалена error: Не удалось удалить конечную точку веб-хука. spree: + order_updated: "Заказ Обновлен" add_country: "Добавить страну" add_state: "Добавить область" adjustment: "Корректирование" @@ -3653,6 +3775,7 @@ ru: new_taxon: "Новая таксономия" new_user: "Новый пользователь" no_pending_payments: "Нет ожидающих платежей" + remove: "Удалить" none: "Нет" not_found: "Не найден" notice_messages: @@ -3669,8 +3792,8 @@ ru: start_date: "Дата начала" successfully_removed: "Успешно удалено" taxonomy_edit: "Изменить таксономию" - taxonomy_tree_error: "Ошибка дерева таксономии" - taxonomy_tree_instruction: "Инструкция по дереву таксономии" + taxonomy_tree_error: "Произошла ошибка при обновлении дерева таксономии." + taxonomy_tree_instruction: "Щелкните правой кнопкой мыши элемент, чтобы добавить, переименовать, удалить или отредактировать." tree: "Дерево" updating: "Обновление" your_order_is_empty_add_product: "Ваша корзина пуста, пожалуйста, найдите и добавьте товар выше" @@ -3723,6 +3846,7 @@ ru: credit_card: "Кредитная Карта" new_payment: "Новый Платёж" capture: "Capture" + capture_and_complete_order: "Применить и завершить заказ" void: "Void" login: "Войти" password: "Пароль" @@ -3964,6 +4088,9 @@ ru: add_product: cannot_add_item_to_canceled_order: "Невозможно добавить товар в отмененный заказ" include_out_of_stock_variants: "Включить варианты, которых нет в наличии" + shipment: + mark_as_shipped_message_html: "Заказ будет помечен как Отправленный.
Вы уверены, что хотите продолжить?" + mark_as_shipped_label_message: "Отправить клиенту сообщение об отправке/выдаче." index: listing_orders: "Список Заказов" new_order: "Новый Заказ" @@ -4004,10 +4131,12 @@ ru: from: "От" to: "Плательщик" shipping: "Доставка" + order_number: "Номер Заказа" invoice_number: "Номер Счета" payments_list: date_time: "Дата/Время" payment_method: "Способ оплаты" + payment_state: "Состояние оплаты" amount: "Количество" note: note_label: "Примечание:" @@ -4020,6 +4149,9 @@ ru: line_item_adjustments: "Корректировки позиции" order_adjustments: "Корректировки Заказа" order_total: "Весь заказ" + invoices: + index: + order_has_changed: "Заказ изменился с момента последнего обновления счета. Показанный здесь счет, возможно, уже неактуален." overview: enterprises_header: ofn_with_tip: Предприятия являются Производителями и/или Центрами и являются основной единицей организации в рамках Открытой Сети Продуктов. @@ -4028,6 +4160,7 @@ ru: has_no_payment_methods: "нет способов оплаты" has_no_shipping_methods: "нет способов доставки" products: + products_tip: "Товары, которые вы продаете через Открытую Сеть Продуктов." active_products: zero: "У Вас нет активных товаров." one: "У Вас один активный товар." @@ -4180,6 +4313,8 @@ ru: bulk_unit_size: Размер оптовой еденицы display_as: display_as: Показывать Как + clone: + success: Товар клонирован reports: table: select_and_search: "Для получения данных, выберите фильры и нажмите на %{option}." @@ -4207,6 +4342,7 @@ ru: enterprise_limit: "Ограничение Предприятий" confirm_password: "Подтвердить пароль" password: "Пароль" + locale: "Язык" email_confirmation: confirmation_pending: "Ожидается подтверждение по электронной почте. Мы отправили электронное письмо с подтверждением на %{address}." variants: diff --git a/config/locales/sv.yml b/config/locales/sv.yml index d381f9c996..78f53f39ab 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -335,6 +335,8 @@ sv: could_not_process: "kunde inte hantera filen: ogiltig filtyp" blank: kan inte vara blank none_saved: sparade inte några produkter + dfc_import_form: + enterprise: "Företag" product_headings: distributor: Distributör producer: Producent @@ -2134,6 +2136,7 @@ sv: all: "Alla" category: "Kategori" credit: "Kredit" + remove: "Ta bort" none: "Ingen" updating: "Uppdaterar" resend: "Återsänd" diff --git a/config/locales/tr.yml b/config/locales/tr.yml index e3e06731f1..121265018a 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -34,6 +34,9 @@ tr: shipping_category_id: "TESLİMAT KATEGORİSİ" variant_unit: "Çeşit Birimi" variant_unit_name: "Çeşit Birim Adı" + spree/variant: + primary_taxon: "ÜRÜN KATEGORİSİ" + shipping_category_id: "TESLİMAT KATEGORİSİ" spree/credit_card: base: "Kredİ kartı" number: "Numara" @@ -596,15 +599,15 @@ tr: index: header: title: Ürünleri Toplu Düzenleme - sort: - pagination: - clear_search: Aramayı temizle filters: producers: label: ÜRETİCİLER categories: label: Kategoriler search: Ara + sort: + pagination: + clear_search: Aramayı temizle table: new_variant: Yeni Çeşit edit_image: @@ -648,6 +651,9 @@ tr: product_categories: Ürün Kategorileri tax_categories: Vergi Kategorileri shipping_categories: Teslimat Kategorileri + dfc_import_form: + enterprise: "İşletme" + import: "Aktar" import: review: İncele import: İçe Aktar @@ -3229,6 +3235,7 @@ tr: new_taxon: "Yeni kategori" new_user: "Yeni kullanıcı" no_pending_payments: "Bekleyen ödeme yok" + remove: "Kaldır" none: "SATIŞ YAPMIYOR" not_found: "Bulunamadı" notice_messages: @@ -3241,8 +3248,6 @@ tr: start_date: "Başlangıç tarihi" successfully_removed: "Başarıyla Kaldırıldı" taxonomy_edit: "Kategori düzenleme" - taxonomy_tree_error: "Kategori ağacı hatası" - taxonomy_tree_instruction: "Kategori ağacı talimatı" tree: "Ağaç" updating: "Güncelleniyor" your_order_is_empty_add_product: "Sepetiniz boş, lütfen bir ürün arayın ve ekleyin" diff --git a/config/locales/uk.yml b/config/locales/uk.yml index eb53fb60b7..210e77f134 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -34,6 +34,9 @@ uk: shipping_category_id: "Категорія доставки" variant_unit: "Варіант одиниці" variant_unit_name: "Назва варіанта одиниці" + spree/variant: + primary_taxon: "Категорія товару" + shipping_category_id: "Категорія доставки" spree/credit_card: base: "Кредитна картка" number: "Номер" @@ -681,15 +684,15 @@ uk: index: header: title: Масове редагування продуктів - sort: - pagination: - clear_search: Очистити пошук filters: producers: label: Виробники categories: label: Категорії search: Пошук + sort: + pagination: + clear_search: Очистити пошук table: new_variant: Новий варіант edit_image: @@ -733,6 +736,9 @@ uk: product_categories: Категорії продуктів tax_categories: Податкові категорії shipping_categories: Категорії доставки + dfc_import_form: + enterprise: "Підприємство" + import: "Імпорт" import: review: Огляд import: Імпорт @@ -3453,6 +3459,7 @@ uk: new_taxon: "Новий таксон" new_user: "Новий користувач" no_pending_payments: "Немає незавершених платежів" + remove: "Видалити" none: "Жодного" not_found: "Не знайдено" notice_messages: @@ -3467,8 +3474,6 @@ uk: start_date: "Дата початку" successfully_removed: "Успішно видалено" taxonomy_edit: "Редагування таксономії" - taxonomy_tree_error: "Помилка дерева таксономії" - taxonomy_tree_instruction: "Інструкція з таксономічного дерева" tree: "Дерево" updating: "Оновлення" your_order_is_empty_add_product: "Ваше замовлення порожнє, знайдіть і додайте продукт вище" diff --git a/config/routes/admin.rb b/config/routes/admin.rb index 20dace8c6a..1a7ca8c3cc 100644 --- a/config/routes/admin.rb +++ b/config/routes/admin.rb @@ -67,10 +67,12 @@ Openfoodnetwork::Application.routes.draw do post '/product_import/save_data', to: 'product_import#save_data', as: 'product_import_save_async' post '/product_import/reset_absent', to: 'product_import#reset_absent_products', as: 'product_import_reset_async' + resources :dfc_product_imports, only: [:index] + constraints FeatureToggleConstraint.new(:admin_style_v3) do - resources :products, to: 'products_v3#index', only: :index do - patch :bulk_update, on: :collection - end + # This might be easier to arrange once we rename the controller to plain old "products" + post '/products/bulk_update', to: 'products_v3#bulk_update' + get '/products', to: 'products_v3#index' end resources :variant_overrides do diff --git a/config/routes/spree.rb b/config/routes/spree.rb index 462073b486..f59e4e7dca 100644 --- a/config/routes/spree.rb +++ b/config/routes/spree.rb @@ -110,7 +110,7 @@ Spree::Core::Engine.routes.draw do resources :adjustments resources :invoices, only: [:index] resource :invoices, only: [] do - post :generate, to: :generate + post :generate end resources :payments do diff --git a/db/migrate/20230803191831_add_taxons_to_variants.rb b/db/migrate/20230803191831_add_taxons_to_variants.rb new file mode 100644 index 0000000000..c9193ac344 --- /dev/null +++ b/db/migrate/20230803191831_add_taxons_to_variants.rb @@ -0,0 +1,5 @@ +class AddTaxonsToVariants < ActiveRecord::Migration[7.0] + def change + add_reference :spree_variants, :primary_taxon, foreign_key: { to_table: :spree_taxons } + end +end diff --git a/db/migrate/20230807114014_remove_taxon_constraint.rb b/db/migrate/20230807114014_remove_taxon_constraint.rb new file mode 100644 index 0000000000..a2dabbbb35 --- /dev/null +++ b/db/migrate/20230807114014_remove_taxon_constraint.rb @@ -0,0 +1,5 @@ +class RemoveTaxonConstraint < ActiveRecord::Migration[7.0] + def change + change_column_null :spree_products, :primary_taxon_id, true + end +end diff --git a/db/migrate/20230807122052_migrate_product_taxons.rb b/db/migrate/20230807122052_migrate_product_taxons.rb new file mode 100644 index 0000000000..5bc982a805 --- /dev/null +++ b/db/migrate/20230807122052_migrate_product_taxons.rb @@ -0,0 +1,15 @@ +class MigrateProductTaxons < ActiveRecord::Migration[7.0] + def up + migrate_primary_taxon + end + + def migrate_primary_taxon + ActiveRecord::Base.connection.execute(<<-SQL + UPDATE spree_variants + SET primary_taxon_id = spree_products.primary_taxon_id + FROM spree_products + WHERE spree_variants.product_id = spree_products.id + SQL + ) + end +end diff --git a/db/migrate/20240105043228_create_semantic_links.rb b/db/migrate/20240105043228_create_semantic_links.rb new file mode 100644 index 0000000000..89ac707783 --- /dev/null +++ b/db/migrate/20240105043228_create_semantic_links.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class CreateSemanticLinks < ActiveRecord::Migration[7.0] + def change + create_table :semantic_links do |t| + t.references :variant, null: false, foreign_key: { to_table: :spree_variants } + t.string :semantic_id, null: false + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 0ab2fb2f2e..51491dce7f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -400,6 +400,14 @@ ActiveRecord::Schema[7.0].define(version: 2024_02_13_044159) do t.datetime "updated_at", precision: nil, null: false end + create_table "semantic_links", force: :cascade do |t| + t.bigint "variant_id", null: false + t.string "semantic_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["variant_id"], name: "index_semantic_links_on_variant_id" + end + create_table "sessions", id: :serial, force: :cascade do |t| t.string "session_id", limit: 255, null: false t.text "data" @@ -690,7 +698,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_02_13_044159) do t.float "variant_unit_scale" t.string "variant_unit_name", limit: 255 t.text "notes" - t.integer "primary_taxon_id", null: false + t.integer "primary_taxon_id" t.boolean "inherits_properties", default: true, null: false t.string "sku", limit: 255, default: "", null: false t.index ["deleted_at"], name: "index_products_on_deleted_at" @@ -971,6 +979,8 @@ ActiveRecord::Schema[7.0].define(version: 2024_02_13_044159) do t.datetime "updated_at", default: -> { "now()" }, null: false t.bigint "tax_category_id" t.bigint "shipping_category_id" + t.bigint "primary_taxon_id" + t.index ["primary_taxon_id"], name: "index_spree_variants_on_primary_taxon_id" t.index ["product_id"], name: "index_variants_on_product_id" t.index ["shipping_category_id"], name: "index_spree_variants_on_shipping_category_id" t.index ["sku"], name: "index_spree_variants_on_sku" @@ -1168,6 +1178,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_02_13_044159) do add_foreign_key "proxy_orders", "spree_orders", column: "order_id", name: "order_id_fk" add_foreign_key "proxy_orders", "subscriptions", name: "proxy_orders_subscription_id_fk" add_foreign_key "report_rendering_options", "spree_users", column: "user_id" + add_foreign_key "semantic_links", "spree_variants", column: "variant_id" add_foreign_key "spree_addresses", "spree_countries", column: "country_id", name: "spree_addresses_country_id_fk" add_foreign_key "spree_addresses", "spree_states", column: "state_id", name: "spree_addresses_state_id_fk" add_foreign_key "spree_inventory_units", "spree_orders", column: "order_id", name: "spree_inventory_units_order_id_fk", on_delete: :cascade @@ -1216,6 +1227,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_02_13_044159) do add_foreign_key "spree_variants", "spree_products", column: "product_id", name: "spree_variants_product_id_fk" add_foreign_key "spree_variants", "spree_shipping_categories", column: "shipping_category_id" add_foreign_key "spree_variants", "spree_tax_categories", column: "tax_category_id" + add_foreign_key "spree_variants", "spree_taxons", column: "primary_taxon_id" add_foreign_key "spree_zone_members", "spree_zones", column: "zone_id", name: "spree_zone_members_zone_id_fk" add_foreign_key "subscription_line_items", "spree_variants", column: "variant_id", name: "subscription_line_items_variant_id_fk" add_foreign_key "subscription_line_items", "subscriptions", name: "subscription_line_items_subscription_id_fk" diff --git a/engines/dfc_provider/app/controllers/dfc_provider/supplied_products_controller.rb b/engines/dfc_provider/app/controllers/dfc_provider/supplied_products_controller.rb index d4142f25d6..57d25c1929 100644 --- a/engines/dfc_provider/app/controllers/dfc_provider/supplied_products_controller.rb +++ b/engines/dfc_provider/app/controllers/dfc_provider/supplied_products_controller.rb @@ -14,17 +14,14 @@ module DfcProvider return head :bad_request unless supplied_product - variant = SuppliedProductBuilder.import_variant(supplied_product) + variant = SuppliedProductBuilder.import_variant( + supplied_product, + current_enterprise, + ) product = variant.product - if product.new_record? - product.supplier = current_enterprise - product.save! - end - - if variant.new_record? - variant.save! - end + product.save! if product.new_record? + variant.save! if variant.new_record? supplied_product = SuppliedProductBuilder.supplied_product(variant) render json: DfcIo.export(supplied_product) diff --git a/engines/dfc_provider/app/services/dfc_request.rb b/engines/dfc_provider/app/services/dfc_request.rb new file mode 100644 index 0000000000..8de0108d99 --- /dev/null +++ b/engines/dfc_provider/app/services/dfc_request.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +require "private_address_check" +require "private_address_check/tcpsocket_ext" + +# Request a JSON document from a DFC API with authentication. +# +# All DFC API interactions are authenticated via OIDC tokens. If the user's +# access token is expired, we try to get a new one with the user's refresh +# token. +class DfcRequest + def initialize(user) + @user = user + end + + def get(url) + response = request(url) + + return response.body if response.status == 200 + + return "" if @user.oidc_account.updated_at > 15.minutes.ago + + refresh_access_token! + + response = request(url) + response.body + end + + private + + def request(url) + connection = Faraday.new( + request: { timeout: 30 }, + headers: { + 'Content-Type' => 'application/json', + 'Authorization' => "Bearer #{@user.oidc_account.token}", + } + ) + + only_public_connections do + connection.get(url) + end + end + + def only_public_connections(&) + return yield if Rails.env.development? + + PrivateAddressCheck.only_public_connections(&) + end + + def refresh_access_token! + strategy = OmniAuth::Strategies::OpenIDConnect.new( + Rails.application, + Devise.omniauth_configs[:openid_connect].options + # Don't try to call `Devise.omniauth(:openid_connect)` first. + # It results in an empty config hash and we lose our config. + ) + client = strategy.client + client.token_endpoint = strategy.config.token_endpoint + client.refresh_token = @user.oidc_account.refresh_token + + token = client.access_token! + + @user.oidc_account.update!( + token: token.access_token, + refresh_token: token.refresh_token + ) + end +end diff --git a/engines/dfc_provider/app/services/enterprise_builder.rb b/engines/dfc_provider/app/services/enterprise_builder.rb index d1af0afad9..b2087c2601 100644 --- a/engines/dfc_provider/app/services/enterprise_builder.rb +++ b/engines/dfc_provider/app/services/enterprise_builder.rb @@ -29,8 +29,8 @@ class EnterpriseBuilder < DfcBuilder # But that would require a new endpoint for a single string. add_ofn_property(e, "ofn:contact_name", enterprise.contact_name) - add_ofn_property(e, "ofn:logo_url", enterprise.logo.url) - add_ofn_property(e, "ofn:promo_image_url", enterprise.promo_image.url) + add_ofn_property(e, "ofn:logo_url", enterprise.logo_url(:small)) + add_ofn_property(e, "ofn:promo_image_url", enterprise.promo_image_url(:large)) end end diff --git a/engines/dfc_provider/app/services/social_media_builder.rb b/engines/dfc_provider/app/services/social_media_builder.rb index bb13edc4f9..3c855b3d5b 100644 --- a/engines/dfc_provider/app/services/social_media_builder.rb +++ b/engines/dfc_provider/app/services/social_media_builder.rb @@ -12,10 +12,16 @@ class SocialMediaBuilder < DfcBuilder def self.social_media(enterprise, name) return nil unless name.in?(NAMES) - url = enterprise.attributes[name] + url = enterprise.public_send(name) return nil if url.blank? + if name == "instagram" + url = "https://www.instagram.com/#{url}/" + end + + url = "https://#{url}" unless url.starts_with?(%r{https?://}) + DataFoodConsortium::Connector::SocialMedia.new( urls.enterprise_social_media_url(enterprise.id, name), name:, url:, diff --git a/engines/dfc_provider/app/services/supplied_product_builder.rb b/engines/dfc_provider/app/services/supplied_product_builder.rb index ea475da1ec..bdf069bdfb 100644 --- a/engines/dfc_provider/app/services/supplied_product_builder.rb +++ b/engines/dfc_provider/app/services/supplied_product_builder.rb @@ -6,6 +6,10 @@ class SuppliedProductBuilder < DfcBuilder enterprise_id: variant.product.supplier_id, id: variant.id, ) + product_uri = urls.enterprise_url( + variant.product.supplier_id, + spree_product_id: variant.product_id + ) DfcProvider::SuppliedProduct.new( id, @@ -13,16 +17,16 @@ class SuppliedProductBuilder < DfcBuilder description: variant.description, productType: product_type(variant), quantity: QuantitativeValueBuilder.quantity(variant), + spree_product_uri: product_uri, spree_product_id: variant.product.id, image_url: variant.product&.image&.url(:product) ) end - def self.import_variant(supplied_product) - product_id = supplied_product.spree_product_id + def self.import_variant(supplied_product, supplier) + product = referenced_spree_product(supplied_product, supplier) - if product_id.present? - product = Spree::Product.find(product_id) + if product Spree::Variant.new( product:, price: 0, @@ -31,8 +35,29 @@ class SuppliedProductBuilder < DfcBuilder end else product = import_product(supplied_product) + product.supplier = supplier product.ensure_standard_variant product.variants.first + end.tap do |variant| + link = supplied_product.semanticId + variant.semantic_links.new(semantic_id: link) if link.present? + end + end + + def self.referenced_spree_product(supplied_product, supplier) + uri = supplied_product.spree_product_uri + id = supplied_product.spree_product_id + + if uri.present? + route = Rails.application.routes.recognize_path(uri) + params = Rack::Utils.parse_nested_query(URI.parse(uri).query) + + # Check that the given URI points to us: + return unless uri == urls.enterprise_url(route.merge(params)) + + supplier.supplied_products.find_by(id: params["spree_product_id"]) + elsif id.present? + supplier.supplied_products.find_by(id:) end end @@ -40,33 +65,35 @@ class SuppliedProductBuilder < DfcBuilder Spree::Product.new( name: supplied_product.name, description: supplied_product.description, - price: 0, # will be in DFC Offer - primary_taxon: taxon(supplied_product) + price: 0 # will be in DFC Offer ).tap do |product| QuantitativeValueBuilder.apply(supplied_product.quantity, product) + product.ensure_standard_variant + product.variants.first.primary_taxon = taxon(supplied_product) end end def self.apply(supplied_product, variant) - variant.product.assign_attributes( - description: supplied_product.description, - primary_taxon: taxon(supplied_product) - ) + variant.product.assign_attributes(description: supplied_product.description) variant.display_name = supplied_product.name + variant.primary_taxon = taxon(supplied_product) QuantitativeValueBuilder.apply(supplied_product.quantity, variant.product) variant.unit_value = variant.product.unit_value end def self.product_type(variant) - taxon_dfc_id = variant.product.primary_taxon&.dfc_id + taxon_dfc_id = variant.primary_taxon&.dfc_id DfcProductTypeFactory.for(taxon_dfc_id) end def self.taxon(supplied_product) - dfc_id = supplied_product.productType.semanticId - Spree::Taxon.find_by(dfc_id: ) + dfc_id = supplied_product.productType&.semanticId + + # Every product needs a primary taxon to be valid. So if we don't have + # one or can't find it we just take a random one. + Spree::Taxon.find_by(dfc_id:) || Spree::Taxon.first end private_class_method :product_type, :taxon diff --git a/engines/dfc_provider/lib/dfc_provider/supplied_product.rb b/engines/dfc_provider/lib/dfc_provider/supplied_product.rb index 8e8b258206..f2ebc9f61f 100644 --- a/engines/dfc_provider/lib/dfc_provider/supplied_product.rb +++ b/engines/dfc_provider/lib/dfc_provider/supplied_product.rb @@ -2,15 +2,20 @@ module DfcProvider class SuppliedProduct < DataFoodConsortium::Connector::SuppliedProduct - attr_accessor :spree_product_id, :image + attr_accessor :spree_product_id, :spree_product_uri, :image - def initialize(semantic_id, spree_product_id: nil, image_url: nil, **properties) + def initialize( + semantic_id, spree_product_id: nil, spree_product_uri: nil, image_url: nil, **properties + ) super(semantic_id, **properties) self.spree_product_id = spree_product_id + self.spree_product_uri = spree_product_uri self.image = image_url + # This is now replaced by spree_product_uri, keeping it for backward compatibility register_ofn_property("spree_product_id") + register_ofn_property("spree_product_uri") # Temporary solution, will be replaced by "dfc_b:image" in future version of the DFC connector register_ofn_property("image") end diff --git a/engines/dfc_provider/spec/requests/enterprises_spec.rb b/engines/dfc_provider/spec/requests/enterprises_spec.rb index 766a2d3beb..587971a2ec 100644 --- a/engines/dfc_provider/spec/requests/enterprises_spec.rb +++ b/engines/dfc_provider/spec/requests/enterprises_spec.rb @@ -93,7 +93,7 @@ describe "Enterprises", type: :request, swagger_doc: "dfc.yaml", rswag_autodoc: let(:other_enterprise) { create(:distributor_enterprise) } run_test! do - expect(response.body).to_not include "Apple" + expect(response.body).not_to include "Apple" end end end diff --git a/engines/dfc_provider/spec/requests/persons_spec.rb b/engines/dfc_provider/spec/requests/persons_spec.rb index 8e03a7667e..3af17b76e9 100644 --- a/engines/dfc_provider/spec/requests/persons_spec.rb +++ b/engines/dfc_provider/spec/requests/persons_spec.rb @@ -26,7 +26,7 @@ describe "Persons", type: :request, swagger_doc: "dfc.yaml", rswag_autodoc: true let(:id) { other_user.id } run_test! do - expect(response.body).to_not include "dfc-b:Person" + expect(response.body).not_to include "dfc-b:Person" end end end diff --git a/engines/dfc_provider/spec/requests/supplied_products_spec.rb b/engines/dfc_provider/spec/requests/supplied_products_spec.rb index 8ca59d0d84..d57d45c0f0 100644 --- a/engines/dfc_provider/spec/requests/supplied_products_spec.rb +++ b/engines/dfc_provider/spec/requests/supplied_products_spec.rb @@ -10,11 +10,10 @@ describe "SuppliedProducts", type: :request, swagger_doc: "dfc.yaml", rswag_auto :product_with_image, id: 90_000, supplier: enterprise, name: "Pesto", description: "Basil Pesto", - variants: [variant], - primary_taxon: taxon + variants: [variant] ) } - let(:variant) { build(:base_variant, id: 10_001, unit_value: 1) } + let(:variant) { build(:base_variant, id: 10_001, unit_value: 1, primary_taxon: taxon) } let(:taxon) { build( :taxon, @@ -114,7 +113,7 @@ describe "SuppliedProducts", type: :request, swagger_doc: "dfc.yaml", rswag_auto product = Spree::Product.find(product_id) expect(product.name).to eq "Apple" expect(product.variants).to eq [variant] - expect(product.primary_taxon).to eq(non_local_vegetable) + expect(product.variants.first.primary_taxon).to eq(non_local_vegetable) # Creates a variant for existing product supplied_product[:'ofn:spree_product_id'] = product_id @@ -142,6 +141,36 @@ describe "SuppliedProducts", type: :request, swagger_doc: "dfc.yaml", rswag_auto '"ofn:spree_product_id":90000' ) end + + context "when supplying spree_product_uri matching the host" do + it "creates a variant for the existing product" do |example| + supplied_product[:'ofn:spree_product_uri'] = + "http://test.host/api/dfc/enterprises/10000?spree_product_id=90000" + supplied_product[:'dfc-b:hasQuantity'][:'dfc-b:value'] = 6 + + expect { + submit_request(example.metadata) + product.variants.reload + } + .to change { product.variants.count }.by(1) + + # Creates a variant for existing product + variant_id = json_response["@id"].split("/").last.to_i + new_variant = Spree::Variant.find(variant_id) + expect(product.variants).to include(new_variant) + expect(new_variant.unit_value).to eq 6 + + # Insert static value to keep documentation deterministic: + response.body.gsub!( + "supplied_products/#{variant_id}", + "supplied_products/10001" + ) + .gsub!( + %r{active_storage/[0-9A-Za-z/=-]*/logo-white.png}, + "active_storage/url/logo-white.png", + ) + end + end end end end @@ -214,7 +243,7 @@ describe "SuppliedProducts", type: :request, swagger_doc: "dfc.yaml", rswag_auto }.to change { variant.description }.to("DFC-Pesto updated") .and change { variant.display_name }.to("Pesto novo") .and change { variant.unit_value }.to(17) - .and change { variant.product.primary_taxon }.to(drink_taxon) + .and change { variant.primary_taxon }.to(drink_taxon) end end end diff --git a/engines/dfc_provider/spec/services/dfc_request_spec.rb b/engines/dfc_provider/spec/services/dfc_request_spec.rb new file mode 100644 index 0000000000..a4f0421fad --- /dev/null +++ b/engines/dfc_provider/spec/services/dfc_request_spec.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +require_relative "../spec_helper" + +describe DfcRequest do + subject(:api) { DfcRequest.new(user) } + + let(:user) { build(:oidc_user) } + let(:account) { user.oidc_account } + + it "gets a DFC document" do + stub_request(:get, "http://example.net/api"). + to_return(status: 200, body: '{"@context":"/"}') + + expect(api.get("http://example.net/api")).to eq '{"@context":"/"}' + end + + it "refreshes the access token on fail", vcr: true do + # Live VCR recordings require the following secret ENV variables: + # - OPENID_APP_ID + # - OPENID_APP_SECRET + # - OPENID_REFRESH_TOKEN + # You can set them in the .env.test.local file. + + stub_request(:get, "http://example.net/api"). + to_return(status: 401) + + # A refresh is only attempted if the token is stale. + account.refresh_token = ENV.fetch("OPENID_REFRESH_TOKEN") + account.updated_at = 1.day.ago + + expect { + api.get("http://example.net/api") + }.to change { + account.token + }.and change { + account.refresh_token + } + end + + it "doesn't try to refresh the token when it's still fresh" do + stub_request(:get, "http://example.net/api"). + to_return(status: 401) + + user.oidc_account.updated_at = 1.minute.ago + + expect(api.get("http://example.net/api")).to eq "" + + # Trying to reach the OIDC server via network request to refresh the token + # would raise errors because we didn't setup Webmock or VCR. + # The absence of errors makes this test pass. + end +end diff --git a/engines/dfc_provider/spec/services/social_media_builder_spec.rb b/engines/dfc_provider/spec/services/social_media_builder_spec.rb new file mode 100644 index 0000000000..633ce732d8 --- /dev/null +++ b/engines/dfc_provider/spec/services/social_media_builder_spec.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +require_relative "../spec_helper" + +describe SocialMediaBuilder do + let(:enterprise) do + create( + :enterprise, + id: 10_000, + + # These formats are requested by our UI: + facebook: "www.facebook.com/user", + instagram: "handle", + linkedin: "www.linkedin.com/company/name", + ) + end + + describe ".social_media" do + it "links to Facebook" do + result = SocialMediaBuilder.social_media(enterprise, "facebook") + expect(result.url).to eq "https://www.facebook.com/user" + end + + it "links to Instagram" do + result = SocialMediaBuilder.social_media(enterprise, "instagram") + expect(result.url).to eq "https://www.instagram.com/handle/" + end + + it "links to Linkedin" do + result = SocialMediaBuilder.social_media(enterprise, "linkedin") + expect(result.url).to eq "https://www.linkedin.com/company/name" + end + end +end diff --git a/engines/dfc_provider/spec/services/supplied_product_builder_spec.rb b/engines/dfc_provider/spec/services/supplied_product_builder_spec.rb index b8e41df742..12bc49f518 100644 --- a/engines/dfc_provider/spec/services/supplied_product_builder_spec.rb +++ b/engines/dfc_provider/spec/services/supplied_product_builder_spec.rb @@ -7,10 +7,13 @@ describe SuppliedProductBuilder do subject(:builder) { described_class } let(:variant) { - build(:variant, id: 5).tap do |v| - v.product.supplier_id = 7 - v.product.primary_taxon = taxon - end + build(:variant, id: 5, product: spree_product, primary_taxon: taxon) + } + let(:spree_product) { + create(:product, id: 6, supplier:) + } + let(:supplier) { + build(:supplier_enterprise, id: 7) } let(:taxon) { build( @@ -59,14 +62,6 @@ describe SuppliedProductBuilder do expect(product.productType).to eq soft_drink end - - context "when no taxon set" do - let(:taxon) { nil } - - it "returns nil" do - expect(product.productType).to be_nil - end - end end it "assigns an image_url type" do @@ -79,6 +74,14 @@ describe SuppliedProductBuilder do expect(product.image).to eq variant.product.image.url(:product) end + + it "assigns the product uri" do + product = builder.supplied_product(variant) + + expect(product.spree_product_uri).to eq( + "http://test.host/api/dfc/enterprises/7?spree_product_id=6" + ) + end end describe ".import_product" do @@ -116,18 +119,149 @@ describe SuppliedProductBuilder do it "assigns the taxon matching the DFC product type" do product = builder.import_product(supplied_product) - expect(product.primary_taxon).to eq(taxon) + expect(product.variants.first.primary_taxon).to eq(taxon) + end + end + end + + describe ".import_variant" do + let(:imported_variant) { builder.import_variant(supplied_product, supplier) } + let(:supplied_product) do + DfcProvider::SuppliedProduct.new( + "https://example.net/tomato", + name: "Tomato", + description: "Awesome tomato", + quantity: DataFoodConsortium::Connector::QuantitativeValue.new( + unit: DfcLoader.connector.MEASURES.KILOGRAM, + value: 2, + ), + productType: product_type, + ) + end + let(:product_type) { DfcLoader.connector.PRODUCT_TYPES.VEGETABLE.NON_LOCAL_VEGETABLE } + + it "creates a new Spree::Product and variant" do + create(:taxon) + + expect(imported_variant).to be_a(Spree::Variant) + expect(imported_variant).to be_valid + expect(imported_variant.id).to be_nil + expect(imported_variant.semantic_links.size).to eq 1 + + link = imported_variant.semantic_links[0] + expect(link.semantic_id).to eq "https://example.net/tomato" + + imported_product = imported_variant.product + expect(imported_product).to be_a(Spree::Product) + expect(imported_product).to be_valid + expect(imported_product.id).to be_nil + expect(imported_product.name).to eq("Tomato") + expect(imported_product.description).to eq("Awesome tomato") + expect(imported_product.variant_unit).to eq("weight") + end + + context "with spree_product_id supplied" do + let(:imported_variant) { builder.import_variant(supplied_product, supplier) } + + let(:supplied_product) do + DfcProvider::SuppliedProduct.new( + "https://example.net/tomato", + name: "Tomato", + description: "Better Awesome tomato", + quantity: DataFoodConsortium::Connector::QuantitativeValue.new( + unit: DfcLoader.connector.MEASURES.KILOGRAM, + value: 2, + ), + productType: product_type, + spree_product_id: variant.product.id + ) + end + let(:product_type) { DfcLoader.connector.PRODUCT_TYPES.DRINK.SOFT_DRINK } + let!(:new_taxon) { + create( + :taxon, + name: "Soft Drink", + dfc_id: "https://github.com/datafoodconsortium/taxonomies/releases/latest/download/productTypes.rdf#soft-drink" + ) + } + + it "update an existing Spree::Product" do + imported_product = imported_variant.product + expect(imported_product.id).to eq(spree_product.id) + expect(imported_product.description).to eq("Better Awesome tomato") + expect(imported_variant.primary_taxon).to eq(new_taxon) end - describe "when no matching taxon" do - let(:product_type) { DfcLoader.connector.PRODUCT_TYPES.DRINK } + context "when spree_product_uri doesn't match the server host" do + let(:supplied_product) do + DfcProvider::SuppliedProduct.new( + "https://example.net/tomato", + name: "Tomato", + description: "Awesome tomato", + quantity: DataFoodConsortium::Connector::QuantitativeValue.new( + unit: DfcLoader.connector.MEASURES.KILOGRAM, + value: 2, + ), + productType: product_type, + spree_product_uri: "http://another.host/api/dfc/enterprises/10/supplied_products/50" + ) + end - it "set the taxon to nil" do - product = builder.import_product(supplied_product) + it "creates a new Spree::Product and variant" do + expect(imported_variant).to be_a(Spree::Variant) + expect(imported_variant.id).to be_nil - expect(product.primary_taxon).to be_nil + imported_product = imported_variant.product + expect(imported_product).to be_a(Spree::Product) + expect(imported_product.id).to be_nil + expect(imported_product.name).to eq("Tomato") + expect(imported_product.description).to eq("Awesome tomato") + expect(imported_product.variant_unit).to eq("weight") end end end end + + describe ".referenced_spree_product" do + let(:result) { builder.referenced_spree_product(supplied_product, supplier) } + let(:supplied_product) do + DfcProvider::SuppliedProduct.new( + "https://example.net/tomato", + name: "Tomato", + ) + end + + it "returns nil when no reference is given" do + expect(result).to eq nil + end + + it "returns a product referenced by URI" do + variant.save! + supplied_product.spree_product_uri = + "http://test.host/api/dfc/enterprises/7?spree_product_id=6" + expect(result).to eq spree_product + end + + it "doesn't return a product of another enterprise" do + variant.save! + create(:product, id: 8, supplier: create(:enterprise)) + + supplied_product.spree_product_uri = + "http://test.host/api/dfc/enterprises/7?spree_product_id=8" + expect(result).to eq nil + end + + it "doesn't return a foreign product referenced by URI" do + variant.save! + supplied_product.spree_product_uri = + "http://another.host/api/dfc/enterprises/7?spree_product_id=6" + expect(result).to eq nil + end + + it "returns a product referenced by id" do + variant.save! + supplied_product.spree_product_id = "6" + expect(result).to eq spree_product + end + end end diff --git a/engines/order_management/app/services/order_management/order/stripe_sca_payment_authorize.rb b/engines/order_management/app/services/order_management/order/stripe_sca_payment_authorize.rb index cfecbc7de9..0763a32b1a 100644 --- a/engines/order_management/app/services/order_management/order/stripe_sca_payment_authorize.rb +++ b/engines/order_management/app/services/order_management/order/stripe_sca_payment_authorize.rb @@ -12,7 +12,7 @@ module OrderManagement def initialize(order, payment: nil, off_session: false, notify_hub: false) @order = order - @payment = payment || OrderPaymentFinder.new(order).last_pending_payment + @payment = payment || Orders::FindPaymentService.new(order).last_pending_payment @off_session = off_session @notify_hub = notify_hub end diff --git a/engines/order_management/app/services/order_management/subscriptions/form.rb b/engines/order_management/app/services/order_management/subscriptions/form.rb index 53c0e615cd..74aa78d72f 100644 --- a/engines/order_management/app/services/order_management/subscriptions/form.rb +++ b/engines/order_management/app/services/order_management/subscriptions/form.rb @@ -15,7 +15,7 @@ module OrderManagement @options = options @estimator = OrderManagement::Subscriptions::Estimator.new(subscription) @validator = OrderManagement::Subscriptions::Validator.new(subscription) - @order_syncer = OrderSyncer.new(subscription) + @order_syncer = Orders::SyncService.new(subscription) end def save diff --git a/engines/order_management/app/services/order_management/subscriptions/payment_setup.rb b/engines/order_management/app/services/order_management/subscriptions/payment_setup.rb index fea4da84e5..15cab96ee2 100644 --- a/engines/order_management/app/services/order_management/subscriptions/payment_setup.rb +++ b/engines/order_management/app/services/order_management/subscriptions/payment_setup.rb @@ -18,7 +18,7 @@ module OrderManagement private def create_payment - payment = OrderPaymentFinder.new(@order).last_pending_payment + payment = Orders::FindPaymentService.new(@order).last_pending_payment return payment if payment.present? @order.payments.create( diff --git a/engines/order_management/app/services/order_management/subscriptions/proxy_order_syncer.rb b/engines/order_management/app/services/order_management/subscriptions/proxy_order_syncer.rb index 9c50e175d5..e906a0ed16 100644 --- a/engines/order_management/app/services/order_management/subscriptions/proxy_order_syncer.rb +++ b/engines/order_management/app/services/order_management/subscriptions/proxy_order_syncer.rb @@ -14,7 +14,7 @@ module OrderManagement when ActiveRecord::Relation @subscriptions = subscriptions.not_ended.not_canceled else - raise "ProxyOrderSyncer must be initialized with " \ + raise "ProxyOrders::SyncService must be initialized with " \ "an instance of Subscription or ActiveRecord::Relation" end end diff --git a/engines/order_management/app/services/order_management/subscriptions/stripe_payment_setup.rb b/engines/order_management/app/services/order_management/subscriptions/stripe_payment_setup.rb index df79b45ddd..e3d01bdfc1 100644 --- a/engines/order_management/app/services/order_management/subscriptions/stripe_payment_setup.rb +++ b/engines/order_management/app/services/order_management/subscriptions/stripe_payment_setup.rb @@ -5,7 +5,7 @@ module OrderManagement class StripePaymentSetup def initialize(order) @order = order - @payment = OrderPaymentFinder.new(@order).last_pending_payment + @payment = Orders::FindPaymentService.new(@order).last_pending_payment end def call! diff --git a/engines/order_management/spec/services/order_management/order/stripe_sca_payment_authorize_spec.rb b/engines/order_management/spec/services/order_management/order/stripe_sca_payment_authorize_spec.rb index 9dd15e8a8b..afe866f15b 100644 --- a/engines/order_management/spec/services/order_management/order/stripe_sca_payment_authorize_spec.rb +++ b/engines/order_management/spec/services/order_management/order/stripe_sca_payment_authorize_spec.rb @@ -74,9 +74,9 @@ module OrderManagement payment_authorize.call! expect(order.errors.size).to eq 0 - expect(PaymentMailer).to_not have_received(:authorize_payment) - expect(PaymentMailer).to_not have_received(:authorization_required) - expect(mail_mock).to_not have_received(:deliver_now) + expect(PaymentMailer).not_to have_received(:authorize_payment) + expect(PaymentMailer).not_to have_received(:authorization_required) + expect(mail_mock).not_to have_received(:deliver_now) end context "when the processing is off-session (via backoffice/subscription)" do diff --git a/engines/order_management/spec/services/order_management/order/updater_spec.rb b/engines/order_management/spec/services/order_management/order/updater_spec.rb index 0447e84cb8..6c2542b9e0 100644 --- a/engines/order_management/spec/services/order_management/order/updater_spec.rb +++ b/engines/order_management/spec/services/order_management/order/updater_spec.rb @@ -237,7 +237,7 @@ module OrderManagement it "returns paid" do updater.update_payment_state - expect(order.payment_state).to_not eq("requires_authorization") + expect(order.payment_state).not_to eq("requires_authorization") end end @@ -362,7 +362,7 @@ module OrderManagement it "cancels unused payments requiring authorization" do expect(stripe_payment).to receive(:void_transaction!) - expect(cash_payment).to_not receive(:void_transaction!) + expect(cash_payment).not_to receive(:void_transaction!) order.updater.update_payment_state end @@ -416,7 +416,7 @@ module OrderManagement it "doesn't touch taxes" do allow(order).to receive(:completed?) { false } - expect(order).to_not receive(:create_tax_charge!) + expect(order).not_to receive(:create_tax_charge!) updater.__send__(:handle_legacy_taxes) end end @@ -439,7 +439,7 @@ module OrderManagement context "and the order has no legacy taxes" do it "leaves taxes untouched" do - expect(order).to_not receive(:create_tax_charge!) + expect(order).not_to receive(:create_tax_charge!) updater.__send__(:handle_legacy_taxes) end diff --git a/engines/order_management/spec/services/order_management/stock/package_spec.rb b/engines/order_management/spec/services/order_management/stock/package_spec.rb index 5f36592a67..64a9fd46d3 100644 --- a/engines/order_management/spec/services/order_management/stock/package_spec.rb +++ b/engines/order_management/spec/services/order_management/stock/package_spec.rb @@ -168,7 +168,7 @@ module OrderManagement end it "does not return soft-deleted shipping methods" do - expect(package.shipping_methods).to_not include shipping_method3 + expect(package.shipping_methods).not_to include shipping_method3 end it "returns an empty array if distributor is nil" do diff --git a/engines/order_management/spec/services/order_management/subscriptions/payment_setup_spec.rb b/engines/order_management/spec/services/order_management/subscriptions/payment_setup_spec.rb index b646ea5222..035021eb49 100644 --- a/engines/order_management/spec/services/order_management/subscriptions/payment_setup_spec.rb +++ b/engines/order_management/spec/services/order_management/subscriptions/payment_setup_spec.rb @@ -42,7 +42,7 @@ module OrderManagement before { allow(order).to receive(:new_outstanding_balance) { 10 } } it "does nothing" do - expect{ payment_setup.call! }.to_not change { payment.amount }.from(10) + expect{ payment_setup.call! }.not_to change { payment.amount }.from(10) end end end diff --git a/engines/order_management/spec/services/order_management/subscriptions/proxy_order_syncer_spec.rb b/engines/order_management/spec/services/order_management/subscriptions/proxy_order_syncer_spec.rb index 510bf780e0..fcf06793df 100644 --- a/engines/order_management/spec/services/order_management/subscriptions/proxy_order_syncer_spec.rb +++ b/engines/order_management/spec/services/order_management/subscriptions/proxy_order_syncer_spec.rb @@ -10,8 +10,8 @@ module OrderManagement it "raises an error when initialized with an object that is not a Subscription or an ActiveRecord::Relation" do - expect{ ProxyOrderSyncer.new(subscription) }.to_not raise_error - expect{ ProxyOrderSyncer.new(Subscription.where(id: subscription.id)) }.to_not raise_error + expect{ ProxyOrderSyncer.new(subscription) }.not_to raise_error + expect{ ProxyOrderSyncer.new(Subscription.where(id: subscription.id)) }.not_to raise_error expect{ ProxyOrderSyncer.new("something") }.to raise_error RuntimeError end end @@ -70,8 +70,8 @@ module OrderManagement let!(:oc) { closed_oc } it "does not create a new proxy order for that oc" do - expect{ subscription.save! }.to_not change { ProxyOrder.count }.from(0) - expect(order_cycles).to_not include oc + expect{ subscription.save! }.not_to change { ProxyOrder.count }.from(0) + expect(order_cycles).not_to include oc end end @@ -79,8 +79,8 @@ module OrderManagement let!(:oc) { open_oc_closes_before_begins_at_oc } it "does not create a new proxy order for that oc" do - expect{ subscription.save! }.to_not change { ProxyOrder.count }.from(0) - expect(order_cycles).to_not include oc + expect{ subscription.save! }.not_to change { ProxyOrder.count }.from(0) + expect(order_cycles).not_to include oc end end @@ -99,8 +99,8 @@ module OrderManagement let!(:oc) { upcoming_closes_before_begins_at_oc } it "does not create a new proxy order for that oc" do - expect{ subscription.save! }.to_not change { ProxyOrder.count }.from(0) - expect(order_cycles).to_not include oc + expect{ subscription.save! }.not_to change { ProxyOrder.count }.from(0) + expect(order_cycles).not_to include oc end end @@ -130,8 +130,8 @@ module OrderManagement let!(:oc) { upcoming_closes_after_ends_at_oc } it "does not create a new proxy order for that oc" do - expect{ subscription.save! }.to_not change { ProxyOrder.count }.from(0) - expect(order_cycles).to_not include oc + expect{ subscription.save! }.not_to change { ProxyOrder.count }.from(0) + expect(order_cycles).not_to include oc end end end @@ -149,7 +149,7 @@ module OrderManagement context "the oc is closed (ie. closed before opens_at)" do let(:oc) { closed_oc } it "keeps the proxy order" do - expect{ syncer.sync! }.to_not change { ProxyOrder.count }.from(1) + expect{ syncer.sync! }.not_to change { ProxyOrder.count }.from(1) expect(proxy_orders).to include proxy_order end end @@ -157,7 +157,7 @@ module OrderManagement context "and the schedule includes an open oc that closes before begins_at" do let(:oc) { open_oc_closes_before_begins_at_oc } it "keeps the proxy order" do - expect{ syncer.sync! }.to_not change { ProxyOrder.count }.from(1) + expect{ syncer.sync! }.not_to change { ProxyOrder.count }.from(1) expect(proxy_orders).to include proxy_order end end @@ -165,7 +165,7 @@ module OrderManagement context "and the oc is open and closes between begins_at and ends_at" do let(:oc) { open_oc } it "keeps the proxy order" do - expect{ syncer.sync! }.to_not change { ProxyOrder.count }.from(1) + expect{ syncer.sync! }.not_to change { ProxyOrder.count }.from(1) expect(proxy_orders).to include proxy_order end end @@ -173,7 +173,7 @@ module OrderManagement context "and the oc is upcoming and closes before begins_at" do let(:oc) { upcoming_closes_before_begins_at_oc } it "keeps the proxy order" do - expect{ syncer.sync! }.to_not change { ProxyOrder.count }.from(1) + expect{ syncer.sync! }.not_to change { ProxyOrder.count }.from(1) expect(proxy_orders).to include proxy_order end end @@ -181,7 +181,7 @@ module OrderManagement context "and the oc is upcoming and closes on begins_at" do let(:oc) { upcoming_closes_on_begins_at_oc } it "keeps the proxy order" do - expect{ syncer.sync! }.to_not change { ProxyOrder.count }.from(1) + expect{ syncer.sync! }.not_to change { ProxyOrder.count }.from(1) expect(proxy_orders).to include proxy_order end end @@ -189,7 +189,7 @@ module OrderManagement context "and the oc is upcoming and closes on ends_at" do let(:oc) { upcoming_closes_on_ends_at_oc } it "keeps the proxy order" do - expect{ syncer.sync! }.to_not change { ProxyOrder.count }.from(1) + expect{ syncer.sync! }.not_to change { ProxyOrder.count }.from(1) expect(proxy_orders).to include proxy_order end end @@ -197,7 +197,7 @@ module OrderManagement context "and the oc is upcoming and closes after ends_at" do let(:oc) { upcoming_closes_after_ends_at_oc } it "keeps the proxy order" do - expect{ syncer.sync! }.to_not change { ProxyOrder.count }.from(1) + expect{ syncer.sync! }.not_to change { ProxyOrder.count }.from(1) expect(proxy_orders).to include proxy_order end end @@ -209,7 +209,7 @@ module OrderManagement it "removes the proxy order" do expect{ syncer.sync! }.to change { ProxyOrder.count }.from(1).to(0) - expect(proxy_orders).to_not include proxy_order + expect(proxy_orders).not_to include proxy_order end end @@ -218,7 +218,7 @@ module OrderManagement it "removes the proxy order" do expect{ syncer.sync! }.to change { ProxyOrder.count }.from(1).to(0) - expect(proxy_orders).to_not include proxy_order + expect(proxy_orders).not_to include proxy_order end end @@ -238,7 +238,7 @@ module OrderManagement let(:oc) { open_oc } it "keeps the proxy order" do - expect{ syncer.sync! }.to_not change { ProxyOrder.count }.from(1) + expect{ syncer.sync! }.not_to change { ProxyOrder.count }.from(1) expect(proxy_orders).to include proxy_order end end @@ -247,7 +247,7 @@ module OrderManagement let(:oc) { upcoming_closes_on_begins_at_oc } it "keeps the proxy order" do - expect{ syncer.sync! }.to_not change { ProxyOrder.count }.from(1) + expect{ syncer.sync! }.not_to change { ProxyOrder.count }.from(1) expect(proxy_orders).to include proxy_order end end @@ -256,7 +256,7 @@ module OrderManagement let(:oc) { upcoming_closes_on_ends_at_oc } it "keeps the proxy order" do - expect{ syncer.sync! }.to_not change { ProxyOrder.count }.from(1) + expect{ syncer.sync! }.not_to change { ProxyOrder.count }.from(1) expect(proxy_orders).to include proxy_order end end @@ -267,7 +267,7 @@ module OrderManagement it "removes the proxy order" do expect{ syncer.sync! }.to change { ProxyOrder.count }.from(1).to(0) - expect(proxy_orders).to_not include proxy_order + expect(proxy_orders).not_to include proxy_order end end @@ -276,7 +276,7 @@ module OrderManagement it "removes the proxy order" do expect{ syncer.sync! }.to change { ProxyOrder.count }.from(1).to(0) - expect(proxy_orders).to_not include proxy_order + expect(proxy_orders).not_to include proxy_order end end end @@ -297,7 +297,7 @@ module OrderManagement context "the oc is closed (ie. closed before opens_at)" do let(:oc) { closed_oc } it "keeps the proxy order" do - expect{ syncer.sync! }.to_not change { ProxyOrder.count }.from(1) + expect{ syncer.sync! }.not_to change { ProxyOrder.count }.from(1) expect(proxy_orders).to include proxy_order end end @@ -305,7 +305,7 @@ module OrderManagement context "and the schedule includes an open oc that closes before begins_at" do let(:oc) { open_oc_closes_before_begins_at_oc } it "keeps the proxy order" do - expect{ syncer.sync! }.to_not change { ProxyOrder.count }.from(1) + expect{ syncer.sync! }.not_to change { ProxyOrder.count }.from(1) expect(proxy_orders).to include proxy_order end end @@ -313,7 +313,7 @@ module OrderManagement context "and the oc is open and closes between begins_at and ends_at" do let(:oc) { open_oc } it "keeps the proxy order" do - expect{ syncer.sync! }.to_not change { ProxyOrder.count }.from(1) + expect{ syncer.sync! }.not_to change { ProxyOrder.count }.from(1) expect(proxy_orders).to include proxy_order end end @@ -321,7 +321,7 @@ module OrderManagement context "and the oc is upcoming and closes before begins_at" do let(:oc) { upcoming_closes_before_begins_at_oc } it "keeps the proxy order" do - expect{ syncer.sync! }.to_not change { ProxyOrder.count }.from(1) + expect{ syncer.sync! }.not_to change { ProxyOrder.count }.from(1) expect(proxy_orders).to include proxy_order end end @@ -329,7 +329,7 @@ module OrderManagement context "and the oc is upcoming and closes on begins_at" do let(:oc) { upcoming_closes_on_begins_at_oc } it "keeps the proxy order" do - expect{ syncer.sync! }.to_not change { ProxyOrder.count }.from(1) + expect{ syncer.sync! }.not_to change { ProxyOrder.count }.from(1) expect(proxy_orders).to include proxy_order end end @@ -337,7 +337,7 @@ module OrderManagement context "and the oc is upcoming and closes on ends_at" do let(:oc) { upcoming_closes_on_ends_at_oc } it "keeps the proxy order" do - expect{ syncer.sync! }.to_not change { ProxyOrder.count }.from(1) + expect{ syncer.sync! }.not_to change { ProxyOrder.count }.from(1) expect(proxy_orders).to include proxy_order end end @@ -345,7 +345,7 @@ module OrderManagement context "and the oc is upcoming and closes after ends_at" do let(:oc) { upcoming_closes_after_ends_at_oc } it "keeps the proxy order" do - expect{ syncer.sync! }.to_not change { ProxyOrder.count }.from(1) + expect{ syncer.sync! }.not_to change { ProxyOrder.count }.from(1) expect(proxy_orders).to include proxy_order end end @@ -357,7 +357,7 @@ module OrderManagement let(:oc) { closed_oc } it "removes the proxy order" do expect{ syncer.sync! }.to change { ProxyOrder.count }.from(1).to(0) - expect(proxy_orders).to_not include proxy_order + expect(proxy_orders).not_to include proxy_order end end @@ -366,7 +366,7 @@ module OrderManagement let(:oc) { open_oc } it "removes the proxy order" do expect{ syncer.sync! }.to change { ProxyOrder.count }.from(1).to(0) - expect(proxy_orders).to_not include proxy_order + expect(proxy_orders).not_to include proxy_order end end @@ -374,7 +374,7 @@ module OrderManagement let(:oc) { upcoming_closes_before_begins_at_oc } it "removes the proxy order" do expect{ syncer.sync! }.to change { ProxyOrder.count }.from(1).to(0) - expect(proxy_orders).to_not include proxy_order + expect(proxy_orders).not_to include proxy_order end end @@ -382,7 +382,7 @@ module OrderManagement let(:oc) { upcoming_closes_on_begins_at_oc } it "removes the proxy order" do expect{ syncer.sync! }.to change { ProxyOrder.count }.from(1).to(0) - expect(proxy_orders).to_not include proxy_order + expect(proxy_orders).not_to include proxy_order end end @@ -390,7 +390,7 @@ module OrderManagement let(:oc) { upcoming_closes_on_ends_at_oc } it "removes the proxy order" do expect{ syncer.sync! }.to change { ProxyOrder.count }.from(1).to(0) - expect(proxy_orders).to_not include proxy_order + expect(proxy_orders).not_to include proxy_order end end @@ -398,7 +398,7 @@ module OrderManagement let(:oc) { upcoming_closes_after_ends_at_oc } it "removes the proxy order" do expect{ syncer.sync! }.to change { ProxyOrder.count }.from(1).to(0) - expect(proxy_orders).to_not include proxy_order + expect(proxy_orders).not_to include proxy_order end end end @@ -421,8 +421,8 @@ module OrderManagement let!(:oc) { closed_oc } it "does not create a new proxy order for that oc" do - expect{ syncer.sync! }.to_not change { ProxyOrder.count }.from(0) - expect(order_cycles).to_not include oc + expect{ syncer.sync! }.not_to change { ProxyOrder.count }.from(0) + expect(order_cycles).not_to include oc end end @@ -430,8 +430,8 @@ module OrderManagement let(:oc) { open_oc_closes_before_begins_at_oc } it "does not create a new proxy order for that oc" do - expect{ subscription.save! }.to_not change { ProxyOrder.count }.from(0) - expect(order_cycles).to_not include oc + expect{ subscription.save! }.not_to change { ProxyOrder.count }.from(0) + expect(order_cycles).not_to include oc end end @@ -448,8 +448,8 @@ module OrderManagement let!(:oc) { upcoming_closes_before_begins_at_oc } it "does not create a new proxy order for that oc" do - expect{ syncer.sync! }.to_not change { ProxyOrder.count }.from(0) - expect(order_cycles).to_not include oc + expect{ syncer.sync! }.not_to change { ProxyOrder.count }.from(0) + expect(order_cycles).not_to include oc end end @@ -475,8 +475,8 @@ module OrderManagement let!(:oc) { upcoming_closes_after_ends_at_oc } it "does not create a new proxy order for that oc" do - expect{ syncer.sync! }.to_not change { ProxyOrder.count }.from(0) - expect(order_cycles).to_not include oc + expect{ syncer.sync! }.not_to change { ProxyOrder.count }.from(0) + expect(order_cycles).not_to include oc end end end diff --git a/engines/order_management/spec/services/order_management/subscriptions/stripe_payment_setup_spec.rb b/engines/order_management/spec/services/order_management/subscriptions/stripe_payment_setup_spec.rb index 8e9b063f3c..9c4e97157c 100644 --- a/engines/order_management/spec/services/order_management/subscriptions/stripe_payment_setup_spec.rb +++ b/engines/order_management/spec/services/order_management/subscriptions/stripe_payment_setup_spec.rb @@ -28,7 +28,7 @@ module OrderManagement let(:payment_method) { create(:payment_method) } it "returns the pending payment with no change" do - expect(payment).to_not receive(:update) + expect(payment).not_to receive(:update) expect(payment_setup.call!).to eq payment end end @@ -38,7 +38,7 @@ module OrderManagement context "and the card is already set (the payment source is a credit card)" do it "returns the pending payment with no change" do - expect(payment).to_not receive(:update) + expect(payment).not_to receive(:update) expect(payment_setup.call!).to eq payment end end @@ -54,7 +54,7 @@ module OrderManagement it "adds an error to the order and does not update the payment" do payment_setup.call! - expect(payment).to_not receive(:update) + expect(payment).not_to receive(:update) expect(payment_setup.call!).to eq payment expect(order.errors[:base].first).to eq "There are no authorised " \ "credit cards available to charge" @@ -80,7 +80,7 @@ module OrderManagement it "adds an error to the order and does not update the payment" do payment_setup.call! - expect(payment).to_not receive(:update) + expect(payment).not_to receive(:update) expect(payment_setup.call!).to eq payment expect(order.errors[:base].first).to eq "There are no authorised " \ "credit cards available to charge" diff --git a/engines/order_management/spec/services/order_management/subscriptions/summary_spec.rb b/engines/order_management/spec/services/order_management/subscriptions/summary_spec.rb index dcfd214008..6aeb292bf2 100644 --- a/engines/order_management/spec/services/order_management/subscriptions/summary_spec.rb +++ b/engines/order_management/spec/services/order_management/subscriptions/summary_spec.rb @@ -121,7 +121,7 @@ module OrderManagement it "returns orders specified by unrecorded_ids" do expect(orders).to include order1 - expect(orders).to_not include order2 + expect(orders).not_to include order2 end end @@ -130,7 +130,7 @@ module OrderManagement it "returns orders specified by the relevant issue hash" do expect(orders).to include order2 - expect(orders).to_not include order1 + expect(orders).not_to include order1 end end end diff --git a/engines/order_management/spec/services/order_management/subscriptions/validator_spec.rb b/engines/order_management/spec/services/order_management/subscriptions/validator_spec.rb index 6df7740d4e..55e4d28944 100644 --- a/engines/order_management/spec/services/order_management/subscriptions/validator_spec.rb +++ b/engines/order_management/spec/services/order_management/subscriptions/validator_spec.rb @@ -74,7 +74,7 @@ module OrderManagement it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:shipping_method]).to_not be_empty + expect(validator.errors[:shipping_method]).not_to be_empty end end @@ -89,7 +89,7 @@ module OrderManagement it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:shipping_method]).to_not be_empty + expect(validator.errors[:shipping_method]).not_to be_empty end end @@ -115,7 +115,7 @@ module OrderManagement it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:payment_method]).to_not be_empty + expect(validator.errors[:payment_method]).not_to be_empty end end @@ -130,7 +130,7 @@ module OrderManagement it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:payment_method]).to_not be_empty + expect(validator.errors[:payment_method]).not_to be_empty end end @@ -164,7 +164,7 @@ module OrderManagement it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:payment_method]).to_not be_empty + expect(validator.errors[:payment_method]).not_to be_empty end end @@ -192,7 +192,7 @@ module OrderManagement it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:begins_at]).to_not be_empty + expect(validator.errors[:begins_at]).not_to be_empty end end @@ -213,7 +213,7 @@ module OrderManagement let(:ends_at) { Time.zone.today } it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:ends_at]).to_not be_empty + expect(validator.errors[:ends_at]).not_to be_empty end end @@ -221,7 +221,7 @@ module OrderManagement let(:ends_at) { Time.zone.today - 1.day } it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:ends_at]).to_not be_empty + expect(validator.errors[:ends_at]).not_to be_empty end end @@ -249,8 +249,8 @@ module OrderManagement it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:bill_address]).to_not be_empty - expect(validator.errors[:ship_address]).to_not be_empty + expect(validator.errors[:bill_address]).not_to be_empty + expect(validator.errors[:ship_address]).not_to be_empty end end @@ -276,7 +276,7 @@ module OrderManagement it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:customer]).to_not be_empty + expect(validator.errors[:customer]).not_to be_empty end end @@ -288,7 +288,7 @@ module OrderManagement it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:customer]).to_not be_empty + expect(validator.errors[:customer]).not_to be_empty end end @@ -313,7 +313,7 @@ module OrderManagement it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:schedule]).to_not be_empty + expect(validator.errors[:schedule]).not_to be_empty end end @@ -325,7 +325,7 @@ module OrderManagement it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:schedule]).to_not be_empty + expect(validator.errors[:schedule]).not_to be_empty end end @@ -371,7 +371,7 @@ module OrderManagement it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:payment_method]).to_not be_empty + expect(validator.errors[:payment_method]).not_to be_empty end end @@ -383,7 +383,7 @@ module OrderManagement it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:payment_method]).to_not be_empty + expect(validator.errors[:payment_method]).not_to be_empty end end @@ -395,7 +395,7 @@ module OrderManagement it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:payment_method]).to_not be_empty + expect(validator.errors[:payment_method]).not_to be_empty end end @@ -428,7 +428,7 @@ module OrderManagement it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:subscription_line_items]).to_not be_empty + expect(validator.errors[:subscription_line_items]).not_to be_empty end end @@ -441,7 +441,7 @@ module OrderManagement it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:subscription_line_items]).to_not be_empty + expect(validator.errors[:subscription_line_items]).not_to be_empty end end @@ -468,7 +468,7 @@ module OrderManagement it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:subscription_line_items]).to_not be_empty + expect(validator.errors[:subscription_line_items]).not_to be_empty end end @@ -480,7 +480,7 @@ module OrderManagement it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:subscription_line_items]).to_not be_empty + expect(validator.errors[:subscription_line_items]).not_to be_empty end end end @@ -538,7 +538,7 @@ module OrderManagement it "adds an error and returns false" do expect(validator.valid?).to be false - expect(validator.errors[:subscription_line_items]).to_not be_empty + expect(validator.errors[:subscription_line_items]).not_to be_empty end end diff --git a/engines/order_management/spec/services/order_management/subscriptions/variants_list_spec.rb b/engines/order_management/spec/services/order_management/subscriptions/variants_list_spec.rb index 0e00df50df..dc51f14f8e 100644 --- a/engines/order_management/spec/services/order_management/subscriptions/variants_list_spec.rb +++ b/engines/order_management/spec/services/order_management/subscriptions/variants_list_spec.rb @@ -66,7 +66,7 @@ module OrderManagement } it "is not eligible" do - expect(described_class.eligible_variants(shop)).to_not include(variant) + expect(described_class.eligible_variants(shop)).not_to include(variant) end end @@ -106,7 +106,7 @@ module OrderManagement context "if the variant is unrelated" do it "is not eligible" do - expect(described_class.eligible_variants(shop)).to_not include(variant) + expect(described_class.eligible_variants(shop)).not_to include(variant) end end end @@ -154,7 +154,7 @@ module OrderManagement context "if the variant is unrelated" do it "is false" do - expect(described_class).to_not be_in_open_and_upcoming_order_cycles(shop, + expect(described_class).not_to be_in_open_and_upcoming_order_cycles(shop, schedule, variant) end diff --git a/engines/web/app/views/web/angular_templates/cookies_banner.html.haml b/engines/web/app/views/web/angular_templates/cookies_banner.html.haml index 2343051cd7..04b4b4ba20 100644 --- a/engines/web/app/views/web/angular_templates/cookies_banner.html.haml +++ b/engines/web/app/views/web/angular_templates/cookies_banner.html.haml @@ -11,5 +11,5 @@ {{ 'legal.cookies_banner.cookies_policy_link' | t}} .large-3.columns - %button{ng: { controller:"CookiesBannerCtrl", click: "acceptCookies()" }} + %button{ "ng-controller": "CookiesBannerCtrl", "ng-click": "acceptCookies()" } {{ 'legal.cookies_banner.cookies_accept_button' | t}} diff --git a/engines/web/app/views/web/angular_templates/cookies_policy.html.haml b/engines/web/app/views/web/angular_templates/cookies_policy.html.haml index c53fa93bed..ab52054b24 100644 --- a/engines/web/app/views/web/angular_templates/cookies_policy.html.haml +++ b/engines/web/app/views/web/angular_templates/cookies_policy.html.haml @@ -12,7 +12,7 @@ %p {{ 'legal.cookies_policy.essential_cookies_desc' | t }} -%table{ng: { controller:"CookiesPolicyModalCtrl"}} +%table{ "ng-controller": "CookiesPolicyModalCtrl" } = render_cookie_entry( "_ofn_session_id", "legal.cookies_policy.cookie_session_desc" ) = render_cookie_entry( "cookies_consent", "legal.cookies_policy.cookie_consent_desc" ) = render_cookie_entry( "remember_spree_user_token", "legal.cookies_policy.cookie_remember_me_desc" ) @@ -52,7 +52,7 @@ %p {{ 'legal.cookies_policy.statistics_cookies_matomo_desc_html' | t }} - %table{ng: { controller:"CookiesPolicyModalCtrl"}} + %table{ "ng-controller": "CookiesPolicyModalCtrl" } = render_cookie_entry( "_pk_ref, _pk_cvar, _pk_id and _pk_ses", "legal.cookies_policy.cookie_matomo_basics_desc" ) = render_cookie_entry( "_pk_hsr, _pk_cvar, _pk_id and _pk_ses", "legal.cookies_policy.cookie_matomo_heatmap_desc" ) = render_cookie_entry( "piwik_ignore, _pk_cvar, _pk_id and _pk_ses", "legal.cookies_policy.cookie_matomo_ignore_desc" ) diff --git a/engines/web/spec/helpers/cookies_policy_helper_spec.rb b/engines/web/spec/helpers/cookies_policy_helper_spec.rb index 6807786a36..02ff9910a0 100644 --- a/engines/web/spec/helpers/cookies_policy_helper_spec.rb +++ b/engines/web/spec/helpers/cookies_policy_helper_spec.rb @@ -24,13 +24,13 @@ module Web end scenario "is not equal to the matomo URL" do - expect(helper.matomo_iframe_src).to_not eq Spree::Config.matomo_url + expect(helper.matomo_iframe_src).not_to eq Spree::Config.matomo_url end end scenario "is not nil, when matomo url is nil" do Spree::Config.matomo_url = nil - expect(helper.matomo_iframe_src).to_not eq nil + expect(helper.matomo_iframe_src).not_to eq nil end end diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000000..4c914cf1f8 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,195 @@ +/* + * For a detailed explanation regarding each configuration property, visit: + * https://jestjs.io/docs/configuration + */ + +module.exports = { + // All imported modules in your tests should be mocked automatically + // automock: false, + + // Stop running tests after `n` failures + // bail: 0, + + // The directory where Jest should store its cached dependency information + // cacheDirectory: "/private/var/folders/hf/7hdgr3v5369_b_j_0tj22d5r0000gn/T/jest_dx", + + // Automatically clear mock calls, instances and results before every test + // clearMocks: true, + + // Indicates whether the coverage information should be collected while executing the test + // collectCoverage: false, + + // An array of glob patterns indicating a set of files for which coverage information should be collected + // collectCoverageFrom: undefined, + + // The directory where Jest should output its coverage files + // coverageDirectory: undefined, + + // An array of regexp pattern strings used to skip coverage collection + // coveragePathIgnorePatterns: [ + // "/node_modules/" + // ], + + // Indicates which provider should be used to instrument code for coverage + // coverageProvider: "v8", + + // A list of reporter names that Jest uses when writing coverage reports + // coverageReporters: [ + // "json", + // "text", + // "lcov", + // "clover" + // ], + + // An object that configures minimum threshold enforcement for coverage results + // coverageThreshold: undefined, + + // A path to a custom dependency extractor + // dependencyExtractor: undefined, + + // Make calling deprecated APIs throw helpful error messages + // errorOnDeprecated: false, + + // Force coverage collection from ignored files using an array of glob patterns + // forceCoverageMatch: [], + + // A path to a module which exports an async function that is triggered once before all test suites + // globalSetup: undefined, + + // A path to a module which exports an async function that is triggered once after all test suites + // globalTeardown: undefined, + + // A set of global variables that need to be available in all test environments + // globals: {}, + + // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers. + // maxWorkers: "50%", + + // An array of directory names to be searched recursively up from the requiring module's location + // moduleDirectories: [ + // "node_modules" + // ], + + // An array of file extensions your modules use + // moduleFileExtensions: [ + // "js", + // "jsx", + // "ts", + // "tsx", + // "json", + // "node" + // ], + + // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module + // moduleNameMapper: {}, + + // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader + // modulePathIgnorePatterns: [], + + // Activates notifications for test results + // notify: false, + + // An enum that specifies notification mode. Requires { notify: true } + // notifyMode: "failure-change", + + // A preset that is used as a base for Jest's configuration + // preset: undefined, + + // Run tests from one or more projects + // projects: undefined, + + // Use this configuration option to add custom reporters to Jest + // reporters: undefined, + + // Automatically reset mock state before every test + // resetMocks: false, + + // Reset the module registry before running each individual test + // resetModules: false, + + // A path to a custom resolver + // resolver: undefined, + + // Automatically restore mock state and implementation before every test + // restoreMocks: false, + + // The root directory that Jest should scan for tests and modules within + // rootDir: undefined, + + // A list of paths to directories that Jest should use to search for files in + // roots: [ + // "" + // ], + + // Allows you to use a custom runner instead of Jest's default test runner + // runner: "jest-runner", + + // The paths to modules that run some code to configure or set up the testing environment before each test + // setupFiles: [], + + // A list of paths to modules that run some code to configure or set up the testing framework before each test + // setupFilesAfterEnv: [], + + // The number of seconds after which a test is considered as slow and reported as such in the results. + // slowTestThreshold: 5, + + // A list of paths to snapshot serializer modules Jest should use for snapshot testing + // snapshotSerializers: [], + + // The test environment that will be used for testing + // testEnvironment: "jest-environment-node", + + // Options that will be passed to the testEnvironment + // testEnvironmentOptions: {}, + + // Adds a location field to test results + // testLocationInResults: false, + + // The glob patterns Jest uses to detect test files + // testMatch: [ + // "**/__tests__/**/*.[jt]s?(x)", + // "**/?(*.)+(spec|test).[tj]s?(x)" + // ], + + // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped + // testPathIgnorePatterns: [ + // "/node_modules/" + // ], + + // The regexp pattern or array of patterns that Jest uses to detect test files + "testRegex": [ + "spec/javascripts/.*_test\\.js" + ], + + // This option allows the use of a custom results processor + // testResultsProcessor: undefined, + + // This option allows use of a custom test runner + // testRunner: "jest-circus/runner", + + // This option sets the URL for the jsdom environment. It is reflected in properties such as location.href + // testURL: "http://localhost", + + // Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout" + // timers: "real", + + // A map from regular expressions to paths to transformers + // transform: undefined, + + // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation + "transformIgnorePatterns": [ + "/node_modules/(?!(stimulus)/)" + ] + + // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them + // unmockedModulePathPatterns: undefined, + + // Indicates whether each individual test should be reported during the run + // verbose: undefined, + + // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode + // watchPathIgnorePatterns: [], + + // Whether to use watchman for file crawling + // watchman: true, +}; diff --git a/lib/haml_up.rb b/lib/haml_up.rb new file mode 100644 index 0000000000..2ecc619960 --- /dev/null +++ b/lib/haml_up.rb @@ -0,0 +1,118 @@ +# frozen_string_literal: true + +# Upgrade HAML attribute syntax to prepare for HAML 6. +# +# HAML 6 stopped supporting nested hash attributes other than `data` and `aria`. +# We used to be able to write: +# +# %div{ ng: { class: "upper", bind: "model" } } +# +# This needs to be written in a flat structure now: +# +# %div{ "ng-class" => "upper", "ng-bind" => "model" } +# +require "fileutils" +require "haml" + +class HamlUp + def upgrade_file(filename) + template = File.read(filename) + rewrite_template(template) + File.write(filename, template) + end + + def rewrite_template(template) + haml_attributes(template).compact.each do |attributes| + rewrite_attributes(template, attributes) + end + end + + def rewrite_attributes(template, original) + attributes = parse_attributes(original) + + if attributes.nil? # parser failed + puts "Warning: failed to parse:\n" # rubocop:disable Rails/Output + puts original # rubocop:disable Rails/Output + return + end + + parse_deprecated_hashes(attributes) + + to_transform = attributes.select { |_k, v| v.is_a? Hash } + + return if to_transform.empty? + + to_transform.each do |key, hash| + add_full_keys(attributes, key, hash) + attributes.delete(key) + end + + replace_attributes(template, original, attributes) + end + + def haml_attributes(template) + options = Haml::Options.new + parsed_tree = Haml::Parser.new(options).call(template) + elements = flatten_tree(parsed_tree) + elements.map { |e| e.value[:dynamic_attributes]&.old } + end + + def flatten_tree(parent) + parent.children.flat_map do |child| + [child, *flatten_tree(child)] + end + end + + def parse_attributes(string) + Haml::AttributeParser.parse(string) + end + + def parse_deprecated_hashes(hash) + hash.each do |key, value| + next if ["aria", "data"].include?(key) + + parsed = parse_attributes(value) + next unless parsed.is_a? Hash + + parse_deprecated_hashes(parsed) + hash[key] = parsed + end + end + + def add_full_keys(attributes, key, hash) + hash.each do |subkey, value| + full_key = "#{key}-#{subkey}" + if value.is_a? Hash + add_full_keys(attributes, full_key, value) + else + attributes[full_key] = value + end + end + end + + def replace_attributes(template, original, attributes) + parsed_lines = original.split("\n") + lines_as_regex = parsed_lines.map(&Regexp.method(:escape)) + pattern = lines_as_regex.join("\n\s*") + + template.gsub!(/#{pattern}/, stringify(attributes)) + end + + def stringify(hash) + entries = hash.map do |key, value| + value = stringify(value) if value.is_a? Hash + + # We prefer the Ruby 1.9 hash syntax with symbols followed by a colon + # like this: + # + # %button{ disabled: true, "ng-class": "primary-button" } + # + # Symbols start with `:` which we slice off. It gets appended below. + key = key.to_sym.inspect.slice(1..-1) + + "#{key}: #{value}" + end + + "{ #{entries.join(', ')} }" + end +end diff --git a/lib/open_food_network/enterprise_fee_calculator.rb b/lib/open_food_network/enterprise_fee_calculator.rb index 66001716ab..739725ce79 100644 --- a/lib/open_food_network/enterprise_fee_calculator.rb +++ b/lib/open_food_network/enterprise_fee_calculator.rb @@ -111,7 +111,7 @@ module OpenFoodNetwork EnterpriseFee. per_item. joins(exchanges: :exchange_variants). - where('exchanges.order_cycle_id = ?', @order_cycle.id). + where(exchanges: { order_cycle_id: @order_cycle.id }). merge(Exchange.supplying_to(@distributor)). select('enterprise_fees.*, exchange_variants.variant_id AS variant_id') end diff --git a/lib/open_food_network/order_cycle_permissions.rb b/lib/open_food_network/order_cycle_permissions.rb index 7568ff970e..c6c2508112 100644 --- a/lib/open_food_network/order_cycle_permissions.rb +++ b/lib/open_food_network/order_cycle_permissions.rb @@ -99,15 +99,15 @@ module OpenFoodNetwork ).pluck(:id).uniq product_ids = Spree::Product.joins(:variants). - where("spree_variants.id IN (?)", variant_ids).pluck(:id).uniq + where(spree_variants: { id: variant_ids }).pluck(:id).uniq producers_active_ids = Enterprise.joins(:supplied_products). - where("spree_products.id IN (?)", product_ids).pluck(:id).uniq + where(spree_products: { id: product_ids }).pluck(:id).uniq end - ids = managed_permitted_ids | hubs_permitted_ids | hubs_permitting_ids \ - | producers_permitted_ids | producers_permitting_ids | managed_active_ids \ - | hubs_active_ids | producers_active_ids + ids = managed_permitted_ids | hubs_permitted_ids | hubs_permitting_ids | + producers_permitted_ids | producers_permitting_ids | + managed_active_ids | hubs_active_ids | producers_active_ids Enterprise.where(id: ids) end diff --git a/lib/reporting/line_items.rb b/lib/reporting/line_items.rb index a949e02dce..233c965c2a 100644 --- a/lib/reporting/line_items.rb +++ b/lib/reporting/line_items.rb @@ -7,7 +7,7 @@ module Reporting @order_permissions = order_permissions @params = params complete_not_canceled_visible_orders = - CompleteVisibleOrders.new(order_permissions).query.not_state(:canceled) + CompleteVisibleOrdersQuery.new(order_permissions).call.not_state(:canceled) @orders_relation = orders_relation || complete_not_canceled_visible_orders end @@ -36,7 +36,7 @@ module Reporting without_editable_line_items = line_items - editable_line_items(line_items) without_editable_line_items.each do |line_item| - OrderDataMasker.new(line_item.order).call + Orders::MaskDataService.new(line_item.order).call end line_items diff --git a/lib/reporting/report_headers_builder.rb b/lib/reporting/report_headers_builder.rb index 37b85d3629..ef129bedc8 100644 --- a/lib/reporting/report_headers_builder.rb +++ b/lib/reporting/report_headers_builder.rb @@ -11,13 +11,13 @@ module Reporting def table_headers filter = proc { |key| key.to_sym.in?(fields_to_show) } - report.columns.keys.filter { |key| filter.call(key) }.map do |key| + report.table_columns.keys.filter { |key| filter.call(key) }.map do |key| translate_header(key) end end def available_headers - report.columns.keys.map { |key| [translate_header(key), key] } + report.table_columns.keys.map { |key| [translate_header(key), key] } end def fields_to_hide diff --git a/lib/reporting/report_rows_builder.rb b/lib/reporting/report_rows_builder.rb index f8b09488b0..4da6c969c3 100644 --- a/lib/reporting/report_rows_builder.rb +++ b/lib/reporting/report_rows_builder.rb @@ -78,12 +78,11 @@ module Reporting end def group_and_sort(rule, remaining_rules, datas) - result = [] groups = group_data_with_rule(datas, rule) sorted_groups = sort_groups_with_rule(groups, rule) - sorted_groups.each do |group_value, group_datas| - result << { + sorted_groups.map do |group_value, group_datas| + { is_group: true, header: @builder.build_header(rule, group_value, group_datas), header_class: rule[:header_class], @@ -92,7 +91,6 @@ module Reporting data: build_tree(group_datas, remaining_rules) } end - result end def group_data_with_rule(datas, rule) diff --git a/lib/reporting/report_template.rb b/lib/reporting/report_template.rb index 5c295ae553..3567e779e5 100644 --- a/lib/reporting/report_template.rb +++ b/lib/reporting/report_template.rb @@ -54,6 +54,10 @@ module Reporting raise NotImplementedError end + def table_columns + columns + end + # Exple { total_price: :currency } def columns_format {} diff --git a/lib/reporting/reports/bulk_coop/base.rb b/lib/reporting/reports/bulk_coop/base.rb index bf48a6a9d8..5bb079d923 100644 --- a/lib/reporting/reports/bulk_coop/base.rb +++ b/lib/reporting/reports/bulk_coop/base.rb @@ -35,7 +35,7 @@ module Reporting @report_line_items ||= Reporting::LineItems.new( order_permissions, @params, - CompleteVisibleOrders.new(order_permissions).query + CompleteVisibleOrdersQuery.new(order_permissions).call ) end diff --git a/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_order.rb b/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_order.rb index e035a2d469..2ea4a4db14 100644 --- a/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_order.rb +++ b/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_order.rb @@ -66,8 +66,8 @@ module Reporting enterprise_fee_id = arg.first - EnterpriseFee.exists?(id: enterprise_fee_id, - enterprise_id: ransack_params[:enterprise_fee_owner_id_in] ) + EnterpriseFee.where(id: enterprise_fee_id, + enterprise_id: ransack_params[:enterprise_fee_owner_id_in] ).exists? end def filter_enterprise_fee_by_id_active? diff --git a/lib/reporting/reports/order_cycle_management/base.rb b/lib/reporting/reports/order_cycle_management/base.rb index e20e13ab25..d62cd3de33 100644 --- a/lib/reporting/reports/order_cycle_management/base.rb +++ b/lib/reporting/reports/order_cycle_management/base.rb @@ -29,7 +29,7 @@ module Reporting def orders search_result = search.result.order(:completed_at) - orders = OutstandingBalance.new(search_result).query.select('spree_orders.*') + orders = OutstandingBalanceQuery.new(search_result).call.select('spree_orders.*') filter(orders) end diff --git a/lib/reporting/reports/orders_and_distributors/base.rb b/lib/reporting/reports/orders_and_distributors/base.rb index 9225096680..2f54235d5e 100644 --- a/lib/reporting/reports/orders_and_distributors/base.rb +++ b/lib/reporting/reports/orders_and_distributors/base.rb @@ -43,7 +43,7 @@ module Reporting editable_orders_ids = permissions.editable_orders.select(&:id).map(&:id) orders .filter { |order| order.in?(editable_orders_ids) } - .each { |order| OrderDataMasker.new(order).call } + .each { |order| Orders::MaskDataService.new(order).call } # Get Line Items orders.map(&:line_items).flatten end diff --git a/lib/reporting/reports/packing/customer.rb b/lib/reporting/reports/packing/customer.rb index a5609725a2..65622639b4 100644 --- a/lib/reporting/reports/packing/customer.rb +++ b/lib/reporting/reports/packing/customer.rb @@ -4,11 +4,16 @@ module Reporting module Reports module Packing class Customer < Base + def table_columns + Struct.new(:keys).new( + [:hub, :customer_code, :first_name, :last_name, :phone, :supplier, :product, + :variant, :weight, :height, :width, :depth, :quantity, :price, :temp_controlled] + ) + end + def columns # Reorder default columns - super.slice(:hub, :customer_code, :first_name, :last_name, :phone, - :supplier, :product, :variant, :weight, :height, :width, :depth, :quantity, - :price, :temp_controlled) + super.slice(*table_columns.keys) end def rules diff --git a/lib/reporting/reports/packing/product.rb b/lib/reporting/reports/packing/product.rb index e219fc2c88..63990f3ad4 100644 --- a/lib/reporting/reports/packing/product.rb +++ b/lib/reporting/reports/packing/product.rb @@ -4,11 +4,16 @@ module Reporting module Reports module Packing class Product < Base + def table_columns + Struct.new(:keys).new( + [:hub, :supplier, :product, :variant, :customer_code, :first_name, + :last_name, :phone, :quantity, :price, :temp_controlled] + ) + end + def columns # Reorder default columns - super.slice(:hub, :supplier, :product, :variant, - :customer_code, :first_name, :last_name, :phone, - :quantity, :price, :temp_controlled) + super.slice(*table_columns.keys) end def rules diff --git a/lib/reporting/reports/packing/supplier.rb b/lib/reporting/reports/packing/supplier.rb index cca255786b..d1f6861ff9 100644 --- a/lib/reporting/reports/packing/supplier.rb +++ b/lib/reporting/reports/packing/supplier.rb @@ -4,10 +4,16 @@ module Reporting module Reports module Packing class Supplier < Base + def table_columns + Struct.new(:keys).new( + [:hub, :supplier, :customer_code, :first_name, :last_name, :phone, + :product, :variant, :quantity, :price, :temp_controlled] + ) + end + def columns # Reorder default columns - super.slice(:hub, :supplier, :customer_code, :first_name, :last_name, :phone, - :product, :variant, :quantity, :price, :temp_controlled) + super.slice(*table_columns.keys) end def rules diff --git a/lib/reporting/reports/products_and_inventory/base.rb b/lib/reporting/reports/products_and_inventory/base.rb index a65b113f2a..3b58daca76 100644 --- a/lib/reporting/reports/products_and_inventory/base.rb +++ b/lib/reporting/reports/products_and_inventory/base.rb @@ -17,7 +17,7 @@ module Reporting producer_suburb: proc { |variant| variant.product.supplier.address.city }, product: proc { |variant| variant.product.name }, product_properties: proc { |v| v.product.properties.map(&:name).join(", ") }, - taxons: proc { |variant| variant.product.primary_taxon.name }, + taxons: proc { |variant| variant.primary_taxon.name }, variant_value: proc { |variant| variant.full_name }, price: proc { |variant| variant.price }, group_buy_unit_quantity: proc { |variant| variant.product.group_buy_unit_size }, @@ -59,7 +59,7 @@ module Reporting def filter_to_supplier(variants) if params[:supplier_id].to_i > 0 - variants.where("spree_products.supplier_id = ?", params[:supplier_id]) + variants.where(spree_products: { supplier_id: params[:supplier_id] }) else variants end diff --git a/lib/reporting/reports/products_and_inventory/lettuce_share.rb b/lib/reporting/reports/products_and_inventory/lettuce_share.rb index 8311ff111d..366332fd55 100644 --- a/lib/reporting/reports/products_and_inventory/lettuce_share.rb +++ b/lib/reporting/reports/products_and_inventory/lettuce_share.rb @@ -32,7 +32,7 @@ module Reporting total: proc { |_variant| '' }, gst: proc { |variant| gst(variant) }, grower: proc { |variant| grower_and_method(variant) }, - taxon: proc { |variant| variant.product.primary_taxon.name } + taxon: proc { |variant| variant.primary_taxon.name } } end diff --git a/lib/reporting/reports/sales_tax/sales_tax_totals_by_producer.rb b/lib/reporting/reports/sales_tax/sales_tax_totals_by_producer.rb index 0271b38d59..a2c00ea082 100644 --- a/lib/reporting/reports/sales_tax/sales_tax_totals_by_producer.rb +++ b/lib/reporting/reports/sales_tax/sales_tax_totals_by_producer.rb @@ -24,9 +24,9 @@ module Reporting # [tax_rate, supplier_id, distributor_id and order_cycle_id] report_line_items.list .flat_map do |line_item| - line_item.tax_rates.map do |tax_rate| + line_item.adjustments.eligible.tax.map do |tax_rate| { - tax_rate_id: tax_rate.id, + tax_rate_id: tax_rate.originator_id, line_item: } end diff --git a/lib/reporting/reports/sales_tax/tax_rates.rb b/lib/reporting/reports/sales_tax/tax_rates.rb index 83bd3f2eb0..8c82d44b66 100644 --- a/lib/reporting/reports/sales_tax/tax_rates.rb +++ b/lib/reporting/reports/sales_tax/tax_rates.rb @@ -11,7 +11,7 @@ module Reporting total_excl_vat: proc { |order| order.total - order.total_tax } } add_key_for_each_rate(result, proc { |rate| - proc { |order| OrderTaxAdjustmentsFetcher.new(order).totals.fetch(rate, 0) } + proc { |order| Orders::FetchTaxAdjustmentsService.new(order).totals.fetch(rate, 0) } }) other = { total_tax: proc { |order| order.total_tax }, diff --git a/lib/reporting/reports/xero_invoices/base.rb b/lib/reporting/reports/xero_invoices/base.rb index d7a36c5c6f..49d9fad4a6 100644 --- a/lib/reporting/reports/xero_invoices/base.rb +++ b/lib/reporting/reports/xero_invoices/base.rb @@ -189,7 +189,7 @@ module Reporting '', '', '', - Spree::Config.currency, + CurrentConfig.get(:currency), '', order.paid? ? I18n.t(:y) : I18n.t(:n)] end diff --git a/lib/spree/core/controller_helpers/order.rb b/lib/spree/core/controller_helpers/order.rb index 3aea7c853d..d2a1795e20 100644 --- a/lib/spree/core/controller_helpers/order.rb +++ b/lib/spree/core/controller_helpers/order.rb @@ -79,7 +79,7 @@ module Spree end def current_currency - Spree::Config[:currency] + CurrentConfig.get(:currency) end def ip_address diff --git a/lib/spree/core/mail_settings.rb b/lib/spree/core/mail_settings.rb index 2c8261b246..9824283521 100644 --- a/lib/spree/core/mail_settings.rb +++ b/lib/spree/core/mail_settings.rb @@ -20,29 +20,22 @@ module Spree private def mail_server_settings - settings = if need_authentication? - basic_settings.merge(user_credentials) - else - basic_settings - end - - settings.merge(enable_starttls_auto: secure_connection?) - end - - def user_credentials - { user_name: Config.smtp_username, - password: Config.smtp_password } - end - - def basic_settings - { address: Config.mail_host, + { + address: Config.mail_host, domain: Config.mail_domain, port: Config.mail_port, - authentication: Config.mail_auth_type } + authentication:, + enable_starttls_auto: secure_connection?, + user_name: Config.smtp_username.presence, + password: Config.smtp_password.presence, + } end - def need_authentication? - Config.mail_auth_type != 'None' + def authentication + # "None" is an option in the UI but not a real authentication type. + # We should remove it from our host configurations but I'm keeping + # this check for backwards-compatibility for now. + Config.mail_auth_type.presence unless Config.mail_auth_type == "None" end def secure_connection? diff --git a/lib/spree/localized_number.rb b/lib/spree/localized_number.rb index 112fb26471..11e572c1a8 100644 --- a/lib/spree/localized_number.rb +++ b/lib/spree/localized_number.rb @@ -77,7 +77,7 @@ module Spree private def non_activerecord_attribute?(attribute) - table_exists? && !column_names.include?(attribute.to_s) + table_exists? && column_names.exclude?(attribute.to_s) rescue ::ActiveRecord::NoDatabaseError # This class is now loaded during `rake db:create` (since Rails 5.2), and not only does the # table not exist, but the database does not even exist yet, and throws a fatal error. diff --git a/lib/spree/money.rb b/lib/spree/money.rb index 4a11d33497..6c6b52a4f2 100644 --- a/lib/spree/money.rb +++ b/lib/spree/money.rb @@ -9,7 +9,7 @@ module Spree delegate :cents, to: :money def initialize(amount, options = {}) - @money = ::Monetize.parse([amount, options[:currency] || Spree::Config[:currency]].join) + @money = ::Monetize.parse([amount, options[:currency] || CurrentConfig.get(:currency)].join) if options.key?(:symbol_position) options[:format] = position_to_format(options.delete(:symbol_position)) @@ -20,7 +20,7 @@ module Spree # Return the currency symbol (on its own) for the current default currency def self.currency_symbol - ::Money.new(0, Spree::Config[:currency]).symbol + ::Money.new(0, CurrentConfig.get(:currency)).symbol end def to_s @@ -44,11 +44,11 @@ module Spree def defaults { - with_currency: Spree::Config[:display_currency], - no_cents: Spree::Config[:hide_cents], - decimal_mark: Spree::Config[:currency_decimal_mark], - thousands_separator: Spree::Config[:currency_thousands_separator], - format: position_to_format(Spree::Config[:currency_symbol_position]) + with_currency: CurrentConfig.get(:display_currency), + no_cents: CurrentConfig.get(:hide_cents), + decimal_mark: CurrentConfig.get(:currency_decimal_mark), + thousands_separator: CurrentConfig.get(:currency_thousands_separator), + format: position_to_format(CurrentConfig.get(:currency_symbol_position)) } end diff --git a/lib/tasks/data.rake b/lib/tasks/data.rake index da55b3580e..bb26f748b1 100644 --- a/lib/tasks/data.rake +++ b/lib/tasks/data.rake @@ -7,7 +7,7 @@ namespace :ofn do input = request_months # For each order cycle which was modified within the past 3 months - OrderCycle.where('updated_at > ?', Date.current - input.months).each do |order_cycle| + OrderCycle.where('updated_at > ?', Date.current - input.months).find_each do |order_cycle| # Cycle through the incoming exchanges order_cycle.exchanges.incoming.each do |exchange| next if exchange.sender == exchange.receiver @@ -46,11 +46,13 @@ namespace :ofn do end # For each variant in the exchange - products = Spree::Product.joins(:variants).where( - 'spree_variants.id IN (?)', exchange.variants - ).pluck(:id).uniq - producers = Enterprise.joins(:supplied_products).where("spree_products.id IN (?)", - products).distinct + products = Spree::Product.joins(:variants) + .where(spree_variants: { id: exchange.variants }) + .pluck(:id) + .uniq + producers = Enterprise.joins(:supplied_products) + .where(spree_products: { id: products }) + .distinct producers.each do |producer| next if producer == exchange.receiver diff --git a/lib/tasks/data/anonymize_data.rake b/lib/tasks/data/anonymize_data.rake index 5a19e56be0..d5a6a8f558 100644 --- a/lib/tasks/data/anonymize_data.rake +++ b/lib/tasks/data/anonymize_data.rake @@ -44,7 +44,7 @@ namespace :ofn do Spree::User.update_all("email = concat(id, '_ofn_user@example.com'), login = concat(id, '_ofn_user@example.com'), unconfirmed_email = concat(id, '_ofn_user@example.com')") - Customer.where("user_id IS NULL") + Customer.where(user_id: nil) .update_all("email = concat(id, '_ofn_customer@example.com'), name = concat('Customer Number ', id, ' (without connected User)')") Customer.where.not(user_id: nil) diff --git a/lib/tasks/data/remove_transient_data.rb b/lib/tasks/data/remove_transient_data.rb index 36136ceff8..1a519fae8f 100644 --- a/lib/tasks/data/remove_transient_data.rb +++ b/lib/tasks/data/remove_transient_data.rb @@ -38,6 +38,6 @@ class RemoveTransientData # Carts with failed payments are ignored, as they contain potentially useful data Spree::Order. joins("LEFT OUTER JOIN spree_payments ON spree_orders.id = spree_payments.order_id"). - where("spree_payments.id IS NULL") + where(spree_payments: { id: nil }) end end diff --git a/lib/tasks/import_product_images.rake b/lib/tasks/import_product_images.rake index e82d1e55d1..6b1ab14741 100644 --- a/lib/tasks/import_product_images.rake +++ b/lib/tasks/import_product_images.rake @@ -4,15 +4,15 @@ namespace :ofn do namespace :import do desc "Importing images for products from CSV" task :product_images, [:filename] => [:environment] do |_task, args| - COLUMNS = [:producer, :name, :image_url].freeze - puts "Warning: use only with trusted URLs. This script will download whatever it can, " \ "including local secrets, and expose the file as an image file." raise "Filename required" if args[:filename].blank? + columns = %i[producer name image_url].freeze + csv = CSV.read(args[:filename], headers: true, header_converters: :symbol) - raise "CSV columns reqired: #{COLUMNS.map(&:to_s)}" if (COLUMNS - csv.headers).present? + raise "CSV columns reqired: #{columns.map(&:to_s)}" if (columns - csv.headers).present? csv.each.with_index do |entry, index| puts "#{index} #{entry[:producer]}, #{entry[:name]}" diff --git a/lib/tasks/sample_data/order_factory.rb b/lib/tasks/sample_data/order_factory.rb index 39cfdb2996..ef670aa5e0 100644 --- a/lib/tasks/sample_data/order_factory.rb +++ b/lib/tasks/sample_data/order_factory.rb @@ -51,7 +51,7 @@ module SampleData def create_complete_order order = create_cart_order - OrderWorkflow.new(order).complete + Orders::WorkflowService.new(order).complete order end diff --git a/lib/tasks/sample_data/user_factory.rb b/lib/tasks/sample_data/user_factory.rb index 445c3fd402..bb5268e2b3 100644 --- a/lib/tasks/sample_data/user_factory.rb +++ b/lib/tasks/sample_data/user_factory.rb @@ -30,7 +30,7 @@ module SampleData def create_user(name) email = "#{name.downcase.tr(' ', '.')}@example.org" - password = Spree::User.friendly_token + password = "ofn123" log "- #{email}" user = Spree::User.create_with( password:, diff --git a/lib/tasks/subscriptions/debug.rake b/lib/tasks/subscriptions/debug.rake index 3b2e29d90a..750bfb4d73 100644 --- a/lib/tasks/subscriptions/debug.rake +++ b/lib/tasks/subscriptions/debug.rake @@ -12,7 +12,7 @@ namespace :ofn do puts "Order Cycle #{order_cycle.name}" order_cycle.schedules.each do |schedule| puts "Schedule #{schedule.name}" - Subscription.where(schedule_id: schedule.id).each do |subscription| + Subscription.where(schedule_id: schedule.id).find_each do |subscription| puts puts "Subscription #{subscription.id}" puts subscription.shop.name @@ -23,7 +23,7 @@ namespace :ofn do puts "Canceled at #{subscription.canceled_at} and paused at #{subscription.paused_at}" ProxyOrder.where(order_cycle_id:, - subscription_id: subscription.id).each do |proxy_order| + subscription_id: subscription.id).find_each do |proxy_order| puts puts "Proxy Order #{proxy_order.id}" puts "Canceled at #{proxy_order.canceled_at}" @@ -42,7 +42,7 @@ namespace :ofn do puts "Source #{payment.source.to_json}" end Spree::LogEntry.where(source_type: "Spree::Payment", - source_id: payment.id).each do |log_entry| + source_id: payment.id).find_each do |log_entry| puts "Log Entries found" puts log_entry.details end diff --git a/lib/tasks/users.rake b/lib/tasks/users.rake index d1249cb9a0..fdf2c110f1 100644 --- a/lib/tasks/users.rake +++ b/lib/tasks/users.rake @@ -5,23 +5,8 @@ require 'csv' namespace :ofn do desc 'remove the limit of enterprises a user can create' task :remove_enterprise_limit, [:user_id] => :environment do |_task, args| - RemoveEnterpriseLimit.new(args.user_id).call - end - - class RemoveEnterpriseLimit - MAX_INTEGER = 2_147_483_647 - - def initialize(user_id) - @user_id = user_id - end - - def call - user = Spree::User.find(user_id) - user.update_attribute(:enterprise_limit, MAX_INTEGER) - end - - private - - attr_reader :user_id + max_integer = 2_147_483_647 + user = Spree::User.find(args.user_id) + user.update_attribute(:enterprise_limit, max_integer) end end diff --git a/package.json b/package.json index e9ce888e22..888b14112c 100644 --- a/package.json +++ b/package.json @@ -9,19 +9,12 @@ "scripts": { "pretty-quick": "pretty-quick" }, - "jest": { - "testRegex": [ - "spec/javascripts/.*_test\\.js" - ], - "transformIgnorePatterns": [ - "/node_modules/(?!(stimulus)/)" - ] - }, "dependencies": { "@floating-ui/dom": "^1.6.3", - "@hotwired/turbo": "^8.0.3", + "@hotwired/turbo": "^8.0.4", "@rails/webpacker": "5.4.4", - "cable_ready": "5.0.2", + "@stimulus-components/rails-nested-form": "^5.0.0", + "cable_ready": "5.0.1", "debounced": "^0.0.5", "flatpickr": "^4.6.9", "foundation-sites": "^5.5.3", @@ -34,10 +27,9 @@ "shortcut-buttons-flatpickr": "^0.4.0", "stimulus": "^3.2.2", "stimulus-flatpickr": "^1.4.0", - "stimulus-rails-nested-form": "https://github.com/openfoodfoundation/stimulus-rails-nested-form.git#dist", "stimulus_reflex": "3.5.0-rc3", "tom-select": "^2.3.1", - "trix": "^2.0.10", + "trix": "^2.1.0", "webpack": "~4" }, "devDependencies": { diff --git a/script/haml-up.rb b/script/haml-up.rb new file mode 100755 index 0000000000..033e09f348 --- /dev/null +++ b/script/haml-up.rb @@ -0,0 +1,22 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# Upgrade HAML attribute syntax to prepare for HAML 6. +# +# HAML 6 stopped supporting nested hash attributes other than `data` and `aria`. +# We used to be able to write: +# +# %div{ ng: { class: "upper", bind: "model" } } +# +# This needs to be written in a flat structure now: +# +# %div{ "ng-class" => "upper", "ng-bind" => "model" } +# +# This script rewrites HAML files automatically. It may be used like: +# +# git ls-files '*.haml' | while read f; do ./haml-up.rb "$f"; done +# +require "haml_up" + +puts ARGV[0] +HamlUp.new.upgrade_file(ARGV[0]) diff --git a/script/rubocop-diff.sh b/script/rubocop-diff.sh new file mode 100755 index 0000000000..32dbef1ca8 --- /dev/null +++ b/script/rubocop-diff.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +# While you are developing, you can call this script to check all +# changed files. And then you can also tell Git to check before every +# commit by adding this line to your `.git/hooks/pre-commit` file: +# +# ./script/rubocop-diff.sh --cached || exit 1 +# + +rubocop="`dirname $0`/../bin/rubocop" +cached="$1" # may be empty + +if git diff $cached --diff-filter=ACMR HEAD --quiet; then + # nothing changed + exit 0 +fi + +exec git diff $cached --name-only --relative --diff-filter=ACMR HEAD |\ + xargs \ + $rubocop --force-exclusion \ + --fail-level A \ + --format simple \ + --parallel --cache true diff --git a/script/setup b/script/setup index d8f03ae63b..b016f5d5b0 100755 --- a/script/setup +++ b/script/setup @@ -21,9 +21,13 @@ NO_COLOR='\033[0m' RUBY_VERSION=$(cat .ruby-version) if command -v rbenv > /dev/null; then ./script/rbenv-install.sh -elif ! ruby --version | grep $RUBY_VERSION > /dev/null; then +elif command -v rvm > /dev/null; then + rvm install $RUBY_VERSION +fi + +if ! ruby --version | grep $RUBY_VERSION > /dev/null; then printf "${RED}Open Food Network requires ruby ${RUBY_VERSION}${NO_COLOR}. " - printf "Have a look at: https://github.com/rbenv/rbenv\n" + printf "Have a look at your ruby version manager: https://github.com/rbenv/rbenv\n or https://rvm.io/" exit 1 fi diff --git a/spec/base_spec_helper.rb b/spec/base_spec_helper.rb index c875249ab7..1238281f00 100644 --- a/spec/base_spec_helper.rb +++ b/spec/base_spec_helper.rb @@ -96,6 +96,11 @@ RSpec.configure do |config| expectations.syntax = :expect end + # Reset locale for all specs. + config.around(:each) do |example| + I18n.with_locale(:en) { example.run } + end + # Reset all feature toggles to prevent leaking. config.before(:suite) do Flipper.features.each(&:remove) @@ -194,6 +199,7 @@ RSpec.configure do |config| spree_config.currency = currency spree_config.shipping_instructions = true end + CurrentConfig.clear_all end # Don't validate our invalid test data with expensive network requests. diff --git a/spec/controllers/admin/bulk_line_items_controller_spec.rb b/spec/controllers/admin/bulk_line_items_controller_spec.rb index 9fab630c8e..15e540c97b 100644 --- a/spec/controllers/admin/bulk_line_items_controller_spec.rb +++ b/spec/controllers/admin/bulk_line_items_controller_spec.rb @@ -390,7 +390,7 @@ describe Admin::BulkLineItemsController, type: :controller do order.shipments.map(&:refresh_rates) order.select_shipping_method(shipping_method.id) - OrderWorkflow.new(order).advance_to_payment + Orders::WorkflowService.new(order).advance_to_payment order.finalize! order.recreate_all_fees! order.create_tax_charge! diff --git a/spec/controllers/admin/customers_controller_spec.rb b/spec/controllers/admin/customers_controller_spec.rb index 1ef7e91e3e..f7397e58ab 100644 --- a/spec/controllers/admin/customers_controller_spec.rb +++ b/spec/controllers/admin/customers_controller_spec.rb @@ -44,12 +44,12 @@ module Admin get :index, params: end - it 'calls CustomersWithBalance' do - customers_with_balance = instance_double(CustomersWithBalance) - allow(CustomersWithBalance) + it 'calls CustomersWithBalanceQuery' do + customers_with_balance = instance_double(CustomersWithBalanceQuery) + allow(CustomersWithBalanceQuery) .to receive(:new).with(customers) { customers_with_balance } - expect(customers_with_balance).to receive(:query) { Customer.none } + expect(customers_with_balance).to receive(:call) { Customer.none } get :index, params: end @@ -182,7 +182,7 @@ module Admin customer: { email: 'new.email@gmail.com' } expect(response).to redirect_to unauthorized_path expect(assigns(:customer)).to eq nil - expect(customer.email).to_not eq 'new.email@gmail.com' + expect(customer.email).not_to eq 'new.email@gmail.com' end end end diff --git a/spec/controllers/admin/enterprises_controller_spec.rb b/spec/controllers/admin/enterprises_controller_spec.rb index d2045aa9f1..9c033da706 100644 --- a/spec/controllers/admin/enterprises_controller_spec.rb +++ b/spec/controllers/admin/enterprises_controller_spec.rb @@ -168,7 +168,7 @@ describe Admin::EnterprisesController, type: :controller do spree_post :update, update_params distributor.reload - expect(distributor.users).to_not include user + expect(distributor.users).not_to include user end it "updates the contact for notifications" do @@ -190,7 +190,7 @@ describe Admin::EnterprisesController, type: :controller do } expect { spree_post :update, params }. - to_not change { distributor.contact } + not_to change { distributor.contact } end it "updates enterprise preferences" do @@ -223,7 +223,7 @@ describe Admin::EnterprisesController, type: :controller do expect(Spree::Property.count).to be 1 expect(ProducerProperty.count).to be 0 property_names = producer.reload.properties.map(&:name) - expect(property_names).to_not include 'a different name' + expect(property_names).not_to include 'a different name' end end @@ -721,7 +721,7 @@ describe Admin::EnterprisesController, type: :controller do it "scopes @collection to enterprises editable by the user" do get :index, format: :json expect(assigns(:collection)).to include enterprise1, enterprise2 - expect(assigns(:collection)).to_not include enterprise3 + expect(assigns(:collection)).not_to include enterprise3 end end end diff --git a/spec/controllers/admin/order_cycles_controller_spec.rb b/spec/controllers/admin/order_cycles_controller_spec.rb index 085992f2d8..fd154b7118 100644 --- a/spec/controllers/admin/order_cycles_controller_spec.rb +++ b/spec/controllers/admin/order_cycles_controller_spec.rb @@ -37,7 +37,7 @@ module Admin context "where ransack conditions are specified" do it "loads order cycles closed within past month, and orders w/o a close_at date" do get :index, as: :json - expect(assigns(:collection)).to_not include oc1, oc2 + expect(assigns(:collection)).not_to include oc1, oc2 expect(assigns(:collection)).to include oc3, oc4 end end @@ -47,7 +47,7 @@ module Admin it "loads order cycles closed after specified date, and orders w/o a close_at date" do get :index, as: :json, params: { q: } - expect(assigns(:collection)).to_not include oc1 + expect(assigns(:collection)).not_to include oc1 expect(assigns(:collection)).to include oc2, oc3, oc4 end @@ -56,7 +56,7 @@ module Admin it "loads order cycles that meet all conditions" do get :index, format: :json, params: { q: } - expect(assigns(:collection)).to_not include oc1, oc2, oc4 + expect(assigns(:collection)).not_to include oc1, oc2, oc4 expect(assigns(:collection)).to include oc3 end end @@ -132,9 +132,9 @@ module Admin end it do - query_counter = QueryCounter.new - get :show, params: { id: order_cycle.id }, as: :json - expect(query_counter.queries).to eq( + expect { + get :show, params: { id: order_cycle.id }, as: :json + }.to query_database( { select: { enterprise_fees: 3, @@ -151,7 +151,6 @@ module Admin update: { spree_users: 1 } } ) - query_counter.stop end end end @@ -161,12 +160,12 @@ module Admin let(:shop) { create(:distributor_enterprise) } context "as a manager of a shop" do - let(:form_mock) { instance_double(OrderCycleForm) } + let(:form_mock) { instance_double(OrderCycles::FormService) } let(:params) { { as: :json, order_cycle: {} } } before do controller_login_as_enterprise_user([shop]) - allow(OrderCycleForm).to receive(:new) { form_mock } + allow(OrderCycles::FormService).to receive(:new) { form_mock } end context "when creation is successful" do @@ -204,10 +203,10 @@ module Admin describe "update" do let(:order_cycle) { create(:simple_order_cycle) } let(:coordinator) { order_cycle.coordinator } - let(:form_mock) { instance_double(OrderCycleForm) } + let(:form_mock) { instance_double(OrderCycles::FormService) } before do - allow(OrderCycleForm).to receive(:new) { form_mock } + allow(OrderCycles::FormService).to receive(:new) { form_mock } end context "as a manager of the coordinator" do @@ -276,7 +275,7 @@ module Admin end it "can update preference product_selection_from_coordinator_inventory_only" do - expect(OrderCycleForm).to receive(:new). + expect(OrderCycles::FormService).to receive(:new). with(order_cycle, { "preferred_product_selection_from_coordinator_inventory_only" => true }, anything) { form_mock } @@ -289,7 +288,7 @@ module Admin end it "can update preference automatic_notifications" do - expect(OrderCycleForm).to receive(:new). + expect(OrderCycles::FormService).to receive(:new). with(order_cycle, { "automatic_notifications" => true }, anything) { form_mock } @@ -325,7 +324,7 @@ module Admin format: :json, id: order_cycle.id, order_cycle: allowed.merge(restricted) } } - let(:form_mock) { instance_double(OrderCycleForm, save: true) } + let(:form_mock) { instance_double(OrderCycles::FormService, save: true) } before { allow(controller).to receive(:spree_current_user) { user } } @@ -334,7 +333,7 @@ module Admin let(:expected) { [order_cycle, allowed.merge(restricted), user] } it "allows me to update exchange information for exchanges, name and dates" do - expect(OrderCycleForm).to receive(:new).with(*expected) { form_mock } + expect(OrderCycles::FormService).to receive(:new).with(*expected) { form_mock } spree_put :update, params end end @@ -344,7 +343,7 @@ module Admin let(:expected) { [order_cycle, allowed, user] } it "allows me to update exchange information for exchanges, but not name or dates" do - expect(OrderCycleForm).to receive(:new).with(*expected) { form_mock } + expect(OrderCycles::FormService).to receive(:new).with(*expected) { form_mock } spree_put :update, params end end @@ -416,9 +415,9 @@ module Admin } } } oc.reload - expect(oc.name).to_not eq "Updated Order Cycle" - expect(oc.orders_open_at.to_date).to_not eq Date.current - 21.days - expect(oc.orders_close_at.to_date).to_not eq Date.current + 21.days + expect(oc.name).not_to eq "Updated Order Cycle" + expect(oc.orders_open_at.to_date).not_to eq Date.current - 21.days + expect(oc.orders_close_at.to_date).not_to eq Date.current + 21.days end end end @@ -506,8 +505,8 @@ module Admin get :destroy, params: { id: cloned.id } expect(OrderCycle.find_by(id: cloned.id)).to be nil - expect(OrderCycle.find_by(id: oc.id)).to_not be nil - expect(EnterpriseFee.find_by(id: enterprise_fee1.id)).to_not be nil + expect(OrderCycle.find_by(id: oc.id)).not_to be nil + expect(EnterpriseFee.find_by(id: enterprise_fee1.id)).not_to be nil expect(response).to redirect_to admin_order_cycles_path end end diff --git a/spec/controllers/admin/proxy_orders_controller_spec.rb b/spec/controllers/admin/proxy_orders_controller_spec.rb index a19f94a14a..6e505530b6 100644 --- a/spec/controllers/admin/proxy_orders_controller_spec.rb +++ b/spec/controllers/admin/proxy_orders_controller_spec.rb @@ -83,7 +83,7 @@ describe Admin::ProxyOrdersController, type: :controller do before do # Processing order to completion allow(Spree::OrderMailer).to receive(:cancel_email) { double(:email, deliver_later: true) } - OrderWorkflow.new(order).complete! + Orders::WorkflowService.new(order).complete! proxy_order.reload proxy_order.cancel allow(controller).to receive(:spree_current_user) { user } diff --git a/spec/controllers/admin/reports_controller_spec.rb b/spec/controllers/admin/reports_controller_spec.rb index 32a44c1b88..318682a8e8 100644 --- a/spec/controllers/admin/reports_controller_spec.rb +++ b/spec/controllers/admin/reports_controller_spec.rb @@ -162,7 +162,7 @@ describe Admin::ReportsController, type: :controller do report_types = assigns(:reports).keys expect(report_types).to include :orders_and_fulfillment, :products_and_inventory, :packing # and others - expect(report_types).to_not include :sales_tax + expect(report_types).not_to include :sales_tax end end @@ -365,7 +365,7 @@ describe Admin::ReportsController, type: :controller do spree_get :show, report_type: :sales_tax, report_subtype: report_type expect(response).to have_http_status(:ok) expect(resulting_orders_prelim).to include(orderA1, orderB1) - expect(resulting_orders_prelim).to_not include(orderA2, orderB2) + expect(resulting_orders_prelim).not_to include(orderA2, orderB2) end end end diff --git a/spec/controllers/admin/schedules_controller_spec.rb b/spec/controllers/admin/schedules_controller_spec.rb index 4bf805c2f6..38b1f12e35 100644 --- a/spec/controllers/admin/schedules_controller_spec.rb +++ b/spec/controllers/admin/schedules_controller_spec.rb @@ -115,7 +115,7 @@ describe Admin::SchedulesController, type: :controller do uncoordinated_order_cycle, uncoordinated_order_cycle3 # coordinated_order_cycle is removed, uncoordinated_order_cycle2 is NOT added - expect(coordinated_schedule.reload.order_cycles).to_not include coordinated_order_cycle, + expect(coordinated_schedule.reload.order_cycles).not_to include coordinated_order_cycle, uncoordinated_order_cycle2 end @@ -145,7 +145,7 @@ describe Admin::SchedulesController, type: :controller do schedule: { name: "my awesome schedule" } expect(response).to redirect_to unauthorized_path expect(assigns(:schedule)).to eq nil - expect(coordinated_schedule.name).to_not eq "my awesome schedule" + expect(coordinated_schedule.name).not_to eq "my awesome schedule" end end end @@ -173,7 +173,7 @@ describe Admin::SchedulesController, type: :controller do context "where no order cycles ids are provided" do it "does not allow me to create the schedule" do - expect { create_schedule params }.to_not change { Schedule.count } + expect { create_schedule params }.not_to change { Schedule.count } end end @@ -187,7 +187,7 @@ describe Admin::SchedulesController, type: :controller do expect { create_schedule params }.to change { Schedule.count }.by(1) schedule = Schedule.last expect(schedule.order_cycles).to include coordinated_order_cycle - expect(schedule.order_cycles).to_not include uncoordinated_order_cycle + expect(schedule.order_cycles).not_to include uncoordinated_order_cycle end it "sync proxy orders" do @@ -205,7 +205,7 @@ describe Admin::SchedulesController, type: :controller do end it "prevents me from creating the schedule" do - expect { create_schedule params }.to_not change { Schedule.count } + expect { create_schedule params }.not_to change { Schedule.count } end end end @@ -257,7 +257,7 @@ describe Admin::SchedulesController, type: :controller do let!(:subscription) { create(:subscription, schedule: coordinated_schedule) } it "returns an error message and prevents me from deleting the schedule" do - expect { spree_delete :destroy, params }.to_not change { Schedule.count } + expect { spree_delete :destroy, params }.not_to change { Schedule.count } json_response = JSON.parse(response.body) expect(json_response["errors"]) .to include 'This schedule cannot be deleted ' \ @@ -270,7 +270,7 @@ describe Admin::SchedulesController, type: :controller do before { params.merge!(id: uncoordinated_schedule.id) } it "prevents me from destroying the schedule" do - expect { spree_delete :destroy, params }.to_not change { Schedule.count } + expect { spree_delete :destroy, params }.not_to change { Schedule.count } end end end diff --git a/spec/controllers/admin/stripe_accounts_controller_spec.rb b/spec/controllers/admin/stripe_accounts_controller_spec.rb index b5b0683c73..a1b5df8d69 100644 --- a/spec/controllers/admin/stripe_accounts_controller_spec.rb +++ b/spec/controllers/admin/stripe_accounts_controller_spec.rb @@ -5,12 +5,11 @@ require 'spec_helper' describe Admin::StripeAccountsController, type: :controller do let(:enterprise) { create(:distributor_enterprise) } - before do - Stripe.client_id = "some_id" - end - describe "#connect" do + let(:client_id) { ENV.fetch('STRIPE_CLIENT_ID', nil) } + before do + Stripe.client_id = client_id allow(controller).to receive(:spree_current_user) { enterprise.owner } end @@ -21,12 +20,12 @@ describe Admin::StripeAccountsController, type: :controller do expect(response).to redirect_to("https://connect.stripe.com/oauth/authorize?" \ "state=eyJhbGciOiJIUzI1NiJ9.eyJlbnRlcnByaXNlX2lkIjoiMSJ9" \ ".jSSFGn0bLhwuiQYK5ORmHWW7aay1l030bcfGwn1JbFg&" \ - "scope=read_write&client_id=some_id&response_type=code") + "scope=read_write&client_id=#{client_id}&response_type=code") end end describe "#destroy" do - let(:params) { { format: :json, id: "some_id" } } + let(:params) { { format: :json, id: "client_id" } } context "when the specified stripe account doesn't exist" do it "raises an error?" do @@ -34,8 +33,18 @@ describe Admin::StripeAccountsController, type: :controller do end end - context "when the specified stripe account exists" do - let(:stripe_account) { create(:stripe_account, enterprise:) } + context "when the specified stripe account exists", :vcr, :stripe_version do + let(:connected_account) do + Stripe::Account.create({ + type: 'standard', + country: 'AU', + email: 'jumping.jack@example.com', + business_type: "non_profit" + }) + end + let(:stripe_account) { + create(:stripe_account, enterprise:, stripe_user_id: connected_account.id) + } before do # So that we can stub #deauthorize_and_destroy @@ -43,6 +52,10 @@ describe Admin::StripeAccountsController, type: :controller do params[:id] = stripe_account.id end + after do + Stripe::Account.delete(connected_account.id) + end + context "when I don't manage the enterprise linked to the stripe account" do let(:some_user) { create(:user) } @@ -83,11 +96,6 @@ describe Admin::StripeAccountsController, type: :controller do describe "#status" do let(:params) { { format: :json, enterprise_id: enterprise.id } } - before do - Stripe.api_key = "sk_test_12345" - allow(Spree::Config).to receive(:stripe_connect_enabled).and_return(false) - end - context "when I don't manage the specified enterprise" do let(:user) { create(:user) } @@ -125,45 +133,48 @@ describe Admin::StripeAccountsController, type: :controller do end end - context "when a stripe account is associated with the specified enterprise" do + context "when a stripe account is associated with the specified enterprise", :vcr, + :stripe_version do + let(:connected_account) do + Stripe::Account.create({ + type: 'standard', + country: 'AU', + email: 'jumping.jack@example.com', + business_type: "non_profit" + }) + end let!(:account) { - create(:stripe_account, stripe_user_id: "acc_123", enterprise:) + create(:stripe_account, stripe_user_id: connected_account.id, enterprise:) } + after do + Stripe::Account.delete(connected_account.id) + end + context "but access has been revoked or does not exist on stripe's servers" do + let(:message) { + "The provided key 'sk_test_******************************uCJm' " \ + "does not have access to account 'acct_fake_account' (or that account " \ + "does not exist). Application access may have been revoked." + } before do - stub_request(:get, - "https://api.stripe.com/v1/accounts/acc_123").to_return(status: 404) + account.update(stripe_user_id: "acct_fake_account") end it "returns with a status of 'access_revoked'" do - get(:status, params:) - json_response = JSON.parse(response.body) - expect(json_response["status"]).to eq "access_revoked" + expect { + response = get(:status, params:) + }.to raise_error Stripe::PermissionError, message end end context "which is connected" do - let(:stripe_account_mock) do - { - id: "acc_123", - business_name: "My Org", - charges_enabled: true, - some_other_attr: "something" - } - end - - before do - stub_request(:get, "https://api.stripe.com/v1/accounts/acc_123") - .to_return(body: JSON.generate(stripe_account_mock)) - end - it "returns with a status of 'connected'" do - get(:status, params:) + response = get(:status, params:) json_response = JSON.parse(response.body) expect(json_response["status"]).to eq "connected" # serializes required attrs - expect(json_response["business_name"]).to eq "My Org" + expect(json_response["charges_enabled"]).to eq false # ignores other attrs expect(json_response["some_other_attr"]).to be nil end diff --git a/spec/controllers/admin/subscriptions_controller_spec.rb b/spec/controllers/admin/subscriptions_controller_spec.rb index 5f807d5110..c00d8ae113 100644 --- a/spec/controllers/admin/subscriptions_controller_spec.rb +++ b/spec/controllers/admin/subscriptions_controller_spec.rb @@ -81,7 +81,7 @@ describe Admin::SubscriptionsController, type: :controller do expect(json_response.count).to be 1 ids = json_response.map{ |so| so['id'] } expect(ids).to include subscription2.id - expect(ids).to_not include subscription.id + expect(ids).not_to include subscription.id end end end @@ -134,7 +134,7 @@ describe Admin::SubscriptionsController, type: :controller do context 'when I submit insufficient params' do it 'returns errors' do - expect{ spree_post :create, params }.to_not change{ Subscription.count } + expect{ spree_post :create, params }.not_to change{ Subscription.count } json_response = JSON.parse(response.body) expect(json_response['errors'].keys).to include 'schedule', 'customer', 'payment_method', 'shipping_method', 'begins_at' @@ -168,7 +168,7 @@ describe Admin::SubscriptionsController, type: :controller do end it 'returns errors' do - expect{ spree_post :create, params }.to_not change{ Subscription.count } + expect{ spree_post :create, params }.not_to change{ Subscription.count } json_response = JSON.parse(response.body) expect(json_response['errors'].keys).to include 'schedule', 'customer', 'payment_method', 'shipping_method', 'ends_at' @@ -197,7 +197,7 @@ describe Admin::SubscriptionsController, type: :controller do context 'where the specified variants are not available from the shop' do it 'returns an error' do - expect{ spree_post :create, params }.to_not change{ Subscription.count } + expect{ spree_post :create, params }.not_to change{ Subscription.count } json_response = JSON.parse(response.body) expect(json_response['errors']['subscription_line_items']) .to eq ["#{variant.product.name} - #{variant.full_name} " \ @@ -343,7 +343,7 @@ describe Admin::SubscriptionsController, type: :controller do end it 'returns errors' do - expect{ spree_post :update, params }.to_not change{ Subscription.count } + expect{ spree_post :update, params }.not_to change{ Subscription.count } json_response = JSON.parse(response.body) expect(json_response['errors'].keys).to include 'payment_method', 'shipping_method' subscription.reload @@ -387,7 +387,7 @@ describe Admin::SubscriptionsController, type: :controller do context 'where the specified variants are not available from the shop' do it 'returns an error' do expect{ spree_post :update, params } - .to_not change{ subscription.subscription_line_items.count } + .not_to change{ subscription.subscription_line_items.count } json_response = JSON.parse(response.body) expect(json_response['errors']['subscription_line_items']) .to eq ["#{product2.name} - #{variant2.full_name} " \ @@ -478,7 +478,7 @@ describe Admin::SubscriptionsController, type: :controller do it 'renders the cancelled subscription as json, and does not cancel the open order' do spree_put :cancel, params json_response = JSON.parse(response.body) - expect(json_response['canceled_at']).to_not be nil + expect(json_response['canceled_at']).not_to be nil expect(json_response['id']).to eq subscription.id expect(subscription.reload.canceled_at).to be_within(5.seconds).of Time.zone.now expect(order.reload.state).to eq 'complete' @@ -498,7 +498,7 @@ describe Admin::SubscriptionsController, type: :controller do it 'renders the cancelled subscription as json, and cancels the open order' do spree_put :cancel, params json_response = JSON.parse(response.body) - expect(json_response['canceled_at']).to_not be nil + expect(json_response['canceled_at']).not_to be nil expect(json_response['id']).to eq subscription.id expect(subscription.reload.canceled_at).to be_within(5.seconds).of Time.zone.now expect(order.reload.state).to eq 'canceled' @@ -512,7 +512,7 @@ describe Admin::SubscriptionsController, type: :controller do it 'renders the cancelled subscription as json' do spree_put :cancel, params json_response = JSON.parse(response.body) - expect(json_response['canceled_at']).to_not be nil + expect(json_response['canceled_at']).not_to be nil expect(json_response['id']).to eq subscription.id expect(subscription.reload.canceled_at).to be_within(5.seconds).of Time.zone.now end @@ -582,7 +582,7 @@ describe Admin::SubscriptionsController, type: :controller do it 'renders the paused subscription as json, and does not cancel the open order' do spree_put :pause, params json_response = JSON.parse(response.body) - expect(json_response['paused_at']).to_not be nil + expect(json_response['paused_at']).not_to be nil expect(json_response['id']).to eq subscription.id expect(subscription.reload.paused_at).to be_within(5.seconds).of Time.zone.now expect(order.reload.state).to eq 'complete' @@ -602,7 +602,7 @@ describe Admin::SubscriptionsController, type: :controller do it 'renders the paused subscription as json, and cancels the open order' do spree_put :pause, params json_response = JSON.parse(response.body) - expect(json_response['paused_at']).to_not be nil + expect(json_response['paused_at']).not_to be nil expect(json_response['id']).to eq subscription.id expect(subscription.reload.paused_at).to be_within(5.seconds).of Time.zone.now expect(order.reload.state).to eq 'canceled' @@ -616,7 +616,7 @@ describe Admin::SubscriptionsController, type: :controller do it 'renders the paused subscription as json' do spree_put :pause, params json_response = JSON.parse(response.body) - expect(json_response['paused_at']).to_not be nil + expect(json_response['paused_at']).not_to be nil expect(json_response['id']).to eq subscription.id expect(subscription.reload.paused_at).to be_within(5.seconds).of Time.zone.now end @@ -708,7 +708,7 @@ describe Admin::SubscriptionsController, type: :controller do expect(json_response['id']).to eq subscription.id expect(subscription.reload.paused_at).to be nil expect(order.reload.state).to eq 'canceled' - expect(proxy_order.reload.canceled_at).to_not be nil + expect(proxy_order.reload.canceled_at).not_to be nil end end end @@ -771,7 +771,7 @@ describe Admin::SubscriptionsController, type: :controller do it "only loads Stripe and Cash payment methods" do controller.send(:load_form_data) expect(assigns(:payment_methods)).to include payment_method, stripe - expect(assigns(:payment_methods)).to_not include paypal + expect(assigns(:payment_methods)).not_to include paypal end end end diff --git a/spec/controllers/admin/terms_of_service_files_controller_spec.rb b/spec/controllers/admin/terms_of_service_files_controller_spec.rb index 2a81cc898b..de6b0ba174 100644 --- a/spec/controllers/admin/terms_of_service_files_controller_spec.rb +++ b/spec/controllers/admin/terms_of_service_files_controller_spec.rb @@ -12,12 +12,12 @@ describe Admin::TermsOfServiceFilesController, type: :controller do it "does not allow deletion" do post :destroy - expect(TermsOfServiceFile).to_not receive(:current) + expect(TermsOfServiceFile).not_to receive(:current) end it "does not allow creation" do post :create - expect(TermsOfServiceFile).to_not receive(:create!) + expect(TermsOfServiceFile).not_to receive(:create!) end end diff --git a/spec/controllers/admin/variant_overrides_controller_spec.rb b/spec/controllers/admin/variant_overrides_controller_spec.rb index f6040d8ba7..4224452fb1 100644 --- a/spec/controllers/admin/variant_overrides_controller_spec.rb +++ b/spec/controllers/admin/variant_overrides_controller_spec.rb @@ -97,7 +97,7 @@ describe Admin::VariantOverridesController, type: :controller do it "allows to update other variant overrides" do put :bulk_update, as: format, params: { variant_overrides: variant_override_params } - expect(response).to_not redirect_to unauthorized_path + expect(response).not_to redirect_to unauthorized_path variant_override.reload expect(variant_override.price).to eq 123.45 end @@ -193,7 +193,7 @@ describe Admin::VariantOverridesController, type: :controller do it "does not reset count_on_hand for variant_overrides not in params" do expect { put :bulk_reset, params: - }.to_not change{ variant_override3.reload.count_on_hand } + }.not_to change{ variant_override3.reload.count_on_hand } end end end diff --git a/spec/controllers/api/v0/logos_controller_spec.rb b/spec/controllers/api/v0/logos_controller_spec.rb index b1bb65b187..3d8c800ba0 100644 --- a/spec/controllers/api/v0/logos_controller_spec.rb +++ b/spec/controllers/api/v0/logos_controller_spec.rb @@ -35,7 +35,7 @@ module Api expect(response.status).to eq 200 expect(json_response["id"]).to eq enterprise.id enterprise.reload - expect(enterprise.logo).to_not be_attached + expect(enterprise.logo).not_to be_attached end context "when logo does not exist" do diff --git a/spec/controllers/api/v0/order_cycles_controller_spec.rb b/spec/controllers/api/v0/order_cycles_controller_spec.rb index dfc6010ec1..a8640fa581 100644 --- a/spec/controllers/api/v0/order_cycles_controller_spec.rb +++ b/spec/controllers/api/v0/order_cycles_controller_spec.rb @@ -57,7 +57,7 @@ module Api q: { ransack_param => "Kangaroo" } expect(product_ids).to include product1.id - expect(product_ids).to_not include product2.id + expect(product_ids).not_to include product2.id end context "with variant overrides" do @@ -84,7 +84,7 @@ module Api it "does not return products where the variant overrides are out of stock" do api_get :products, id: order_cycle.id, distributor: distributor.id - expect(product_ids).to_not include product2.id + expect(product_ids).not_to include product2.id end end @@ -99,7 +99,7 @@ module Api expect(response.status).to eq 200 expect(product_ids).to eq [product1.id, product2.id] - expect(product_ids).to_not include product3.id + expect(product_ids).not_to include product3.id end context "with supplier properties" do @@ -118,7 +118,7 @@ module Api expect(response.status).to eq 200 expect(product_ids).to match_array [product1.id, product2.id] - expect(product_ids).to_not include product3.id + expect(product_ids).not_to include product3.id end end end @@ -126,10 +126,10 @@ module Api context "with taxon filters" do it "filters by taxon" do api_get :products, id: order_cycle.id, distributor: distributor.id, - q: { primary_taxon_id_in_any: [taxon2.id] } + q: { variants_primary_taxon_id_in_any: [taxon2.id] } expect(product_ids).to include product2.id, product3.id - expect(product_ids).to_not include product1.id, product4.id + expect(product_ids).not_to include product1.id, product4.id end end @@ -176,7 +176,7 @@ module Api api_get :products, id: order_cycle.id, distributor: distributor.id - expect(product_ids).to_not include product1.id + expect(product_ids).not_to include product1.id end it "does not return variants hidden for this specific customer" do @@ -185,7 +185,7 @@ module Api api_get :products, id: order_cycle.id, distributor: distributor.id - expect(product_ids).to_not include product2.id + expect(product_ids).not_to include product2.id end it "returns hidden variants made visible for this specific customer" do @@ -197,7 +197,7 @@ module Api api_get :products, id: order_cycle.id, distributor: distributor.id - expect(product_ids).to_not include product1.id + expect(product_ids).not_to include product1.id expect(product_ids).to include product3.id end end diff --git a/spec/controllers/api/v0/products_controller_spec.rb b/spec/controllers/api/v0/products_controller_spec.rb index af6dbfe032..4abba9f3bd 100644 --- a/spec/controllers/api/v0/products_controller_spec.rb +++ b/spec/controllers/api/v0/products_controller_spec.rb @@ -25,6 +25,7 @@ describe Api::V0::ProductsController, type: :controller do end context "as a normal user" do + let(:taxon) { create(:taxon) } let(:attachment) { fixture_file_upload("thinking-cat.jpg") } before do @@ -34,9 +35,11 @@ describe Api::V0::ProductsController, type: :controller do it "gets a single product" do product.create_image!(attachment:) - product.variants.create!(unit_value: "1", unit_description: "thing", price: 1) + product.variants.create!(unit_value: "1", unit_description: "thing", price: 1, + primary_taxon: taxon) product.variants.first.images.create!(attachment:) product.set_property("spree", "rocks") + api_get :show, id: product.to_param expect(all_attributes.all?{ |attr| json_response.keys.include? attr }).to eq(true) @@ -117,8 +120,7 @@ describe Api::V0::ProductsController, type: :controller do expect(response.status).to eq(422) expect(json_response["error"]).to eq("Invalid resource. Please fix errors and try again.") errors = json_response["errors"] - expect(errors.keys).to match_array(["name", "primary_taxon", "supplier", "variant_unit", - "price"]) + expect(errors.keys).to match_array(["name", "supplier", "variant_unit", "price"]) end it "can update a product" do @@ -266,7 +268,8 @@ describe Api::V0::ProductsController, type: :controller do end it "filters results by product category" do - api_get :bulk_products, { page: 1, per_page: 15, q: { primary_taxon_id_eq: taxon.id } }, + api_get :bulk_products, + { page: 1, per_page: 15, q: { variants_primary_taxon_id_eq: taxon.id } }, format: :json expect(returned_product_ids).to eq [product3.id, product2.id] end diff --git a/spec/controllers/api/v0/promo_images_controller_spec.rb b/spec/controllers/api/v0/promo_images_controller_spec.rb index 92fdce4940..76e7288ae1 100644 --- a/spec/controllers/api/v0/promo_images_controller_spec.rb +++ b/spec/controllers/api/v0/promo_images_controller_spec.rb @@ -35,7 +35,7 @@ module Api expect(response.status).to eq 200 expect(json_response["id"]).to eq enterprise.id enterprise.reload - expect(enterprise.promo_image).to_not be_attached + expect(enterprise.promo_image).not_to be_attached end context "when promo image does not exist" do diff --git a/spec/controllers/api/v0/reports/packing_report_spec.rb b/spec/controllers/api/v0/reports/packing_report_spec.rb index 4cee3984f4..a88a26c7d0 100644 --- a/spec/controllers/api/v0/reports/packing_report_spec.rb +++ b/spec/controllers/api/v0/reports/packing_report_spec.rb @@ -53,13 +53,9 @@ describe Api::V0::ReportsController, type: :controller do private def report_output(order, user_type) - results = [] - - order.line_items.each do |line_item| - results << __send__("#{user_type}_report_row", line_item) + results = order.line_items.map do |line_item| + __send__("#{user_type}_report_row", line_item) end - - results end def distributor_report_row(line_item) diff --git a/spec/controllers/api/v0/shipments_controller_spec.rb b/spec/controllers/api/v0/shipments_controller_spec.rb index 9ade418913..add3d0c3ba 100644 --- a/spec/controllers/api/v0/shipments_controller_spec.rb +++ b/spec/controllers/api/v0/shipments_controller_spec.rb @@ -194,14 +194,14 @@ describe Api::V0::ShipmentsController, type: :controller do expect { api_put :add, params.merge(variant_id: existing_variant.to_param) expect(response.status).to eq(422) - }.to_not change { existing_variant.reload.on_hand } + }.not_to change { existing_variant.reload.on_hand } end it "doesn't adjust stock when removing a variant" do expect { api_put :remove, params.merge(variant_id: existing_variant.to_param) expect(response.status).to eq(422) - }.to_not change { existing_variant.reload.on_hand } + }.not_to change { existing_variant.reload.on_hand } end end @@ -367,13 +367,17 @@ describe Api::V0::ShipmentsController, type: :controller do instance_double(Spree::Order, number: "123", distributor: variant.product.supplier) } let(:contents) { instance_double(Spree::OrderContents) } + let(:fee_order_shipment) { + instance_double(Spree::Shipment) + } before do allow(Spree::Order).to receive(:find_by!) { fee_order } - allow(controller).to receive(:find_and_update_shipment) {} allow(controller).to receive(:refuse_changing_cancelled_orders) {} allow(fee_order).to receive(:contents) { contents } - allow(contents).to receive(:add) {} + allow(contents).to receive_messages(add: {}, remove: {}) + allow(fee_order).to receive_message_chain(:shipments, :find_by!) { fee_order_shipment } + allow(fee_order_shipment).to receive_messages(update: nil, reload: nil, persisted?: nil) allow(fee_order).to receive(:recreate_all_fees!) end @@ -382,6 +386,12 @@ describe Api::V0::ShipmentsController, type: :controller do spree_put :add, params expect(fee_order).to have_received(:recreate_all_fees!) end + + it "recalculates fees for the line item when qty is decreased" do + params[:order_id] = fee_order.number + spree_put :remove, params + expect(fee_order).to have_received(:recreate_all_fees!) + end end end diff --git a/spec/controllers/api/v0/terms_and_conditions_controller_spec.rb b/spec/controllers/api/v0/terms_and_conditions_controller_spec.rb index d5e7f511f8..53596f7fd3 100644 --- a/spec/controllers/api/v0/terms_and_conditions_controller_spec.rb +++ b/spec/controllers/api/v0/terms_and_conditions_controller_spec.rb @@ -29,7 +29,7 @@ module Api expect(response.status).to eq 200 expect(json_response["id"]).to eq enterprise.id enterprise.reload - expect(enterprise.terms_and_conditions).to_not be_attached + expect(enterprise.terms_and_conditions).not_to be_attached end context "when terms and conditions file does not exist" do diff --git a/spec/controllers/api/v0/variants_controller_spec.rb b/spec/controllers/api/v0/variants_controller_spec.rb index f67fefd7f0..1a90dd704a 100644 --- a/spec/controllers/api/v0/variants_controller_spec.rb +++ b/spec/controllers/api/v0/variants_controller_spec.rb @@ -127,6 +127,7 @@ describe Api::V0::VariantsController, type: :controller do let(:product) { create(:product) } let(:variant) { product.variants.first } + let(:taxon) { create(:taxon) } let!(:variant2) { create(:variant, product:) } context "deleted variants" do @@ -144,7 +145,7 @@ describe Api::V0::VariantsController, type: :controller do it "can create a new variant" do original_number_of_variants = variant.product.variants.count api_post :create, variant: { sku: "12345", unit_value: "1", - unit_description: "L", price: "1" }, + unit_description: "L", price: "1", primary_taxon_id: taxon.id }, product_id: variant.product.id expect(attributes.all?{ |attr| json_response.include? attr.to_s }).to eq(true) @@ -172,7 +173,7 @@ describe Api::V0::VariantsController, type: :controller do variant = product.variants.first spree_delete :destroy, id: variant.to_param - expect(variant.reload).to_not be_deleted + expect(variant.reload).not_to be_deleted expect(assigns(:variant).errors[:product]).to include "must have at least one variant" end end diff --git a/spec/controllers/base_controller_spec.rb b/spec/controllers/base_controller_spec.rb index 17725eb773..5158dd1c3c 100644 --- a/spec/controllers/base_controller_spec.rb +++ b/spec/controllers/base_controller_spec.rb @@ -17,7 +17,7 @@ describe BaseController, type: :controller do it "doesn't change anything without a user" do expect { get :index - }.to_not change { Spree::Order.count } + }.not_to change { Spree::Order.count } end it "creates a new order" do @@ -36,7 +36,7 @@ describe BaseController, type: :controller do expect { get :index - }.to_not change { Spree::Order.count } + }.not_to change { Spree::Order.count } expect(session[:order_id]).to eq last_cart.id end @@ -63,7 +63,7 @@ describe BaseController, type: :controller do expect { get :index - }.to_not change { Spree::Order.count } + }.not_to change { Spree::Order.count } expect(current_cart.line_items.count).to eq 0 end @@ -89,13 +89,13 @@ describe BaseController, type: :controller do get :index }.to change { Spree::Order.count }.by(1) - expect(session[:order_id]).to_not eq just_completed_order.id - expect(session[:order_id]).to_not eq last_cart.id + expect(session[:order_id]).not_to eq just_completed_order.id + expect(session[:order_id]).not_to eq last_cart.id expect(controller.current_order.line_items.count).to eq 0 end it "doesn't load variant overrides without line items" do - expect(VariantOverride).to_not receive(:indexed) + expect(VariantOverride).not_to receive(:indexed) controller.current_order(true) end end diff --git a/spec/controllers/checkout_controller_spec.rb b/spec/controllers/checkout_controller_spec.rb index 355343d0d5..4f948cdefa 100644 --- a/spec/controllers/checkout_controller_spec.rb +++ b/spec/controllers/checkout_controller_spec.rb @@ -148,7 +148,7 @@ describe CheckoutController, type: :controller do it "doesn't update default bill address on user" do expect { put :update, params: params.merge(order: { save_bill_address: "0" }) - }.to_not change { + }.not_to change { order.user.reload.bill_address } end @@ -163,7 +163,7 @@ describe CheckoutController, type: :controller do it "doesn't update default ship address on user" do expect { put :update, params: params.merge(order: { save_ship_address: "0" }) - }.to_not change { + }.not_to change { order.user.reload.ship_address } end @@ -196,7 +196,7 @@ describe CheckoutController, type: :controller do end it "doesn't recalculate the voucher adjustment" do - expect(service).to_not receive(:update) + expect(service).not_to receive(:update) put(:update, params:) @@ -256,7 +256,7 @@ describe CheckoutController, type: :controller do order.bill_address = address order.ship_address = address order.select_shipping_method shipping_method.id - OrderWorkflow.new(order).advance_to_payment + Orders::WorkflowService.new(order).advance_to_payment end context "with incomplete data" do @@ -387,7 +387,7 @@ describe CheckoutController, type: :controller do order.bill_address = address order.ship_address = address order.select_shipping_method shipping_method.id - OrderWorkflow.new(order).advance_to_payment + Orders::WorkflowService.new(order).advance_to_payment order.payments << build(:payment, amount: order.total, payment_method:) order.next @@ -459,7 +459,7 @@ describe CheckoutController, type: :controller do allow(order).to receive(:distributor).and_return(distributor) order.update(order_cycle:) - allow(OrderCycleDistributedVariants).to receive(:new).and_return( + allow(OrderCycles::DistributedVariantsService).to receive(:new).and_return( order_cycle_distributed_variants ) end diff --git a/spec/controllers/concerns/raising_parameters_spec.rb b/spec/controllers/concerns/raising_parameters_spec.rb index cf330221b7..73008f20cf 100644 --- a/spec/controllers/concerns/raising_parameters_spec.rb +++ b/spec/controllers/concerns/raising_parameters_spec.rb @@ -26,7 +26,7 @@ describe RaisingParameters do it "raises no error when all parameters are permitted" do expect { params.require(:data).permit(:id, :admin) - }.to_not raise_error + }.not_to raise_error end it "doesn't change standard parameter objects" do @@ -34,7 +34,7 @@ describe RaisingParameters do expect { original_params.permit(:one) - }.to_not raise_error + }.not_to raise_error end end end diff --git a/spec/controllers/payment_gateways/stripe_controller_spec.rb b/spec/controllers/payment_gateways/stripe_controller_spec.rb index 72ceef6bfe..9b2e3233d9 100644 --- a/spec/controllers/payment_gateways/stripe_controller_spec.rb +++ b/spec/controllers/payment_gateways/stripe_controller_spec.rb @@ -11,7 +11,9 @@ module PaymentGateways let!(:order) { create(:order_with_totals, distributor:, order_cycle:) } let(:exchange) { order_cycle.exchanges.to_enterprises(distributor).outgoing.first } - let(:order_cycle_distributed_variants) { instance_double(OrderCycleDistributedVariants) } + let(:order_cycle_distributed_variants) { + instance_double(OrderCycles::DistributedVariantsService) + } before do exchange.variants << order.line_items.first.variant @@ -305,11 +307,11 @@ completed due to stock issues." context "with an invalid last payment" do let(:payment_intent) { "valid" } - let(:finder) { instance_double(OrderPaymentFinder, last_payment: payment) } + let(:finder) { instance_double(Orders::FindPaymentService, last_payment: payment) } before do allow(payment).to receive(:response_code).and_return("invalid") - allow(OrderPaymentFinder).to receive(:new).with(order).and_return(finder) + allow(Orders::FindPaymentService).to receive(:new).with(order).and_return(finder) allow(Stripe::PaymentIntentValidator) .to receive_message_chain(:new, :call).and_return(payment_intent) stub_payment_intent_get_request(payment_intent_id: "valid") diff --git a/spec/controllers/spree/admin/adjustments_controller_spec.rb b/spec/controllers/spree/admin/adjustments_controller_spec.rb index d44c27a08b..a6ae890071 100644 --- a/spec/controllers/spree/admin/adjustments_controller_spec.rb +++ b/spec/controllers/spree/admin/adjustments_controller_spec.rb @@ -27,7 +27,7 @@ module Spree spree_get :index, order_id: order.number expect(assigns(:collection)).to include adjustment1, adjustment2 - expect(assigns(:collection)).to_not include adjustment3 + expect(assigns(:collection)).not_to include adjustment3 end it "displays admin adjustments" do @@ -39,7 +39,7 @@ module Spree it "does not display enterprise fee adjustments" do spree_get :index, order_id: order.number - expect(assigns(:collection)).to_not include adjustment4 + expect(assigns(:collection)).not_to include adjustment4 end end @@ -237,7 +237,7 @@ module Spree expect { spree_post :create, order_id: order.number, adjustment: { label: "Testing", amount: "110" } - }.to_not change { [Adjustment.count, order.reload.total] } + }.not_to change { [Adjustment.count, order.reload.total] } expect(response).to redirect_to spree.admin_order_adjustments_path(order) end @@ -246,7 +246,7 @@ module Spree expect { spree_put :update, order_id: order.number, id: adjustment.id, adjustment: { label: "Testing", amount: "110" } - }.to_not change { [adjustment.reload.amount, order.reload.total] } + }.not_to change { [adjustment.reload.amount, order.reload.total] } expect(response).to redirect_to spree.admin_order_adjustments_path(order) end diff --git a/spec/controllers/spree/admin/base_controller_spec.rb b/spec/controllers/spree/admin/base_controller_spec.rb index 15d763aee0..21dbc71a4e 100644 --- a/spec/controllers/spree/admin/base_controller_spec.rb +++ b/spec/controllers/spree/admin/base_controller_spec.rb @@ -71,10 +71,9 @@ describe Spree::Admin::BaseController, type: :controller do describe "determining the name of the serializer to be used" do before do - class Api::Admin::AllowedPrefixBaseSerializer; end; - - class Api::Admin::BaseSerializer; end; allow(controller).to receive(:ams_prefix_whitelist) { [:allowed_prefix] } + stub_const('Api::Admin::AllowedPrefixBaseSerializer', Class) + stub_const('Api::Admin::BaseSerializer', Class) end context "when a prefix is passed in" do diff --git a/spec/controllers/spree/admin/general_settings_controller_spec.rb b/spec/controllers/spree/admin/general_settings_controller_spec.rb index 4db32d6183..3fff115d01 100644 --- a/spec/controllers/spree/admin/general_settings_controller_spec.rb +++ b/spec/controllers/spree/admin/general_settings_controller_spec.rb @@ -13,7 +13,7 @@ describe Spree::Admin::GeneralSettingsController, type: :controller do end it "updates available units" do - expect(Spree::Config.available_units).to_not include("lb") + expect(Spree::Config.available_units).not_to include("lb") settings_params = { available_units: { lb: "1" } } spree_put :update, settings_params expect(Spree::Config.available_units).to include("lb") diff --git a/spec/controllers/spree/admin/orders/invoices_spec.rb b/spec/controllers/spree/admin/orders/invoices_spec.rb index 1fcfa606ce..4aea9fd065 100644 --- a/spec/controllers/spree/admin/orders/invoices_spec.rb +++ b/spec/controllers/spree/admin/orders/invoices_spec.rb @@ -40,7 +40,7 @@ describe Spree::Admin::OrdersController, type: :controller do it "should allow me to send order invoices" do expect do spree_get :invoice, params - end.to_not change{ Spree::OrderMailer.deliveries.count } + end.not_to change{ Spree::OrderMailer.deliveries.count } expect(response).to redirect_to spree.edit_admin_order_path(order) expect(flash[:error]) .to eq "#{distributor.name} must have a valid ABN before invoices can be used." diff --git a/spec/controllers/spree/admin/orders/payments/payments_controller_refunds_spec.rb b/spec/controllers/spree/admin/orders/payments/payments_controller_refunds_spec.rb index 3dd36c5273..a6ed0be235 100644 --- a/spec/controllers/spree/admin/orders/payments/payments_controller_refunds_spec.rb +++ b/spec/controllers/spree/admin/orders/payments/payments_controller_refunds_spec.rb @@ -49,13 +49,13 @@ describe Spree::Admin::PaymentsController, type: :controller do it "voids the payment" do order.reload - expect(order.payment_total).to_not eq 0 + expect(order.payment_total).not_to eq 0 expect(order.outstanding_balance.to_f).to eq 0 spree_put :fire, params expect(payment.reload.state).to eq 'void' order.reload expect(order.payment_total).to eq 0 - expect(order.outstanding_balance.to_f).to_not eq 0 + expect(order.outstanding_balance.to_f).not_to eq 0 end end @@ -69,12 +69,12 @@ describe Spree::Admin::PaymentsController, type: :controller do it "does not void the payment" do order.reload - expect(order.payment_total).to_not eq 0 + expect(order.payment_total).not_to eq 0 expect(order.outstanding_balance.to_f).to eq 0 spree_put :fire, params expect(payment.reload.state).to eq 'completed' order.reload - expect(order.payment_total).to_not eq 0 + expect(order.payment_total).not_to eq 0 expect(order.outstanding_balance.to_f).to eq 0 expect(flash[:error]).to eq "Bup-bow!" end @@ -92,13 +92,13 @@ describe Spree::Admin::PaymentsController, type: :controller do it "can still void the payment" do order.reload - expect(order.payment_total).to_not eq 0 + expect(order.payment_total).not_to eq 0 expect(order.outstanding_balance.to_f).to eq 0 spree_put :fire, params expect(payment.reload.state).to eq 'void' order.reload expect(order.payment_total).to eq 0 - expect(order.outstanding_balance.to_f).to_not eq 0 + expect(order.outstanding_balance.to_f).not_to eq 0 end end end @@ -115,13 +115,13 @@ describe Spree::Admin::PaymentsController, type: :controller do it "voids the payment" do order.reload - expect(order.payment_total).to_not eq 0 + expect(order.payment_total).not_to eq 0 expect(order.outstanding_balance.to_f).to eq 0 spree_put :fire, params expect(payment.reload.state).to eq 'void' order.reload expect(order.payment_total).to eq 0 - expect(order.outstanding_balance.to_f).to_not eq 0 + expect(order.outstanding_balance.to_f).not_to eq 0 end end end diff --git a/spec/controllers/spree/admin/orders/payments/payments_controller_spec.rb b/spec/controllers/spree/admin/orders/payments/payments_controller_spec.rb index a7a06816d5..6478629e48 100644 --- a/spec/controllers/spree/admin/orders/payments/payments_controller_spec.rb +++ b/spec/controllers/spree/admin/orders/payments/payments_controller_spec.rb @@ -258,7 +258,7 @@ describe Spree::Admin::PaymentsController, type: :controller do it 'does not process the event' do spree_put :fire, params - expect(payment).to_not receive(:unrecognized_event) + expect(payment).not_to receive(:unrecognized_event) expect(flash[:error]).to eq('Could not update the payment') end end diff --git a/spec/controllers/spree/admin/orders_controller_spec.rb b/spec/controllers/spree/admin/orders_controller_spec.rb index 0e27a9dc3c..0dc568430d 100644 --- a/spec/controllers/spree/admin/orders_controller_spec.rb +++ b/spec/controllers/spree/admin/orders_controller_spec.rb @@ -24,7 +24,7 @@ describe Spree::Admin::OrdersController, type: :controller do spree_get :edit, id: order - expect(response.body).to_not match adjustment.label + expect(response.body).not_to match adjustment.label end end end @@ -204,7 +204,7 @@ describe Spree::Admin::OrdersController, type: :controller do order.reload expect(order.all_adjustments.tax.count).to eq 2 - expect(order.all_adjustments.tax).to_not include legacy_tax_adjustment + expect(order.all_adjustments.tax).not_to include legacy_tax_adjustment expect(order.additional_tax_total).to eq 0.5 end end diff --git a/spec/controllers/spree/admin/products_controller_spec.rb b/spec/controllers/spree/admin/products_controller_spec.rb index bc02ae7217..9dbf146f53 100644 --- a/spec/controllers/spree/admin/products_controller_spec.rb +++ b/spec/controllers/spree/admin/products_controller_spec.rb @@ -93,6 +93,7 @@ describe Spree::Admin::ProductsController, type: :controller do variant_unit_name: nil ) end + let!(:taxon) { create(:taxon) } before { controller_login_as_enterprise_user([producer]) } @@ -111,7 +112,8 @@ describe Spree::Admin::ProductsController, type: :controller do "price" => "5.0", "unit_value" => 4, "unit_description" => "", - "display_name" => "name" + "display_name" => "name", + "primary_taxon_id" => taxon.id } ] } @@ -190,7 +192,7 @@ describe Spree::Admin::ProductsController, type: :controller do spree_put :update, id: product, product: { supplier_id: new_producer.id } expect(product.reload.supplier.id).to eq new_producer.id - expect(order_cycle.reload.distributed_variants).to_not include product.variants.first + expect(order_cycle.reload.distributed_variants).not_to include product.variants.first end end @@ -227,7 +229,7 @@ describe Spree::Admin::ProductsController, type: :controller do expect(Spree::Property.count).to be 1 expect(Spree::ProductProperty.count).to be 0 property_names = product.reload.properties.map(&:name) - expect(property_names).to_not include 'a different name' + expect(property_names).not_to include 'a different name' end end diff --git a/spec/controllers/spree/admin/search_controller_spec.rb b/spec/controllers/spree/admin/search_controller_spec.rb index e34e553453..53313e5521 100644 --- a/spec/controllers/spree/admin/search_controller_spec.rb +++ b/spec/controllers/spree/admin/search_controller_spec.rb @@ -18,7 +18,7 @@ describe Spree::Admin::SearchController, type: :controller do it "returns a list of users that I share management of enteprises with" do expect(assigns(:users)).to include owner, manager - expect(assigns(:users)).to_not include random + expect(assigns(:users)).not_to include random end end diff --git a/spec/controllers/spree/admin/tax_rates_controller_spec.rb b/spec/controllers/spree/admin/tax_rates_controller_spec.rb index 27d0c10464..3ce91d9ebf 100644 --- a/spec/controllers/spree/admin/tax_rates_controller_spec.rb +++ b/spec/controllers/spree/admin/tax_rates_controller_spec.rb @@ -27,7 +27,7 @@ module Spree it "updates the record" do expect { spree_put :update, id: tax_rate.id, tax_rate: params - }.to_not change{ Spree::TaxRate.with_deleted.count } + }.not_to change{ Spree::TaxRate.with_deleted.count } expect(response).to redirect_to spree.admin_tax_rates_url expect(tax_rate.reload.name).to eq "Updated Rate" diff --git a/spec/controllers/spree/admin/variants_controller_spec.rb b/spec/controllers/spree/admin/variants_controller_spec.rb index b3b05d8afc..7bdfc7bcbe 100644 --- a/spec/controllers/spree/admin/variants_controller_spec.rb +++ b/spec/controllers/spree/admin/variants_controller_spec.rb @@ -11,7 +11,9 @@ module Spree describe "deleted variants" do let(:product) { create(:product, name: 'Product A') } let(:deleted_variant) do - deleted_variant = product.variants.create(unit_value: "2", price: 1) + deleted_variant = product.variants.create( + unit_value: "2", price: 1, primary_taxon: create(:taxon) + ) deleted_variant.delete deleted_variant end diff --git a/spec/controllers/spree/api_keys_controller_spec.rb b/spec/controllers/spree/api_keys_controller_spec.rb index c39b46e821..99faf43964 100644 --- a/spec/controllers/spree/api_keys_controller_spec.rb +++ b/spec/controllers/spree/api_keys_controller_spec.rb @@ -26,7 +26,7 @@ describe Spree::ApiKeysController, type: :controller, performance: true do expect { spree_post :create, id: other_user.id other_user.reload - }.to_not change { + }.not_to change { other_user.spree_api_key } end diff --git a/spec/controllers/spree/credit_cards_controller_spec.rb b/spec/controllers/spree/credit_cards_controller_spec.rb index 28b33fffab..41e87d975c 100644 --- a/spec/controllers/spree/credit_cards_controller_spec.rb +++ b/spec/controllers/spree/credit_cards_controller_spec.rb @@ -94,7 +94,7 @@ describe Spree::CreditCardsController, type: :controller do { status: 402, body: JSON.generate(error: { message: "Bup-bow..." }) } } it "doesn't save the card locally, and renders a flash error" do - expect{ spree_post :new_from_token, params }.to_not change { Spree::CreditCard.count } + expect{ spree_post :new_from_token, params }.not_to change { Spree::CreditCard.count } json_response = JSON.parse(response.body) flash_message = "There was a problem with your payment information: %s" % 'Bup-bow...' @@ -172,7 +172,7 @@ describe Spree::CreditCardsController, type: :controller do let(:params) { { id: 123 } } it "redirects to /account with a flash error, does not request deletion with Stripe" do - expect(controller).to_not receive(:destroy_at_stripe) + expect(controller).not_to receive(:destroy_at_stripe) spree_delete :destroy, params expect(flash[:error]).to eq 'Sorry, the card could not be removed' expect(response.status).to eq 200 @@ -205,7 +205,7 @@ describe Spree::CreditCardsController, type: :controller do end it "doesn't delete the card" do - expect{ spree_delete :destroy, params }.to_not change { Spree::CreditCard.count } + expect{ spree_delete :destroy, params }.not_to change { Spree::CreditCard.count } expect(flash[:error]).to eq 'Sorry, the card could not be removed' expect(response.status).to eq 422 end diff --git a/spec/controllers/spree/orders_controller_spec.rb b/spec/controllers/spree/orders_controller_spec.rb index 5acb0f5aae..78ed96e16e 100644 --- a/spec/controllers/spree/orders_controller_spec.rb +++ b/spec/controllers/spree/orders_controller_spec.rb @@ -150,7 +150,7 @@ describe Spree::OrdersController, type: :controller do spree_registration_path = '/signup' ofn_registration_path = '/register' get :edit - expect(response.body).to_not match spree_registration_path + expect(response.body).not_to match spree_registration_path expect(response.body).to match ofn_registration_path end end diff --git a/spec/controllers/spree/users_controller_spec.rb b/spec/controllers/spree/users_controller_spec.rb index 8f6455055c..ee8de1d00f 100644 --- a/spec/controllers/spree/users_controller_spec.rb +++ b/spec/controllers/spree/users_controller_spec.rb @@ -23,7 +23,7 @@ describe Spree::UsersController, type: :controller do let(:orders) { assigns(:orders) } let(:shops) { Enterprise.where(id: orders.pluck(:distributor_id)) } - let(:outstanding_balance) { instance_double(OutstandingBalance) } + let(:outstanding_balance_query) { instance_double(OutstandingBalanceQuery) } before do allow(controller).to receive(:spree_current_user) { u1 } @@ -33,7 +33,7 @@ describe Spree::UsersController, type: :controller do get :show expect(orders).to include d1o1, d1o2 - expect(orders).to_not include d1_order_for_u2, d1o3, d2o1 + expect(orders).not_to include d1_order_for_u2, d1o3, d2o1 expect(shops).to include distributor1 # Doesn't return orders for irrelevant distributors" do @@ -47,9 +47,9 @@ describe Spree::UsersController, type: :controller do expect(orders).not_to include d1o3 end - it 'calls OutstandingBalance' do - allow(OutstandingBalance).to receive(:new).and_return(outstanding_balance) - expect(outstanding_balance).to receive(:query) { Spree::Order.none } + it 'calls OutstandingBalanceQuery' do + allow(OutstandingBalanceQuery).to receive(:new).and_return(outstanding_balance_query) + expect(outstanding_balance_query).to receive(:call) { Spree::Order.none } spree_get :show end diff --git a/spec/controllers/user_registrations_controller_spec.rb b/spec/controllers/user_registrations_controller_spec.rb index 8d91a8d25f..d25b811d69 100644 --- a/spec/controllers/user_registrations_controller_spec.rb +++ b/spec/controllers/user_registrations_controller_spec.rb @@ -48,15 +48,9 @@ describe UserRegistrationsController, type: :controller do end it "sets user.locale from cookie on create" do - original_i18n_locale = I18n.locale - original_locale_cookie = cookies[:locale] - cookies[:locale] = "pt" post :create, xhr: true, params: { spree_user: user_params, use_route: :spree } expect(assigns[:user].locale).to eq("pt") - - I18n.locale = original_i18n_locale - cookies[:locale] = original_locale_cookie end end end diff --git a/spec/controllers/webhook_endpoints_controller_spec.rb b/spec/controllers/webhook_endpoints_controller_spec.rb index c36720edb8..e628710f72 100644 --- a/spec/controllers/webhook_endpoints_controller_spec.rb +++ b/spec/controllers/webhook_endpoints_controller_spec.rb @@ -24,7 +24,7 @@ describe WebhookEndpointsController, type: :controller do it "shows error if parameters not specified" do expect { spree_post :create, { url: "" } - }.to_not change { + }.not_to change { user.webhook_endpoints.count } diff --git a/spec/factories/order_factory.rb b/spec/factories/order_factory.rb index 096753389b..b9726a3614 100644 --- a/spec/factories/order_factory.rb +++ b/spec/factories/order_factory.rb @@ -28,7 +28,7 @@ FactoryBot.define do after(:create) do |order, evaluator| order.select_shipping_method evaluator.shipping_method.id - OrderWorkflow.new(order).advance_to_payment + Orders::WorkflowService.new(order).advance_to_payment end factory :order_ready_for_confirmation do diff --git a/spec/factories/product_factory.rb b/spec/factories/product_factory.rb index 320060563f..8e1d5e64c7 100644 --- a/spec/factories/product_factory.rb +++ b/spec/factories/product_factory.rb @@ -3,13 +3,18 @@ FactoryBot.define do factory :base_product, class: Spree::Product do sequence(:name) { |n| "Product ##{n} - #{Kernel.rand(9999)}" } + + transient do + primary_taxon { nil } + end + + primary_taxon_id { |p| (p.primary_taxon || Spree::Taxon.first || create(:taxon)).id } description { generate(:random_description) } price { 19.99 } sku { 'ABC' } deleted_at { nil } supplier { Enterprise.is_primary_producer.first || FactoryBot.create(:supplier_enterprise) } - primary_taxon { Spree::Taxon.first || FactoryBot.create(:taxon) } unit_value { 1 } unit_description { '' } @@ -48,6 +53,7 @@ FactoryBot.define do on_demand { false } on_hand { 5 } end + after(:create) do |product, evaluator| product.variants.first.on_demand = evaluator.on_demand product.variants.first.on_hand = evaluator.on_hand diff --git a/spec/factories/variant_factory.rb b/spec/factories/variant_factory.rb index cd4b322a02..3cb44c6344 100644 --- a/spec/factories/variant_factory.rb +++ b/spec/factories/variant_factory.rb @@ -11,7 +11,8 @@ FactoryBot.define do width { generate(:random_float) } depth { generate(:random_float) } - product { |p| p.association(:base_product) } + primary_taxon { Spree::Taxon.first || FactoryBot.create(:taxon) } + product { |p| p.association(:product) } # ensure stock item will be created for this variant before(:create) { create(:stock_location) if Spree::StockLocation.count.zero? } @@ -22,7 +23,6 @@ FactoryBot.define do on_hand { 5 } end - product { |p| p.association(:product) } unit_value { 1 } unit_description { '' } diff --git a/spec/fixtures/vcr_cassettes/ConnectAppJob/stores_connection_data_on_the_app.yml b/spec/fixtures/vcr_cassettes/ConnectAppJob/stores_connection_data_on_the_app.yml index 42a832a80b..8c4981bae7 100644 --- a/spec/fixtures/vcr_cassettes/ConnectAppJob/stores_connection_data_on_the_app.yml +++ b/spec/fixtures/vcr_cassettes/ConnectAppJob/stores_connection_data_on_the_app.yml @@ -2,11 +2,11 @@ http_interactions: - request: method: post - uri: https://n8n.openfoodnetwork.org.uk/webhook/regen/connect-enterprise + uri: https://n8n.openfoodnetwork.org/webhook/regen/connect-enterprise body: encoding: UTF-8 - string: '{"id":"27bc9d0a-d95c-4a36-9b16-01fdd8a82b51","at":"2023-12-21 14:54:28 - +1100","event":"connect-app","data":{"@id":"http://test.host/api/dfc/enterprises/3","access_token":"12345"}}' + string: '{"id":"c9f0e82a-f200-4c1a-9aa2-3a3a63c7acba","at":"2024-04-05 15:30:57 + +1100","event":"connect-app","data":{"@id":"http://test.host/api/dfc/enterprises/3","access_token":""}}' headers: User-Agent: - openfoodnetwork_webhook/1.0 @@ -21,34 +21,24 @@ http_interactions: code: 200 message: OK headers: - Server: - - nginx - Date: - - Thu, 21 Dec 2023 03:54:33 GMT - Content-Type: - - application/json; charset=utf-8 Content-Length: - '141' - Connection: - - keep-alive + Content-Type: + - application/json; charset=utf-8 + Date: + - Fri, 05 Apr 2024 04:30:58 GMT Etag: - W/"8d-Lz10bce6zwT2C429xIkj52OBWyk" + Strict-Transport-Security: + - max-age=315360000; includeSubDomains; preload Vary: - Accept-Encoding - Strict-Transport-Security: - - max-age=63072000 - X-Xss-Protection: - - 1; mode=block - X-Download-Options: - - noopen X-Content-Type-Options: - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - same-origin + X-Xss-Protection: + - 1; mode=block body: encoding: UTF-8 - string: '{"link":"https://example.net/update","destroy":"https://n8n.openfoodnetwork.org.uk/webhook/remove-enterprise?id=recjBXXXXXXXXXXXX&key=12345"}' - recorded_at: Thu, 21 Dec 2023 03:54:33 GMT + string: '{"link":"https://example.net/update","destroy":"https://n8n.openfoodnetwork.org.uk/webhook/remove-enterprise?id=recjBXXXXXXXXXXXX&key="}' + recorded_at: Fri, 05 Apr 2024 04:30:58 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Connected_Apps/can_be_enabled_and_disabled.yml b/spec/fixtures/vcr_cassettes/Connected_Apps/can_be_enabled_and_disabled.yml index b968963b7b..c38e0d8fd4 100644 --- a/spec/fixtures/vcr_cassettes/Connected_Apps/can_be_enabled_and_disabled.yml +++ b/spec/fixtures/vcr_cassettes/Connected_Apps/can_be_enabled_and_disabled.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: post - uri: https://n8n.openfoodnetwork.org.uk/webhook/regen/connect-enterprise + uri: https://n8n.openfoodnetwork.org/webhook/regen/connect-enterprise body: encoding: UTF-8 string: '{"id":"4da377c8-0c8f-4aaa-8f85-f2a218a13d6e","at":"2023-12-14 12:52:53 diff --git a/spec/fixtures/vcr_cassettes/DfcRequest/refreshes_the_access_token_on_fail.yml b/spec/fixtures/vcr_cassettes/DfcRequest/refreshes_the_access_token_on_fail.yml new file mode 100644 index 0000000000..9a14071f73 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DfcRequest/refreshes_the_access_token_on_fail.yml @@ -0,0 +1,105 @@ +--- +http_interactions: +- request: + method: get + uri: https://login.lescommuns.org/auth/realms/data-food-consortium/.well-known/openid-configuration + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - SWD 2.0.3 + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 15 Mar 2024 05:44:06 GMT + Content-Type: + - application/json;charset=UTF-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Vary: + - Accept-Encoding + Set-Cookie: + - AUTH_SESSION_ID=1710481447.162.5206.870756|6055218c9898cae39f8ffd531999e49a; + Path=/; Secure; HttpOnly + Cache-Control: + - no-cache, must-revalidate, no-transform, no-store + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=15724800; includeSubDomains + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + body: + encoding: ASCII-8BIT + string: '{"issuer":"https://login.lescommuns.org/auth/realms/data-food-consortium","authorization_endpoint":"https://login.lescommuns.org/auth/realms/data-food-consortium/protocol/openid-connect/auth","token_endpoint":"https://login.lescommuns.org/auth/realms/data-food-consortium/protocol/openid-connect/token","introspection_endpoint":"https://login.lescommuns.org/auth/realms/data-food-consortium/protocol/openid-connect/token/introspect","userinfo_endpoint":"https://login.lescommuns.org/auth/realms/data-food-consortium/protocol/openid-connect/userinfo","end_session_endpoint":"https://login.lescommuns.org/auth/realms/data-food-consortium/protocol/openid-connect/logout","frontchannel_logout_session_supported":true,"frontchannel_logout_supported":true,"jwks_uri":"https://login.lescommuns.org/auth/realms/data-food-consortium/protocol/openid-connect/certs","check_session_iframe":"https://login.lescommuns.org/auth/realms/data-food-consortium/protocol/openid-connect/login-status-iframe.html","grant_types_supported":["authorization_code","implicit","refresh_token","password","client_credentials","urn:openid:params:grant-type:ciba","urn:ietf:params:oauth:grant-type:device_code"],"acr_values_supported":["0","1"],"response_types_supported":["code","none","id_token","token","id_token + token","code id_token","code token","code id_token token"],"subject_types_supported":["public","pairwise"],"id_token_signing_alg_values_supported":["PS384","ES384","RS384","HS256","HS512","ES256","RS256","HS384","ES512","PS256","PS512","RS512"],"id_token_encryption_alg_values_supported":["RSA-OAEP","RSA-OAEP-256","RSA1_5"],"id_token_encryption_enc_values_supported":["A256GCM","A192GCM","A128GCM","A128CBC-HS256","A192CBC-HS384","A256CBC-HS512"],"userinfo_signing_alg_values_supported":["PS384","ES384","RS384","HS256","HS512","ES256","RS256","HS384","ES512","PS256","PS512","RS512","none"],"userinfo_encryption_alg_values_supported":["RSA-OAEP","RSA-OAEP-256","RSA1_5"],"userinfo_encryption_enc_values_supported":["A256GCM","A192GCM","A128GCM","A128CBC-HS256","A192CBC-HS384","A256CBC-HS512"],"request_object_signing_alg_values_supported":["PS384","ES384","RS384","HS256","HS512","ES256","RS256","HS384","ES512","PS256","PS512","RS512","none"],"request_object_encryption_alg_values_supported":["RSA-OAEP","RSA-OAEP-256","RSA1_5"],"request_object_encryption_enc_values_supported":["A256GCM","A192GCM","A128GCM","A128CBC-HS256","A192CBC-HS384","A256CBC-HS512"],"response_modes_supported":["query","fragment","form_post","query.jwt","fragment.jwt","form_post.jwt","jwt"],"registration_endpoint":"https://login.lescommuns.org/auth/realms/data-food-consortium/clients-registrations/openid-connect","token_endpoint_auth_methods_supported":["private_key_jwt","client_secret_basic","client_secret_post","tls_client_auth","client_secret_jwt"],"token_endpoint_auth_signing_alg_values_supported":["PS384","ES384","RS384","HS256","HS512","ES256","RS256","HS384","ES512","PS256","PS512","RS512"],"introspection_endpoint_auth_methods_supported":["private_key_jwt","client_secret_basic","client_secret_post","tls_client_auth","client_secret_jwt"],"introspection_endpoint_auth_signing_alg_values_supported":["PS384","ES384","RS384","HS256","HS512","ES256","RS256","HS384","ES512","PS256","PS512","RS512"],"authorization_signing_alg_values_supported":["PS384","ES384","RS384","HS256","HS512","ES256","RS256","HS384","ES512","PS256","PS512","RS512"],"authorization_encryption_alg_values_supported":["RSA-OAEP","RSA-OAEP-256","RSA1_5"],"authorization_encryption_enc_values_supported":["A256GCM","A192GCM","A128GCM","A128CBC-HS256","A192CBC-HS384","A256CBC-HS512"],"claims_supported":["aud","sub","iss","auth_time","name","given_name","family_name","preferred_username","email","acr"],"claim_types_supported":["normal"],"claims_parameter_supported":true,"scopes_supported":["openid","microprofile-jwt","phone","roles","profile","email","address","web-origins","acr","offline_access"],"request_parameter_supported":true,"request_uri_parameter_supported":true,"require_request_uri_registration":true,"code_challenge_methods_supported":["plain","S256"],"tls_client_certificate_bound_access_tokens":true,"revocation_endpoint":"https://login.lescommuns.org/auth/realms/data-food-consortium/protocol/openid-connect/revoke","revocation_endpoint_auth_methods_supported":["private_key_jwt","client_secret_basic","client_secret_post","tls_client_auth","client_secret_jwt"],"revocation_endpoint_auth_signing_alg_values_supported":["PS384","ES384","RS384","HS256","HS512","ES256","RS256","HS384","ES512","PS256","PS512","RS512"],"backchannel_logout_supported":true,"backchannel_logout_session_supported":true,"device_authorization_endpoint":"https://login.lescommuns.org/auth/realms/data-food-consortium/protocol/openid-connect/auth/device","backchannel_token_delivery_modes_supported":["poll","ping"],"backchannel_authentication_endpoint":"https://login.lescommuns.org/auth/realms/data-food-consortium/protocol/openid-connect/ext/ciba/auth","backchannel_authentication_request_signing_alg_values_supported":["PS384","ES384","RS384","ES256","RS256","ES512","PS256","PS512","RS512"],"require_pushed_authorization_requests":false,"pushed_authorization_request_endpoint":"https://login.lescommuns.org/auth/realms/data-food-consortium/protocol/openid-connect/ext/par/request","mtls_endpoint_aliases":{"token_endpoint":"https://login.lescommuns.org/auth/realms/data-food-consortium/protocol/openid-connect/token","revocation_endpoint":"https://login.lescommuns.org/auth/realms/data-food-consortium/protocol/openid-connect/revoke","introspection_endpoint":"https://login.lescommuns.org/auth/realms/data-food-consortium/protocol/openid-connect/token/introspect","device_authorization_endpoint":"https://login.lescommuns.org/auth/realms/data-food-consortium/protocol/openid-connect/auth/device","registration_endpoint":"https://login.lescommuns.org/auth/realms/data-food-consortium/clients-registrations/openid-connect","userinfo_endpoint":"https://login.lescommuns.org/auth/realms/data-food-consortium/protocol/openid-connect/userinfo","pushed_authorization_request_endpoint":"https://login.lescommuns.org/auth/realms/data-food-consortium/protocol/openid-connect/ext/par/request","backchannel_authentication_endpoint":"https://login.lescommuns.org/auth/realms/data-food-consortium/protocol/openid-connect/ext/ciba/auth"},"authorization_response_iss_parameter_supported":true}' + recorded_at: Fri, 15 Mar 2024 05:44:05 GMT +- request: + method: post + uri: https://login.lescommuns.org/auth/realms/data-food-consortium/protocol/openid-connect/token + body: + encoding: UTF-8 + string: grant_type=refresh_token&refresh_token= + headers: + User-Agent: + - Rack::OAuth2 (2.2.1) + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 15 Mar 2024 05:44:07 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Vary: + - Accept-Encoding + Set-Cookie: + - AUTH_SESSION_ID=1710481448.492.2309.531618|6055218c9898cae39f8ffd531999e49a; + Path=/; Secure; HttpOnly + Cache-Control: + - no-store + Pragma: + - no-cache + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=15724800; includeSubDomains + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - SAMEORIGIN + X-Xss-Protection: + - 1; mode=block + body: + encoding: ASCII-8BIT + string: '{"access_token":"","expires_in":1800,"refresh_expires_in":28510621,"refresh_token":"","token_type":"Bearer","id_token":"","not-before-policy":0,"session_state":"989db9a7-584c-4eeb-bff5-db77b53e8def","scope":"openid + profile email"}' + recorded_at: Fri, 15 Mar 2024 05:44:07 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_Gateway_StripeSCA/_error_message/when_payment_intent_state_is_not_in_requires_capture_state/does_not_succeed_if_payment_intent_state_is_not_requires_capture.yml b/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_Gateway_StripeSCA/_error_message/when_payment_intent_state_is_not_in_requires_capture_state/does_not_succeed_if_payment_intent_state_is_not_requires_capture.yml deleted file mode 100644 index 13c2a0be36..0000000000 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_Gateway_StripeSCA/_error_message/when_payment_intent_state_is_not_in_requires_capture_state/does_not_succeed_if_payment_intent_state_is_not_requires_capture.yml +++ /dev/null @@ -1,381 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.stripe.com/v1/payment_methods/pm_card_mastercard - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Stripe/v1 RubyBindings/10.10.0 - Authorization: - - Bearer - Content-Type: - - application/x-www-form-urlencoded - X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_0zdTS2eXS52wv3","request_duration_ms":1375}}' - Stripe-Version: - - '2023-10-16' - X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx - Date: - - Wed, 28 Feb 2024 04:23:13 GMT - Content-Type: - - application/json - Content-Length: - - '977' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Methods: - - GET,HEAD,PUT,PATCH,POST,DELETE - Access-Control-Allow-Origin: - - "*" - Access-Control-Expose-Headers: - - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, - X-Stripe-Privileged-Session-Required - Access-Control-Max-Age: - - '300' - Cache-Control: - - no-cache, no-store - Content-Security-Policy: - - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods%2F%3Apayment_method; - block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action - 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; - style-src 'self' - Request-Id: - - req_TC671rsepSNnXC - Stripe-Version: - - '2023-10-16' - Vary: - - Origin - X-Stripe-Routing-Context-Priority-Tier: - - api-testmode - Strict-Transport-Security: - - max-age=63072000; includeSubDomains; preload - body: - encoding: UTF-8 - string: |- - { - "id": "pm_1OoeflKuuB1fWySn43Ej2zjy", - "object": "payment_method", - "billing_details": { - "address": { - "city": null, - "country": null, - "line1": null, - "line2": null, - "postal_code": null, - "state": null - }, - "email": null, - "name": null, - "phone": null - }, - "card": { - "brand": "mastercard", - "checks": { - "address_line1_check": null, - "address_postal_code_check": null, - "cvc_check": "unchecked" - }, - "country": "US", - "display_brand": "mastercard", - "exp_month": 2, - "exp_year": 2025, - "fingerprint": "BL35fEFVcTTS5wpE", - "funding": "credit", - "generated_from": null, - "last4": "4444", - "networks": { - "available": [ - "mastercard" - ], - "preferred": null - }, - "three_d_secure_usage": { - "supported": true - }, - "wallet": null - }, - "created": 1709094193, - "customer": null, - "livemode": false, - "metadata": {}, - "type": "card" - } - recorded_at: Wed, 28 Feb 2024 04:23:13 GMT -- request: - method: post - uri: https://api.stripe.com/v1/payment_intents - body: - encoding: UTF-8 - string: amount=1000¤cy=aud&payment_method=pm_1OoeflKuuB1fWySn43Ej2zjy&payment_method_types[0]=card&capture_method=manual - headers: - User-Agent: - - Stripe/v1 RubyBindings/10.10.0 - Authorization: - - Bearer - Content-Type: - - application/x-www-form-urlencoded - X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_TC671rsepSNnXC","request_duration_ms":342}}' - Stripe-Version: - - '2023-10-16' - X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx - Date: - - Wed, 28 Feb 2024 04:23:14 GMT - Content-Type: - - application/json - Content-Length: - - '1344' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Methods: - - GET,HEAD,PUT,PATCH,POST,DELETE - Access-Control-Allow-Origin: - - "*" - Access-Control-Expose-Headers: - - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, - X-Stripe-Privileged-Session-Required - Access-Control-Max-Age: - - '300' - Cache-Control: - - no-cache, no-store - Content-Security-Policy: - - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; - default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; - img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' - Idempotency-Key: - - e62b12fb-ca7d-4731-a40d-3ea1fe68ea4e - Original-Request: - - req_iELWfIGpVGFgJW - Request-Id: - - req_iELWfIGpVGFgJW - Stripe-Should-Retry: - - 'false' - Stripe-Version: - - '2023-10-16' - Vary: - - Origin - X-Stripe-Routing-Context-Priority-Tier: - - api-testmode - Strict-Transport-Security: - - max-age=63072000; includeSubDomains; preload - body: - encoding: UTF-8 - string: |- - { - "id": "pi_3OoeflKuuB1fWySn128KWMQF", - "object": "payment_intent", - "amount": 1000, - "amount_capturable": 0, - "amount_details": { - "tip": {} - }, - "amount_received": 0, - "application": null, - "application_fee_amount": null, - "automatic_payment_methods": null, - "canceled_at": null, - "cancellation_reason": null, - "capture_method": "manual", - "client_secret": "pi_3OoeflKuuB1fWySn128KWMQF_secret_AFZlxzNaGKQhJwyoycEnNnXt9", - "confirmation_method": "automatic", - "created": 1709094193, - "currency": "aud", - "customer": null, - "description": null, - "invoice": null, - "last_payment_error": null, - "latest_charge": null, - "livemode": false, - "metadata": {}, - "next_action": null, - "on_behalf_of": null, - "payment_method": "pm_1OoeflKuuB1fWySn43Ej2zjy", - "payment_method_configuration_details": null, - "payment_method_options": { - "card": { - "installments": null, - "mandate_options": null, - "network": null, - "request_three_d_secure": "automatic" - } - }, - "payment_method_types": [ - "card" - ], - "processing": null, - "receipt_email": null, - "review": null, - "setup_future_usage": null, - "shipping": null, - "source": null, - "statement_descriptor": null, - "statement_descriptor_suffix": null, - "status": "requires_confirmation", - "transfer_data": null, - "transfer_group": null - } - recorded_at: Wed, 28 Feb 2024 04:23:14 GMT -- request: - method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoeflKuuB1fWySn128KWMQF - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Stripe/v1 RubyBindings/10.10.0 - Authorization: - - Bearer - Content-Type: - - application/x-www-form-urlencoded - X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_iELWfIGpVGFgJW","request_duration_ms":471}}' - Stripe-Version: - - '2023-10-16' - X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx - Date: - - Wed, 28 Feb 2024 04:23:14 GMT - Content-Type: - - application/json - Content-Length: - - '1344' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Methods: - - GET,HEAD,PUT,PATCH,POST,DELETE - Access-Control-Allow-Origin: - - "*" - Access-Control-Expose-Headers: - - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, - X-Stripe-Privileged-Session-Required - Access-Control-Max-Age: - - '300' - Cache-Control: - - no-cache, no-store - Content-Security-Policy: - - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents%2F%3Aintent; - block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action - 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; - style-src 'self' - Request-Id: - - req_urrrJYueyeMAx7 - Stripe-Version: - - '2023-10-16' - Vary: - - Origin - X-Stripe-Routing-Context-Priority-Tier: - - api-testmode - Strict-Transport-Security: - - max-age=63072000; includeSubDomains; preload - body: - encoding: UTF-8 - string: |- - { - "id": "pi_3OoeflKuuB1fWySn128KWMQF", - "object": "payment_intent", - "amount": 1000, - "amount_capturable": 0, - "amount_details": { - "tip": {} - }, - "amount_received": 0, - "application": null, - "application_fee_amount": null, - "automatic_payment_methods": null, - "canceled_at": null, - "cancellation_reason": null, - "capture_method": "manual", - "client_secret": "pi_3OoeflKuuB1fWySn128KWMQF_secret_AFZlxzNaGKQhJwyoycEnNnXt9", - "confirmation_method": "automatic", - "created": 1709094193, - "currency": "aud", - "customer": null, - "description": null, - "invoice": null, - "last_payment_error": null, - "latest_charge": null, - "livemode": false, - "metadata": {}, - "next_action": null, - "on_behalf_of": null, - "payment_method": "pm_1OoeflKuuB1fWySn43Ej2zjy", - "payment_method_configuration_details": null, - "payment_method_options": { - "card": { - "installments": null, - "mandate_options": null, - "network": null, - "request_three_d_secure": "automatic" - } - }, - "payment_method_types": [ - "card" - ], - "processing": null, - "receipt_email": null, - "review": null, - "setup_future_usage": null, - "shipping": null, - "source": null, - "statement_descriptor": null, - "statement_descriptor_suffix": null, - "status": "requires_confirmation", - "transfer_data": null, - "transfer_group": null - } - recorded_at: Wed, 28 Feb 2024 04:23:14 GMT -recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_Gateway_StripeSCA/_purchase/provides_an_error_message_to_help_developer_debug.yml b/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_Gateway_StripeSCA/_purchase/provides_an_error_message_to_help_developer_debug.yml deleted file mode 100644 index 4a1cd05e68..0000000000 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_Gateway_StripeSCA/_purchase/provides_an_error_message_to_help_developer_debug.yml +++ /dev/null @@ -1,387 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.stripe.com/v1/payment_methods/pm_card_mastercard - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Stripe/v1 RubyBindings/10.10.0 - Authorization: - - Bearer - Content-Type: - - application/x-www-form-urlencoded - X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_XPJt16n7nTK00g","request_duration_ms":340}}' - Stripe-Version: - - '2023-10-16' - X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx - Date: - - Wed, 28 Feb 2024 04:22:55 GMT - Content-Type: - - application/json - Content-Length: - - '977' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Methods: - - GET,HEAD,PUT,PATCH,POST,DELETE - Access-Control-Allow-Origin: - - "*" - Access-Control-Expose-Headers: - - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, - X-Stripe-Privileged-Session-Required - Access-Control-Max-Age: - - '300' - Cache-Control: - - no-cache, no-store - Content-Security-Policy: - - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods%2F%3Apayment_method; - block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action - 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; - style-src 'self' - Request-Id: - - req_PkEIZ0ytajfFi0 - Stripe-Version: - - '2023-10-16' - Vary: - - Origin - X-Stripe-Routing-Context-Priority-Tier: - - api-testmode - Strict-Transport-Security: - - max-age=63072000; includeSubDomains; preload - body: - encoding: UTF-8 - string: |- - { - "id": "pm_1OoefTKuuB1fWySnZGdqP7aU", - "object": "payment_method", - "billing_details": { - "address": { - "city": null, - "country": null, - "line1": null, - "line2": null, - "postal_code": null, - "state": null - }, - "email": null, - "name": null, - "phone": null - }, - "card": { - "brand": "mastercard", - "checks": { - "address_line1_check": null, - "address_postal_code_check": null, - "cvc_check": "unchecked" - }, - "country": "US", - "display_brand": "mastercard", - "exp_month": 2, - "exp_year": 2025, - "fingerprint": "BL35fEFVcTTS5wpE", - "funding": "credit", - "generated_from": null, - "last4": "4444", - "networks": { - "available": [ - "mastercard" - ], - "preferred": null - }, - "three_d_secure_usage": { - "supported": true - }, - "wallet": null - }, - "created": 1709094175, - "customer": null, - "livemode": false, - "metadata": {}, - "type": "card" - } - recorded_at: Wed, 28 Feb 2024 04:22:55 GMT -- request: - method: post - uri: https://api.stripe.com/v1/payment_intents - body: - encoding: UTF-8 - string: amount=1000¤cy=aud&payment_method=pm_1OoefTKuuB1fWySnZGdqP7aU&payment_method_types[0]=card&capture_method=manual - headers: - User-Agent: - - Stripe/v1 RubyBindings/10.10.0 - Authorization: - - Bearer - Content-Type: - - application/x-www-form-urlencoded - X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_PkEIZ0ytajfFi0","request_duration_ms":393}}' - Stripe-Version: - - '2023-10-16' - X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx - Date: - - Wed, 28 Feb 2024 04:22:55 GMT - Content-Type: - - application/json - Content-Length: - - '1344' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Methods: - - GET,HEAD,PUT,PATCH,POST,DELETE - Access-Control-Allow-Origin: - - "*" - Access-Control-Expose-Headers: - - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, - X-Stripe-Privileged-Session-Required - Access-Control-Max-Age: - - '300' - Cache-Control: - - no-cache, no-store - Content-Security-Policy: - - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; - default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; - img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' - Idempotency-Key: - - 2483ffe7-b417-4399-aa5d-8e07a07f3c4a - Original-Request: - - req_8qPyCfGouYra9P - Request-Id: - - req_8qPyCfGouYra9P - Stripe-Should-Retry: - - 'false' - Stripe-Version: - - '2023-10-16' - Vary: - - Origin - X-Stripe-Routing-Context-Priority-Tier: - - api-testmode - Strict-Transport-Security: - - max-age=63072000; includeSubDomains; preload - body: - encoding: UTF-8 - string: |- - { - "id": "pi_3OoefTKuuB1fWySn1nUc8iAF", - "object": "payment_intent", - "amount": 1000, - "amount_capturable": 0, - "amount_details": { - "tip": {} - }, - "amount_received": 0, - "application": null, - "application_fee_amount": null, - "automatic_payment_methods": null, - "canceled_at": null, - "cancellation_reason": null, - "capture_method": "manual", - "client_secret": "pi_3OoefTKuuB1fWySn1nUc8iAF_secret_P1PkiljJQA3bUt1qjafq1N30Y", - "confirmation_method": "automatic", - "created": 1709094175, - "currency": "aud", - "customer": null, - "description": null, - "invoice": null, - "last_payment_error": null, - "latest_charge": null, - "livemode": false, - "metadata": {}, - "next_action": null, - "on_behalf_of": null, - "payment_method": "pm_1OoefTKuuB1fWySnZGdqP7aU", - "payment_method_configuration_details": null, - "payment_method_options": { - "card": { - "installments": null, - "mandate_options": null, - "network": null, - "request_three_d_secure": "automatic" - } - }, - "payment_method_types": [ - "card" - ], - "processing": null, - "receipt_email": null, - "review": null, - "setup_future_usage": null, - "shipping": null, - "source": null, - "statement_descriptor": null, - "statement_descriptor_suffix": null, - "status": "requires_confirmation", - "transfer_data": null, - "transfer_group": null - } - recorded_at: Wed, 28 Feb 2024 04:22:55 GMT -- request: - method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoefTKuuB1fWySn1nUc8iAF/confirm - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Stripe/v1 RubyBindings/10.10.0 - Authorization: - - Bearer - Content-Type: - - application/x-www-form-urlencoded - X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_8qPyCfGouYra9P","request_duration_ms":408}}' - Stripe-Version: - - '2023-10-16' - X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx - Date: - - Wed, 28 Feb 2024 04:22:56 GMT - Content-Type: - - application/json - Content-Length: - - '1367' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Methods: - - GET,HEAD,PUT,PATCH,POST,DELETE - Access-Control-Allow-Origin: - - "*" - Access-Control-Expose-Headers: - - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, - X-Stripe-Privileged-Session-Required - Access-Control-Max-Age: - - '300' - Cache-Control: - - no-cache, no-store - Content-Security-Policy: - - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents%2F%3Aintent%2Fconfirm; - block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action - 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; - style-src 'self' - Idempotency-Key: - - 680027e4-2ed8-4df3-9f5e-41477748d594 - Original-Request: - - req_RZnI8d1lN97iCq - Request-Id: - - req_RZnI8d1lN97iCq - Stripe-Should-Retry: - - 'false' - Stripe-Version: - - '2023-10-16' - Vary: - - Origin - X-Stripe-Routing-Context-Priority-Tier: - - api-testmode - Strict-Transport-Security: - - max-age=63072000; includeSubDomains; preload - body: - encoding: UTF-8 - string: |- - { - "id": "pi_3OoefTKuuB1fWySn1nUc8iAF", - "object": "payment_intent", - "amount": 1000, - "amount_capturable": 1000, - "amount_details": { - "tip": {} - }, - "amount_received": 0, - "application": null, - "application_fee_amount": null, - "automatic_payment_methods": null, - "canceled_at": null, - "cancellation_reason": null, - "capture_method": "manual", - "client_secret": "pi_3OoefTKuuB1fWySn1nUc8iAF_secret_P1PkiljJQA3bUt1qjafq1N30Y", - "confirmation_method": "automatic", - "created": 1709094175, - "currency": "aud", - "customer": null, - "description": null, - "invoice": null, - "last_payment_error": null, - "latest_charge": "ch_3OoefTKuuB1fWySn115Vyr1m", - "livemode": false, - "metadata": {}, - "next_action": null, - "on_behalf_of": null, - "payment_method": "pm_1OoefTKuuB1fWySnZGdqP7aU", - "payment_method_configuration_details": null, - "payment_method_options": { - "card": { - "installments": null, - "mandate_options": null, - "network": null, - "request_three_d_secure": "automatic" - } - }, - "payment_method_types": [ - "card" - ], - "processing": null, - "receipt_email": null, - "review": null, - "setup_future_usage": null, - "shipping": null, - "source": null, - "statement_descriptor": null, - "statement_descriptor_suffix": null, - "status": "requires_capture", - "transfer_data": null, - "transfer_group": null - } - recorded_at: Wed, 28 Feb 2024 04:22:56 GMT -recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripeAccount/deauthorize_and_destroy/when_the_Stripe_API_disconnect_fails/destroys_the_record_and_notifies_Bugsnag.yml b/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripeAccount/deauthorize_and_destroy/when_the_Stripe_API_disconnect_fails/destroys_the_record_and_notifies_Bugsnag.yml deleted file mode 100644 index ed1ae3c092..0000000000 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripeAccount/deauthorize_and_destroy/when_the_Stripe_API_disconnect_fails/destroys_the_record_and_notifies_Bugsnag.yml +++ /dev/null @@ -1,94 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://connect.stripe.com/oauth/deauthorize - body: - encoding: UTF-8 - string: stripe_user_id=&client_id=bogus_client_id - headers: - User-Agent: - - Stripe/v1 RubyBindings/10.10.0 - Authorization: - - Bearer - Content-Type: - - application/x-www-form-urlencoded - X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_4LwwjkiCeJTWny","request_duration_ms":281}}' - Stripe-Version: - - '2023-10-16' - X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 401 - message: Unauthorized - headers: - Server: - - nginx - Date: - - Mon, 26 Feb 2024 23:18:26 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '96' - Connection: - - keep-alive - Cache-Control: - - max-age=0, no-cache, no-store, must-revalidate - Content-Security-Policy: - - report-uri /csp-report?p=%2Foauth%2Fdeauthorize;block-all-mixed-content;default-src - 'none' 'report-sample';base-uri 'none';form-action 'none';style-src 'unsafe-inline';frame-ancestors - 'self';connect-src 'self';img-src 'self' https://b.stripecdn.com - Cross-Origin-Opener-Policy-Report-Only: - - same-origin; report-to=https://q.stripe.com/coop-report - Expires: - - '0' - Pragma: - - no-cache - Referrer-Policy: - - strict-origin-when-cross-origin - Request-Id: - - req_7fO2Qr9kbyPu69 - Set-Cookie: - - __Host-session=; path=/; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT; - secure; SameSite=None - - __stripe_orig_props=%7B%22referrer%22%3A%22%22%2C%22landing%22%3A%22https%3A%2F%2Fconnect.stripe.com%2Foauth%2Fdeauthorize%22%7D; - domain=stripe.com; path=/; expires=Tue, 25 Feb 2025 23:18:26 GMT; secure; - HttpOnly; SameSite=Lax - - cid=ee664136-6838-4c86-a1f9-91a3b3fc5a41; domain=stripe.com; path=/; expires=Sun, - 26 May 2024 23:18:26 GMT; secure; SameSite=Lax - - machine_identifier=Gx4pHleLfZeFAutuct1xCkIgOmKgnG%2BLi1RTjGMAvIPH3d8fqGxaX9Q8JYPdYRWP2lQ%3D; - domain=stripe.com; path=/; expires=Tue, 25 Feb 2025 23:18:26 GMT; secure; - HttpOnly; SameSite=Lax - - private_machine_identifier=KGppW1n2ABmK0lVDtoVuQv%2BxCs6ofNCGmRyH2EZwuBa9EWrRDG2m5TexKWodBWTsf5I%3D; - domain=stripe.com; path=/; expires=Tue, 25 Feb 2025 23:18:26 GMT; secure; - HttpOnly; SameSite=None - - site-auth=; domain=stripe.com; path=/; max-age=0; expires=Thu, 01 Jan 1970 - 00:00:00 GMT; secure - - stripe.csrf=_1RiSdotefTTRKOljC7SPCfweSwVa7kPrPSaruSRLeMaAGkLhHO4AtoI9Yf3yyFZ3jtVCXvCpYh1BaE6AcD9Ijw-AYTZVJxRk_zJWebqcTj3jja84oPHuqVHzVB488Oa49MoUU7TRQ%3D%3D; - domain=stripe.com; path=/; secure; HttpOnly; SameSite=None - Stripe-Kill-Route: - - "[]" - Www-Authenticate: - - Bearer realm="Stripe" - X-Stripe-Routing-Context-Priority-Tier: - - api-testmode - Strict-Transport-Security: - - max-age=63072000; includeSubDomains; preload - body: - encoding: UTF-8 - string: |- - { - "error": "invalid_client", - "error_description": "No such application: 'bogus_client_id'" - } - recorded_at: Mon, 26 Feb 2024 23:18:26 GMT -recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_CreditCardRemover/_remove/Stripe_customer_does_not_exist/raises_an_error.yml b/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_CreditCardRemover/_remove/Stripe_customer_does_not_exist/raises_an_error.yml deleted file mode 100644 index 0030774da8..0000000000 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_CreditCardRemover/_remove/Stripe_customer_does_not_exist/raises_an_error.yml +++ /dev/null @@ -1,212 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.stripe.com/v1/payment_methods - body: - encoding: UTF-8 - string: type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2025&card[cvc]=314 - headers: - User-Agent: - - Stripe/v1 RubyBindings/10.10.0 - Authorization: - - Bearer - Content-Type: - - application/x-www-form-urlencoded - X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_B0FhYsp0bBTNRp","request_duration_ms":640}}' - Stripe-Version: - - '2023-10-16' - X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx - Date: - - Mon, 26 Feb 2024 23:16:20 GMT - Content-Type: - - application/json - Content-Length: - - '959' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Methods: - - GET,HEAD,PUT,PATCH,POST,DELETE - Access-Control-Allow-Origin: - - "*" - Access-Control-Expose-Headers: - - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, - X-Stripe-Privileged-Session-Required - Access-Control-Max-Age: - - '300' - Cache-Control: - - no-cache, no-store - Content-Security-Policy: - - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; - default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; - img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' - Idempotency-Key: - - 39ab9bf7-aea4-4b8e-a577-5ddadd144e67 - Original-Request: - - req_8AzdCIco8PUIix - Request-Id: - - req_8AzdCIco8PUIix - Stripe-Should-Retry: - - 'false' - Stripe-Version: - - '2023-10-16' - Vary: - - Origin - X-Stripe-Routing-Context-Priority-Tier: - - api-testmode - Strict-Transport-Security: - - max-age=63072000; includeSubDomains; preload - body: - encoding: UTF-8 - string: |- - { - "id": "pm_1OoDPEKuuB1fWySn9FVslQQ3", - "object": "payment_method", - "billing_details": { - "address": { - "city": null, - "country": null, - "line1": null, - "line2": null, - "postal_code": null, - "state": null - }, - "email": null, - "name": null, - "phone": null - }, - "card": { - "brand": "visa", - "checks": { - "address_line1_check": null, - "address_postal_code_check": null, - "cvc_check": "unchecked" - }, - "country": "US", - "display_brand": "visa", - "exp_month": 8, - "exp_year": 2025, - "fingerprint": "6E6tgVjx6U65iHFV", - "funding": "credit", - "generated_from": null, - "last4": "4242", - "networks": { - "available": [ - "visa" - ], - "preferred": null - }, - "three_d_secure_usage": { - "supported": true - }, - "wallet": null - }, - "created": 1708989380, - "customer": null, - "livemode": false, - "metadata": {}, - "type": "card" - } - recorded_at: Mon, 26 Feb 2024 23:16:20 GMT -- request: - method: get - uri: https://api.stripe.com/v1/customers/non_existing_customer_id - body: - encoding: US-ASCII - string: '' - headers: - User-Agent: - - Stripe/v1 RubyBindings/10.10.0 - Authorization: - - Bearer - Content-Type: - - application/x-www-form-urlencoded - X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_8AzdCIco8PUIix","request_duration_ms":505}}' - Stripe-Version: - - '2023-10-16' - X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 404 - message: Not Found - headers: - Server: - - nginx - Date: - - Mon, 26 Feb 2024 23:16:20 GMT - Content-Type: - - application/json - Content-Length: - - '339' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Methods: - - GET,HEAD,PUT,PATCH,POST,DELETE - Access-Control-Allow-Origin: - - "*" - Access-Control-Expose-Headers: - - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, - X-Stripe-Privileged-Session-Required - Access-Control-Max-Age: - - '300' - Cache-Control: - - no-cache, no-store - Content-Security-Policy: - - report-uri https://q.stripe.com/csp-report?p=v1%2Fcustomers%2F%3Acustomer; - block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action - 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; - style-src 'self' - Request-Id: - - req_O11rogBMRB0GA3 - Stripe-Version: - - '2023-10-16' - Vary: - - Origin - X-Stripe-Routing-Context-Priority-Tier: - - api-testmode - Strict-Transport-Security: - - max-age=63072000; includeSubDomains; preload - body: - encoding: UTF-8 - string: | - { - "error": { - "code": "resource_missing", - "doc_url": "https://stripe.com/docs/error-codes/resource-missing", - "message": "No such customer: 'non_existing_customer_id'", - "param": "id", - "request_log_url": "https://dashboard.stripe.com/test/logs/req_O11rogBMRB0GA3?t=1708989380", - "type": "invalid_request_error" - } - } - recorded_at: Mon, 26 Feb 2024 23:16:20 GMT -recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_CreditCardRemover/_remove/Stripe_customer_exists/and_is_deleted/deletes_the_credit_card_clone.yml b/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_CreditCardRemover/_remove/Stripe_customer_exists/and_is_deleted/deletes_the_credit_card_clone.yml deleted file mode 100644 index c1e2d0188f..0000000000 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_CreditCardRemover/_remove/Stripe_customer_exists/and_is_deleted/deletes_the_credit_card_clone.yml +++ /dev/null @@ -1,363 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.stripe.com/v1/payment_methods - body: - encoding: UTF-8 - string: type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2025&card[cvc]=314 - headers: - User-Agent: - - Stripe/v1 RubyBindings/10.10.0 - Authorization: - - Bearer - Content-Type: - - application/x-www-form-urlencoded - X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_jagI9P8dKgmSWe","request_duration_ms":398}}' - Stripe-Version: - - '2023-10-16' - X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx - Date: - - Mon, 26 Feb 2024 23:16:18 GMT - Content-Type: - - application/json - Content-Length: - - '959' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Methods: - - GET,HEAD,PUT,PATCH,POST,DELETE - Access-Control-Allow-Origin: - - "*" - Access-Control-Expose-Headers: - - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, - X-Stripe-Privileged-Session-Required - Access-Control-Max-Age: - - '300' - Cache-Control: - - no-cache, no-store - Content-Security-Policy: - - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; - default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; - img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' - Idempotency-Key: - - 0b91afe4-236d-4294-bf8d-93c912ff4988 - Original-Request: - - req_UAGWuxx3yA5Vv4 - Request-Id: - - req_UAGWuxx3yA5Vv4 - Stripe-Should-Retry: - - 'false' - Stripe-Version: - - '2023-10-16' - Vary: - - Origin - X-Stripe-Routing-Context-Priority-Tier: - - api-testmode - Strict-Transport-Security: - - max-age=63072000; includeSubDomains; preload - body: - encoding: UTF-8 - string: |- - { - "id": "pm_1OoDPCKuuB1fWySndu16bikJ", - "object": "payment_method", - "billing_details": { - "address": { - "city": null, - "country": null, - "line1": null, - "line2": null, - "postal_code": null, - "state": null - }, - "email": null, - "name": null, - "phone": null - }, - "card": { - "brand": "visa", - "checks": { - "address_line1_check": null, - "address_postal_code_check": null, - "cvc_check": "unchecked" - }, - "country": "US", - "display_brand": "visa", - "exp_month": 8, - "exp_year": 2025, - "fingerprint": "6E6tgVjx6U65iHFV", - "funding": "credit", - "generated_from": null, - "last4": "4242", - "networks": { - "available": [ - "visa" - ], - "preferred": null - }, - "three_d_secure_usage": { - "supported": true - }, - "wallet": null - }, - "created": 1708989378, - "customer": null, - "livemode": false, - "metadata": {}, - "type": "card" - } - recorded_at: Mon, 26 Feb 2024 23:16:18 GMT -- request: - method: post - uri: https://api.stripe.com/v1/customers - body: - encoding: UTF-8 - string: name=Apple+Customer&email=applecustomer%40example.com - headers: - User-Agent: - - Stripe/v1 RubyBindings/10.10.0 - Authorization: - - Bearer - Content-Type: - - application/x-www-form-urlencoded - X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_UAGWuxx3yA5Vv4","request_duration_ms":444}}' - Stripe-Version: - - '2023-10-16' - X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx - Date: - - Mon, 26 Feb 2024 23:16:19 GMT - Content-Type: - - application/json - Content-Length: - - '649' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Methods: - - GET,HEAD,PUT,PATCH,POST,DELETE - Access-Control-Allow-Origin: - - "*" - Access-Control-Expose-Headers: - - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, - X-Stripe-Privileged-Session-Required - Access-Control-Max-Age: - - '300' - Cache-Control: - - no-cache, no-store - Content-Security-Policy: - - report-uri https://q.stripe.com/csp-report?p=v1%2Fcustomers; block-all-mixed-content; - default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; - img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' - Idempotency-Key: - - 6d27457a-76ef-46b5-a5c9-de32b1c27b49 - Original-Request: - - req_0av87H3OplRDPq - Request-Id: - - req_0av87H3OplRDPq - Stripe-Should-Retry: - - 'false' - Stripe-Version: - - '2023-10-16' - Vary: - - Origin - X-Stripe-Routing-Context-Priority-Tier: - - api-testmode - Strict-Transport-Security: - - max-age=63072000; includeSubDomains; preload - body: - encoding: UTF-8 - string: |- - { - "id": "cus_PdUNmATwItHxBf", - "object": "customer", - "address": null, - "balance": 0, - "created": 1708989379, - "currency": null, - "default_source": null, - "delinquent": false, - "description": null, - "discount": null, - "email": "applecustomer@example.com", - "invoice_prefix": "DDFA35D2", - "invoice_settings": { - "custom_fields": null, - "default_payment_method": null, - "footer": null, - "rendering_options": null - }, - "livemode": false, - "metadata": {}, - "name": "Apple Customer", - "next_invoice_sequence": 1, - "phone": null, - "preferred_locales": [], - "shipping": null, - "tax_exempt": "none", - "test_clock": null - } - recorded_at: Mon, 26 Feb 2024 23:16:19 GMT -- request: - method: post - uri: https://api.stripe.com/v1/payment_methods/pm_1OoDPCKuuB1fWySndu16bikJ/attach - body: - encoding: UTF-8 - string: customer=cus_PdUNmATwItHxBf - headers: - User-Agent: - - Stripe/v1 RubyBindings/10.10.0 - Authorization: - - Bearer - Content-Type: - - application/x-www-form-urlencoded - X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_0av87H3OplRDPq","request_duration_ms":386}}' - Stripe-Version: - - '2023-10-16' - X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - response: - status: - code: 200 - message: OK - headers: - Server: - - nginx - Date: - - Mon, 26 Feb 2024 23:16:19 GMT - Content-Type: - - application/json - Content-Length: - - '970' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Access-Control-Allow-Methods: - - GET,HEAD,PUT,PATCH,POST,DELETE - Access-Control-Allow-Origin: - - "*" - Access-Control-Expose-Headers: - - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, - X-Stripe-Privileged-Session-Required - Access-Control-Max-Age: - - '300' - Cache-Control: - - no-cache, no-store - Content-Security-Policy: - - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods%2F%3Apayment_method%2Fattach; - block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action - 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; - style-src 'self' - Idempotency-Key: - - 6b24e01a-4589-4ec7-80fa-e4bd5b3b9260 - Original-Request: - - req_B0FhYsp0bBTNRp - Request-Id: - - req_B0FhYsp0bBTNRp - Stripe-Should-Retry: - - 'false' - Stripe-Version: - - '2023-10-16' - Vary: - - Origin - X-Stripe-Routing-Context-Priority-Tier: - - api-testmode - Strict-Transport-Security: - - max-age=63072000; includeSubDomains; preload - body: - encoding: UTF-8 - string: |- - { - "id": "pm_1OoDPCKuuB1fWySndu16bikJ", - "object": "payment_method", - "billing_details": { - "address": { - "city": null, - "country": null, - "line1": null, - "line2": null, - "postal_code": null, - "state": null - }, - "email": null, - "name": null, - "phone": null - }, - "card": { - "brand": "visa", - "checks": { - "address_line1_check": null, - "address_postal_code_check": null, - "cvc_check": "pass" - }, - "country": "US", - "display_brand": "visa", - "exp_month": 8, - "exp_year": 2025, - "fingerprint": "6E6tgVjx6U65iHFV", - "funding": "credit", - "generated_from": null, - "last4": "4242", - "networks": { - "available": [ - "visa" - ], - "preferred": null - }, - "three_d_secure_usage": { - "supported": true - }, - "wallet": null - }, - "created": 1708989378, - "customer": "cus_PdUNmATwItHxBf", - "livemode": false, - "metadata": {}, - "type": "card" - } - recorded_at: Mon, 26 Feb 2024 23:16:19 GMT -recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Admin_StripeAccountsController/_destroy/when_the_specified_stripe_account_exists/when_I_don_t_manage_the_enterprise_linked_to_the_stripe_account/redirects_to_unauthorized.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Admin_StripeAccountsController/_destroy/when_the_specified_stripe_account_exists/when_I_don_t_manage_the_enterprise_linked_to_the_stripe_account/redirects_to_unauthorized.yml new file mode 100644 index 0000000000..3a196f6441 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Admin_StripeAccountsController/_destroy/when_the_specified_stripe_account_exists/when_I_don_t_manage_the_enterprise_linked_to_the_stripe_account/redirects_to_unauthorized.yml @@ -0,0 +1,316 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.stripe.com/v1/accounts + body: + encoding: UTF-8 + string: type=standard&country=AU&email=jumping.jack%40example.com&business_type=non_profit + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:37:33 GMT + Content-Type: + - application/json + Content-Length: + - '3527' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Idempotency-Key: + - 6266cc7b-b56f-4446-8557-addbc346af95 + Original-Request: + - req_uKZJaQKuSDhybO + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_uKZJaQKuSDhybO + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h6dQOo80tSvJZ", + "object": "account", + "business_profile": { + "annual_revenue": null, + "estimated_worker_count": null, + "mcc": null, + "name": null, + "product_description": null, + "support_address": null, + "support_email": null, + "support_phone": null, + "support_url": null, + "url": null + }, + "business_type": "non_profit", + "capabilities": {}, + "charges_enabled": false, + "company": { + "address": { + "city": null, + "country": "AU", + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "directors_provided": false, + "executives_provided": false, + "name": null, + "owners_provided": false, + "tax_id_provided": false, + "verification": { + "document": { + "back": null, + "details": null, + "details_code": null, + "front": null + } + } + }, + "controller": { + "is_controller": true, + "type": "application" + }, + "country": "AU", + "created": 1713393452, + "default_currency": "aud", + "details_submitted": false, + "email": "jumping.jack@example.com", + "external_accounts": { + "object": "list", + "data": [], + "has_more": false, + "total_count": 0, + "url": "/v1/accounts/acct_1P6h6dQOo80tSvJZ/external_accounts" + }, + "future_requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [], + "disabled_reason": null, + "errors": [], + "eventually_due": [], + "past_due": [], + "pending_verification": [] + }, + "metadata": {}, + "payouts_enabled": false, + "requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "disabled_reason": "requirements.past_due", + "errors": [], + "eventually_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "past_due": [ + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "pending_verification": [] + }, + "settings": { + "bacs_debit_payments": { + "display_name": null, + "service_user_number": null + }, + "branding": { + "icon": null, + "logo": null, + "primary_color": null, + "secondary_color": null + }, + "card_issuing": { + "tos_acceptance": { + "date": null, + "ip": null + } + }, + "card_payments": { + "decline_on": { + "avs_failure": false, + "cvc_failure": false + }, + "statement_descriptor_prefix": null, + "statement_descriptor_prefix_kana": null, + "statement_descriptor_prefix_kanji": null + }, + "dashboard": { + "display_name": null, + "timezone": "Etc/UTC" + }, + "invoices": { + "default_account_tax_ids": null + }, + "payments": { + "statement_descriptor": null, + "statement_descriptor_kana": null, + "statement_descriptor_kanji": null + }, + "payouts": { + "debit_negative_balances": true, + "schedule": { + "delay_days": 2, + "interval": "daily" + }, + "statement_descriptor": null + }, + "sepa_debit_payments": {} + }, + "tos_acceptance": { + "date": null, + "ip": null, + "user_agent": null + }, + "type": "standard" + } + recorded_at: Wed, 17 Apr 2024 22:37:33 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/accounts/acct_1P6h6dQOo80tSvJZ + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_uKZJaQKuSDhybO","request_duration_ms":2089}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:37:34 GMT + Content-Type: + - application/json + Content-Length: + - '77' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts%2F%3Aaccount; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_T7eaRcd0E6Y161 + Stripe-Account: + - acct_1P6h6dQOo80tSvJZ + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h6dQOo80tSvJZ", + "object": "account", + "deleted": true + } + recorded_at: Wed, 17 Apr 2024 22:37:34 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Admin_StripeAccountsController/_destroy/when_the_specified_stripe_account_exists/when_I_manage_the_enterprise_linked_to_the_stripe_account/and_the_attempt_to_deauthorize_and_destroy_fails/redirects_to_unauthorized.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Admin_StripeAccountsController/_destroy/when_the_specified_stripe_account_exists/when_I_manage_the_enterprise_linked_to_the_stripe_account/and_the_attempt_to_deauthorize_and_destroy_fails/redirects_to_unauthorized.yml new file mode 100644 index 0000000000..86e4459b62 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Admin_StripeAccountsController/_destroy/when_the_specified_stripe_account_exists/when_I_manage_the_enterprise_linked_to_the_stripe_account/and_the_attempt_to_deauthorize_and_destroy_fails/redirects_to_unauthorized.yml @@ -0,0 +1,318 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.stripe.com/v1/accounts + body: + encoding: UTF-8 + string: type=standard&country=AU&email=jumping.jack%40example.com&business_type=non_profit + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_ottmgqPZJsohY6","request_duration_ms":986}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:37:39 GMT + Content-Type: + - application/json + Content-Length: + - '3527' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Idempotency-Key: + - 6c371391-04b0-4255-800c-5464d0b2cfbf + Original-Request: + - req_w6FTmr1LhXdru9 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_w6FTmr1LhXdru9 + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h6kQQtxT4DM9I", + "object": "account", + "business_profile": { + "annual_revenue": null, + "estimated_worker_count": null, + "mcc": null, + "name": null, + "product_description": null, + "support_address": null, + "support_email": null, + "support_phone": null, + "support_url": null, + "url": null + }, + "business_type": "non_profit", + "capabilities": {}, + "charges_enabled": false, + "company": { + "address": { + "city": null, + "country": "AU", + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "directors_provided": false, + "executives_provided": false, + "name": null, + "owners_provided": false, + "tax_id_provided": false, + "verification": { + "document": { + "back": null, + "details": null, + "details_code": null, + "front": null + } + } + }, + "controller": { + "is_controller": true, + "type": "application" + }, + "country": "AU", + "created": 1713393458, + "default_currency": "aud", + "details_submitted": false, + "email": "jumping.jack@example.com", + "external_accounts": { + "object": "list", + "data": [], + "has_more": false, + "total_count": 0, + "url": "/v1/accounts/acct_1P6h6kQQtxT4DM9I/external_accounts" + }, + "future_requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [], + "disabled_reason": null, + "errors": [], + "eventually_due": [], + "past_due": [], + "pending_verification": [] + }, + "metadata": {}, + "payouts_enabled": false, + "requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "disabled_reason": "requirements.past_due", + "errors": [], + "eventually_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "past_due": [ + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "pending_verification": [] + }, + "settings": { + "bacs_debit_payments": { + "display_name": null, + "service_user_number": null + }, + "branding": { + "icon": null, + "logo": null, + "primary_color": null, + "secondary_color": null + }, + "card_issuing": { + "tos_acceptance": { + "date": null, + "ip": null + } + }, + "card_payments": { + "decline_on": { + "avs_failure": false, + "cvc_failure": false + }, + "statement_descriptor_prefix": null, + "statement_descriptor_prefix_kana": null, + "statement_descriptor_prefix_kanji": null + }, + "dashboard": { + "display_name": null, + "timezone": "Etc/UTC" + }, + "invoices": { + "default_account_tax_ids": null + }, + "payments": { + "statement_descriptor": null, + "statement_descriptor_kana": null, + "statement_descriptor_kanji": null + }, + "payouts": { + "debit_negative_balances": true, + "schedule": { + "delay_days": 2, + "interval": "daily" + }, + "statement_descriptor": null + }, + "sepa_debit_payments": {} + }, + "tos_acceptance": { + "date": null, + "ip": null, + "user_agent": null + }, + "type": "standard" + } + recorded_at: Wed, 17 Apr 2024 22:37:39 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/accounts/acct_1P6h6kQQtxT4DM9I + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_w6FTmr1LhXdru9","request_duration_ms":1868}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:37:40 GMT + Content-Type: + - application/json + Content-Length: + - '77' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts%2F%3Aaccount; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_5DMoWYyBuGKko3 + Stripe-Account: + - acct_1P6h6kQQtxT4DM9I + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h6kQQtxT4DM9I", + "object": "account", + "deleted": true + } + recorded_at: Wed, 17 Apr 2024 22:37:40 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Admin_StripeAccountsController/_destroy/when_the_specified_stripe_account_exists/when_I_manage_the_enterprise_linked_to_the_stripe_account/and_the_attempt_to_deauthorize_and_destroy_succeeds/redirects_to_unauthorized.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Admin_StripeAccountsController/_destroy/when_the_specified_stripe_account_exists/when_I_manage_the_enterprise_linked_to_the_stripe_account/and_the_attempt_to_deauthorize_and_destroy_succeeds/redirects_to_unauthorized.yml new file mode 100644 index 0000000000..0053eb05bd --- /dev/null +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Admin_StripeAccountsController/_destroy/when_the_specified_stripe_account_exists/when_I_manage_the_enterprise_linked_to_the_stripe_account/and_the_attempt_to_deauthorize_and_destroy_succeeds/redirects_to_unauthorized.yml @@ -0,0 +1,318 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.stripe.com/v1/accounts + body: + encoding: UTF-8 + string: type=standard&country=AU&email=jumping.jack%40example.com&business_type=non_profit + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_T7eaRcd0E6Y161","request_duration_ms":1216}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:37:36 GMT + Content-Type: + - application/json + Content-Length: + - '3527' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Idempotency-Key: + - 16d66af6-ad46-4adb-99ec-05752fad61aa + Original-Request: + - req_Yyz2weH5ozAFpu + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_Yyz2weH5ozAFpu + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h6h4DyRLVxKpr", + "object": "account", + "business_profile": { + "annual_revenue": null, + "estimated_worker_count": null, + "mcc": null, + "name": null, + "product_description": null, + "support_address": null, + "support_email": null, + "support_phone": null, + "support_url": null, + "url": null + }, + "business_type": "non_profit", + "capabilities": {}, + "charges_enabled": false, + "company": { + "address": { + "city": null, + "country": "AU", + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "directors_provided": false, + "executives_provided": false, + "name": null, + "owners_provided": false, + "tax_id_provided": false, + "verification": { + "document": { + "back": null, + "details": null, + "details_code": null, + "front": null + } + } + }, + "controller": { + "is_controller": true, + "type": "application" + }, + "country": "AU", + "created": 1713393456, + "default_currency": "aud", + "details_submitted": false, + "email": "jumping.jack@example.com", + "external_accounts": { + "object": "list", + "data": [], + "has_more": false, + "total_count": 0, + "url": "/v1/accounts/acct_1P6h6h4DyRLVxKpr/external_accounts" + }, + "future_requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [], + "disabled_reason": null, + "errors": [], + "eventually_due": [], + "past_due": [], + "pending_verification": [] + }, + "metadata": {}, + "payouts_enabled": false, + "requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "disabled_reason": "requirements.past_due", + "errors": [], + "eventually_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "past_due": [ + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "pending_verification": [] + }, + "settings": { + "bacs_debit_payments": { + "display_name": null, + "service_user_number": null + }, + "branding": { + "icon": null, + "logo": null, + "primary_color": null, + "secondary_color": null + }, + "card_issuing": { + "tos_acceptance": { + "date": null, + "ip": null + } + }, + "card_payments": { + "decline_on": { + "avs_failure": false, + "cvc_failure": false + }, + "statement_descriptor_prefix": null, + "statement_descriptor_prefix_kana": null, + "statement_descriptor_prefix_kanji": null + }, + "dashboard": { + "display_name": null, + "timezone": "Etc/UTC" + }, + "invoices": { + "default_account_tax_ids": null + }, + "payments": { + "statement_descriptor": null, + "statement_descriptor_kana": null, + "statement_descriptor_kanji": null + }, + "payouts": { + "debit_negative_balances": true, + "schedule": { + "delay_days": 2, + "interval": "daily" + }, + "statement_descriptor": null + }, + "sepa_debit_payments": {} + }, + "tos_acceptance": { + "date": null, + "ip": null, + "user_agent": null + }, + "type": "standard" + } + recorded_at: Wed, 17 Apr 2024 22:37:36 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/accounts/acct_1P6h6h4DyRLVxKpr + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_Yyz2weH5ozAFpu","request_duration_ms":1745}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:37:37 GMT + Content-Type: + - application/json + Content-Length: + - '77' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts%2F%3Aaccount; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_ottmgqPZJsohY6 + Stripe-Account: + - acct_1P6h6h4DyRLVxKpr + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h6h4DyRLVxKpr", + "object": "account", + "deleted": true + } + recorded_at: Wed, 17 Apr 2024 22:37:37 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Admin_StripeAccountsController/_status/when_I_manage_the_specified_enterprise/when_Stripe_is_enabled/when_a_stripe_account_is_associated_with_the_specified_enterprise/but_access_has_been_revoked_or_does_not_exist_on_stripe_s_servers/returns_with_a_status_of_access_revoked_.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Admin_StripeAccountsController/_status/when_I_manage_the_specified_enterprise/when_Stripe_is_enabled/when_a_stripe_account_is_associated_with_the_specified_enterprise/but_access_has_been_revoked_or_does_not_exist_on_stripe_s_servers/returns_with_a_status_of_access_revoked_.yml new file mode 100644 index 0000000000..6e7777dcfa --- /dev/null +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Admin_StripeAccountsController/_status/when_I_manage_the_specified_enterprise/when_Stripe_is_enabled/when_a_stripe_account_is_associated_with_the_specified_enterprise/but_access_has_been_revoked_or_does_not_exist_on_stripe_s_servers/returns_with_a_status_of_access_revoked_.yml @@ -0,0 +1,385 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.stripe.com/v1/accounts + body: + encoding: UTF-8 + string: type=standard&country=AU&email=jumping.jack%40example.com&business_type=non_profit + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_5DMoWYyBuGKko3","request_duration_ms":1107}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:37:42 GMT + Content-Type: + - application/json + Content-Length: + - '3527' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Idempotency-Key: + - f8ba1e63-f1ed-4496-a1cf-e91f5b070224 + Original-Request: + - req_eup7iQgNj4TnQb + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_eup7iQgNj4TnQb + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h6nQTJVHFbeTF", + "object": "account", + "business_profile": { + "annual_revenue": null, + "estimated_worker_count": null, + "mcc": null, + "name": null, + "product_description": null, + "support_address": null, + "support_email": null, + "support_phone": null, + "support_url": null, + "url": null + }, + "business_type": "non_profit", + "capabilities": {}, + "charges_enabled": false, + "company": { + "address": { + "city": null, + "country": "AU", + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "directors_provided": false, + "executives_provided": false, + "name": null, + "owners_provided": false, + "tax_id_provided": false, + "verification": { + "document": { + "back": null, + "details": null, + "details_code": null, + "front": null + } + } + }, + "controller": { + "is_controller": true, + "type": "application" + }, + "country": "AU", + "created": 1713393461, + "default_currency": "aud", + "details_submitted": false, + "email": "jumping.jack@example.com", + "external_accounts": { + "object": "list", + "data": [], + "has_more": false, + "total_count": 0, + "url": "/v1/accounts/acct_1P6h6nQTJVHFbeTF/external_accounts" + }, + "future_requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [], + "disabled_reason": null, + "errors": [], + "eventually_due": [], + "past_due": [], + "pending_verification": [] + }, + "metadata": {}, + "payouts_enabled": false, + "requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "disabled_reason": "requirements.past_due", + "errors": [], + "eventually_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "past_due": [ + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "pending_verification": [] + }, + "settings": { + "bacs_debit_payments": { + "display_name": null, + "service_user_number": null + }, + "branding": { + "icon": null, + "logo": null, + "primary_color": null, + "secondary_color": null + }, + "card_issuing": { + "tos_acceptance": { + "date": null, + "ip": null + } + }, + "card_payments": { + "decline_on": { + "avs_failure": false, + "cvc_failure": false + }, + "statement_descriptor_prefix": null, + "statement_descriptor_prefix_kana": null, + "statement_descriptor_prefix_kanji": null + }, + "dashboard": { + "display_name": null, + "timezone": "Etc/UTC" + }, + "invoices": { + "default_account_tax_ids": null + }, + "payments": { + "statement_descriptor": null, + "statement_descriptor_kana": null, + "statement_descriptor_kanji": null + }, + "payouts": { + "debit_negative_balances": true, + "schedule": { + "delay_days": 2, + "interval": "daily" + }, + "statement_descriptor": null + }, + "sepa_debit_payments": {} + }, + "tos_acceptance": { + "date": null, + "ip": null, + "user_agent": null + }, + "type": "standard" + } + recorded_at: Wed, 17 Apr 2024 22:37:42 GMT +- request: + method: get + uri: https://api.stripe.com/v1/accounts/acct_fake_account + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_eup7iQgNj4TnQb","request_duration_ms":1730}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 403 + message: Forbidden + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:37:42 GMT + Content-Type: + - application/json + Content-Length: + - '366' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Vary: + - Origin + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "error": { + "message": "The provided key 'sk_test_******************************uCJm' does not have access to account 'acct_fake_account' (or that account does not exist). Application access may have been revoked.", + "type": "invalid_request_error", + "code": "account_invalid", + "doc_url": "https://stripe.com/docs/error-codes/account-invalid" + } + } + recorded_at: Wed, 17 Apr 2024 22:37:42 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/accounts/acct_1P6h6nQTJVHFbeTF + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_eup7iQgNj4TnQb","request_duration_ms":1730}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:37:43 GMT + Content-Type: + - application/json + Content-Length: + - '77' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts%2F%3Aaccount; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_uQmePD7HhxAqfq + Stripe-Account: + - acct_1P6h6nQTJVHFbeTF + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h6nQTJVHFbeTF", + "object": "account", + "deleted": true + } + recorded_at: Wed, 17 Apr 2024 22:37:43 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Admin_StripeAccountsController/_status/when_I_manage_the_specified_enterprise/when_Stripe_is_enabled/when_a_stripe_account_is_associated_with_the_specified_enterprise/which_is_connected/returns_with_a_status_of_connected_.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Admin_StripeAccountsController/_status/when_I_manage_the_specified_enterprise/when_Stripe_is_enabled/when_a_stripe_account_is_associated_with_the_specified_enterprise/which_is_connected/returns_with_a_status_of_connected_.yml new file mode 100644 index 0000000000..e03b7f10e1 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Admin_StripeAccountsController/_status/when_I_manage_the_specified_enterprise/when_Stripe_is_enabled/when_a_stripe_account_is_associated_with_the_specified_enterprise/which_is_connected/returns_with_a_status_of_connected_.yml @@ -0,0 +1,547 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.stripe.com/v1/accounts + body: + encoding: UTF-8 + string: type=standard&country=AU&email=jumping.jack%40example.com&business_type=non_profit + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_uQmePD7HhxAqfq","request_duration_ms":1015}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:37:45 GMT + Content-Type: + - application/json + Content-Length: + - '3527' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Idempotency-Key: + - 6e58444a-cd31-4d87-a7c8-bd92862e3f13 + Original-Request: + - req_fVgom9Vx38Xifc + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_fVgom9Vx38Xifc + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h6q4EUB0qRIux", + "object": "account", + "business_profile": { + "annual_revenue": null, + "estimated_worker_count": null, + "mcc": null, + "name": null, + "product_description": null, + "support_address": null, + "support_email": null, + "support_phone": null, + "support_url": null, + "url": null + }, + "business_type": "non_profit", + "capabilities": {}, + "charges_enabled": false, + "company": { + "address": { + "city": null, + "country": "AU", + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "directors_provided": false, + "executives_provided": false, + "name": null, + "owners_provided": false, + "tax_id_provided": false, + "verification": { + "document": { + "back": null, + "details": null, + "details_code": null, + "front": null + } + } + }, + "controller": { + "is_controller": true, + "type": "application" + }, + "country": "AU", + "created": 1713393464, + "default_currency": "aud", + "details_submitted": false, + "email": "jumping.jack@example.com", + "external_accounts": { + "object": "list", + "data": [], + "has_more": false, + "total_count": 0, + "url": "/v1/accounts/acct_1P6h6q4EUB0qRIux/external_accounts" + }, + "future_requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [], + "disabled_reason": null, + "errors": [], + "eventually_due": [], + "past_due": [], + "pending_verification": [] + }, + "metadata": {}, + "payouts_enabled": false, + "requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "disabled_reason": "requirements.past_due", + "errors": [], + "eventually_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "past_due": [ + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "pending_verification": [] + }, + "settings": { + "bacs_debit_payments": { + "display_name": null, + "service_user_number": null + }, + "branding": { + "icon": null, + "logo": null, + "primary_color": null, + "secondary_color": null + }, + "card_issuing": { + "tos_acceptance": { + "date": null, + "ip": null + } + }, + "card_payments": { + "decline_on": { + "avs_failure": false, + "cvc_failure": false + }, + "statement_descriptor_prefix": null, + "statement_descriptor_prefix_kana": null, + "statement_descriptor_prefix_kanji": null + }, + "dashboard": { + "display_name": null, + "timezone": "Etc/UTC" + }, + "invoices": { + "default_account_tax_ids": null + }, + "payments": { + "statement_descriptor": null, + "statement_descriptor_kana": null, + "statement_descriptor_kanji": null + }, + "payouts": { + "debit_negative_balances": true, + "schedule": { + "delay_days": 2, + "interval": "daily" + }, + "statement_descriptor": null + }, + "sepa_debit_payments": {} + }, + "tos_acceptance": { + "date": null, + "ip": null, + "user_agent": null + }, + "type": "standard" + } + recorded_at: Wed, 17 Apr 2024 22:37:45 GMT +- request: + method: get + uri: https://api.stripe.com/v1/accounts/acct_1P6h6q4EUB0qRIux + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_fVgom9Vx38Xifc","request_duration_ms":1937}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:37:46 GMT + Content-Type: + - application/json + Content-Length: + - '3527' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts%2F%3Aaccount; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_Mt3HFeik0lC10y + Stripe-Account: + - acct_1P6h6q4EUB0qRIux + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h6q4EUB0qRIux", + "object": "account", + "business_profile": { + "annual_revenue": null, + "estimated_worker_count": null, + "mcc": null, + "name": null, + "product_description": null, + "support_address": null, + "support_email": null, + "support_phone": null, + "support_url": null, + "url": null + }, + "business_type": "non_profit", + "capabilities": {}, + "charges_enabled": false, + "company": { + "address": { + "city": null, + "country": "AU", + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "directors_provided": false, + "executives_provided": false, + "name": null, + "owners_provided": false, + "tax_id_provided": false, + "verification": { + "document": { + "back": null, + "details": null, + "details_code": null, + "front": null + } + } + }, + "controller": { + "is_controller": true, + "type": "application" + }, + "country": "AU", + "created": 1713393464, + "default_currency": "aud", + "details_submitted": false, + "email": "jumping.jack@example.com", + "external_accounts": { + "object": "list", + "data": [], + "has_more": false, + "total_count": 0, + "url": "/v1/accounts/acct_1P6h6q4EUB0qRIux/external_accounts" + }, + "future_requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [], + "disabled_reason": null, + "errors": [], + "eventually_due": [], + "past_due": [], + "pending_verification": [] + }, + "metadata": {}, + "payouts_enabled": false, + "requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "disabled_reason": "requirements.past_due", + "errors": [], + "eventually_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "past_due": [ + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "pending_verification": [] + }, + "settings": { + "bacs_debit_payments": { + "display_name": null, + "service_user_number": null + }, + "branding": { + "icon": null, + "logo": null, + "primary_color": null, + "secondary_color": null + }, + "card_issuing": { + "tos_acceptance": { + "date": null, + "ip": null + } + }, + "card_payments": { + "decline_on": { + "avs_failure": false, + "cvc_failure": false + }, + "statement_descriptor_prefix": null, + "statement_descriptor_prefix_kana": null, + "statement_descriptor_prefix_kanji": null + }, + "dashboard": { + "display_name": null, + "timezone": "Etc/UTC" + }, + "invoices": { + "default_account_tax_ids": null + }, + "payments": { + "statement_descriptor": null, + "statement_descriptor_kana": null, + "statement_descriptor_kanji": null + }, + "payouts": { + "debit_negative_balances": true, + "schedule": { + "delay_days": 2, + "interval": "daily" + }, + "statement_descriptor": null + }, + "sepa_debit_payments": {} + }, + "tos_acceptance": { + "date": null, + "ip": null, + "user_agent": null + }, + "type": "standard" + } + recorded_at: Wed, 17 Apr 2024 22:37:46 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/accounts/acct_1P6h6q4EUB0qRIux + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_Mt3HFeik0lC10y","request_duration_ms":464}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:37:47 GMT + Content-Type: + - application/json + Content-Length: + - '77' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts%2F%3Aaccount; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_8rH0FEVsdRhHGG + Stripe-Account: + - acct_1P6h6q4EUB0qRIux + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h6q4EUB0qRIux", + "object": "account", + "deleted": true + } + recorded_at: Wed, 17 Apr 2024 22:37:47 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_CreditCardsController/using_VCR/_new_from_token/when_the_request_to_store_the_customer/card_with_Stripe_is_successful/saves_the_card_locally.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_CreditCardsController/using_VCR/_new_from_token/when_the_request_to_store_the_customer/card_with_Stripe_is_successful/saves_the_card_locally.yml similarity index 71% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_CreditCardsController/using_VCR/_new_from_token/when_the_request_to_store_the_customer/card_with_Stripe_is_successful/saves_the_card_locally.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_CreditCardsController/using_VCR/_new_from_token/when_the_request_to_store_the_customer/card_with_Stripe_is_successful/saves_the_card_locally.yml index 2b5bca5272..bba35246bc 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_CreditCardsController/using_VCR/_new_from_token/when_the_request_to_store_the_customer/card_with_Stripe_is_successful/saves_the_card_locally.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_CreditCardsController/using_VCR/_new_from_token/when_the_request_to_store_the_customer/card_with_Stripe_is_successful/saves_the_card_locally.yml @@ -8,18 +8,17 @@ http_interactions: string: card[number]=4242424242424242&card[exp_month]=9&card[exp_year]=2024&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_8rH0FEVsdRhHGG","request_duration_ms":1027}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -32,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:05 GMT + - Wed, 17 Apr 2024 22:37:48 GMT Content-Type: - application/json Content-Length: - - '850' + - '848' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -56,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Ftokens; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 606d6e97-76cd-4483-b3b6-80f03f3f68ec + - bb83e217-3608-4df7-add8-ae52eb34614c Original-Request: - - req_W0FTNkXUslyGbo + - req_prEMClalBG6c2Q + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_W0FTNkXUslyGbo + - req_prEMClalBG6c2Q Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -76,10 +81,10 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "tok_1OoDOzKuuB1fWySnkUeLfdE0", + "id": "tok_1P6h6uKuuB1fWySnZzdkqGYm", "object": "token", "card": { - "id": "card_1OoDOzKuuB1fWySn26fKjH8z", + "id": "card_1P6h6uKuuB1fWySnJZfX2tRv", "object": "card", "address_city": null, "address_country": null, @@ -106,35 +111,32 @@ http_interactions: "tokenization_method": null, "wallet": null }, - "client_ip": "124.188.129.192", - "created": 1708989365, + "client_ip": "115.166.33.14", + "created": 1713393468, "livemode": false, "type": "card", "used": false } - recorded_at: Mon, 26 Feb 2024 23:16:05 GMT + recorded_at: Wed, 17 Apr 2024 22:37:48 GMT - request: method: post uri: https://api.stripe.com/v1/customers body: encoding: UTF-8 - string: email=karena_dickinson%40kuhlman.ca&source=tok_1OoDOzKuuB1fWySnkUeLfdE0 + string: email=marc%40christiansen.name&source=tok_1P6h6uKuuB1fWySnZzdkqGYm headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_W0FTNkXUslyGbo","request_duration_ms":533}}' + - '{"last_request_metrics":{"request_id":"req_prEMClalBG6c2Q","request_duration_ms":559}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -147,11 +149,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:06 GMT + - Wed, 17 Apr 2024 22:37:49 GMT Content-Type: - application/json Content-Length: - - '666' + - '661' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -171,16 +173,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fcustomers; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 1169b4a3-4493-48e0-96d0-24d1aaa965d2 + - c554622b-1bb1-4a21-924e-10e2d89ee3c4 Original-Request: - - req_DMHZU8xd2ShaRW + - req_9WRw9Wa3q4aW4L + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_DMHZU8xd2ShaRW + - req_9WRw9Wa3q4aW4L Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -191,18 +199,18 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "cus_PdUNukPAyUst7M", + "id": "cus_PwaH4jTn93rX49", "object": "customer", "address": null, "balance": 0, - "created": 1708989366, + "created": 1713393468, "currency": null, - "default_source": "card_1OoDOzKuuB1fWySn26fKjH8z", + "default_source": "card_1P6h6uKuuB1fWySnJZfX2tRv", "delinquent": false, "description": null, "discount": null, - "email": "karena_dickinson@kuhlman.ca", - "invoice_prefix": "FC2002CD", + "email": "marc@christiansen.name", + "invoice_prefix": "C7DCDC14", "invoice_settings": { "custom_fields": null, "default_payment_method": null, @@ -219,29 +227,26 @@ http_interactions: "tax_exempt": "none", "test_clock": null } - recorded_at: Mon, 26 Feb 2024 23:16:06 GMT + recorded_at: Wed, 17 Apr 2024 22:37:49 GMT - request: method: get - uri: https://api.stripe.com/v1/customers/cus_PdUNukPAyUst7M/sources?limit=1&object=card + uri: https://api.stripe.com/v1/customers/cus_PwaH4jTn93rX49/sources?limit=1&object=card body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_DMHZU8xd2ShaRW","request_duration_ms":973}}' + - '{"last_request_metrics":{"request_id":"req_9WRw9Wa3q4aW4L","request_duration_ms":952}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -254,7 +259,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:07 GMT + - Wed, 17 Apr 2024 22:37:49 GMT Content-Type: - application/json Content-Length: @@ -279,10 +284,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_MZVWecwtG9mJav + - req_BHrjo9C9dXpZ55 Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -296,7 +307,7 @@ http_interactions: "object": "list", "data": [ { - "id": "card_1OoDOzKuuB1fWySn26fKjH8z", + "id": "card_1P6h6uKuuB1fWySnJZfX2tRv", "object": "card", "address_city": null, "address_country": null, @@ -308,7 +319,7 @@ http_interactions: "address_zip_check": null, "brand": "Visa", "country": "US", - "customer": "cus_PdUNukPAyUst7M", + "customer": "cus_PwaH4jTn93rX49", "cvc_check": "pass", "dynamic_last4": null, "exp_month": 9, @@ -323,7 +334,7 @@ http_interactions: } ], "has_more": false, - "url": "/v1/customers/cus_PdUNukPAyUst7M/sources" + "url": "/v1/customers/cus_PwaH4jTn93rX49/sources" } - recorded_at: Mon, 26 Feb 2024 23:16:07 GMT + recorded_at: Wed, 17 Apr 2024 22:37:50 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_Gateway_StripeSCA/_credit/refunds_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_credit/refunds_the_payment.yml similarity index 75% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_Gateway_StripeSCA/_credit/refunds_the_payment.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_credit/refunds_the_payment.yml index 55f69d9eb6..0c028c3f77 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_Gateway_StripeSCA/_credit/refunds_the_payment.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_credit/refunds_the_payment.yml @@ -8,20 +8,17 @@ http_interactions: string: type=standard&country=AU&email=carrot.producer%40example.com headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_o2i92svEF6wZ9X","request_duration_ms":396}}' + - '{"last_request_metrics":{"request_id":"req_B60iS3d4eUM92l","request_duration_ms":1125}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,7 +31,7 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:23:09 GMT + - Wed, 17 Apr 2024 22:40:44 GMT Content-Type: - application/json Content-Length: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 3d3d1721-0516-4615-b6d1-dcf32c7fe0b2 + - 5ff55d3e-081a-405c-833a-8f70c6abd27a Original-Request: - - req_FYW1iyKrExg9pI + - req_jm8Rl8sU7tI0UM + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_FYW1iyKrExg9pI + - req_jm8Rl8sU7tI0UM Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,7 +81,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "acct_1Ooeff4DenidF2LU", + "id": "acct_1P6h9i4KUmrjzdw6", "object": "account", "business_profile": { "annual_revenue": null, @@ -100,7 +103,7 @@ http_interactions: "type": "application" }, "country": "AU", - "created": 1709094188, + "created": 1713393643, "default_currency": "aud", "details_submitted": false, "email": "carrot.producer@example.com", @@ -109,7 +112,7 @@ http_interactions: "data": [], "has_more": false, "total_count": 0, - "url": "/v1/accounts/acct_1Ooeff4DenidF2LU/external_accounts" + "url": "/v1/accounts/acct_1P6h9i4KUmrjzdw6/external_accounts" }, "future_requirements": { "alternatives": [], @@ -206,7 +209,7 @@ http_interactions: }, "type": "standard" } - recorded_at: Wed, 28 Feb 2024 04:23:09 GMT + recorded_at: Wed, 17 Apr 2024 22:40:44 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents @@ -215,22 +218,19 @@ http_interactions: string: amount=1000¤cy=aud&payment_method=pm_card_mastercard&payment_method_types[0]=card&capture_method=automatic&confirm=true headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_FYW1iyKrExg9pI","request_duration_ms":1973}}' + - '{"last_request_metrics":{"request_id":"req_jm8Rl8sU7tI0UM","request_duration_ms":1865}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Stripe-Account: - - acct_1Ooeff4DenidF2LU + - acct_1P6h9i4KUmrjzdw6 Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -243,7 +243,7 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:23:11 GMT + - Wed, 17 Apr 2024 22:40:45 GMT Content-Type: - application/json Content-Length: @@ -267,18 +267,24 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - ee331c2c-1b37-4a83-a81b-96388aa9da31 + - 0302b496-8847-4fce-9d2c-7542a386e3e2 Original-Request: - - req_0zdTS2eXS52wv3 + - req_2Vw8RTjUU7nX2E + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_0zdTS2eXS52wv3 + - req_2Vw8RTjUU7nX2E Stripe-Account: - - acct_1Ooeff4DenidF2LU + - acct_1P6h9i4KUmrjzdw6 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -289,7 +295,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3Ooefi4DenidF2LU1DyZ34Mm", + "id": "pi_3P6h9k4KUmrjzdw60CPJoVkR", "object": "payment_intent", "amount": 1000, "amount_capturable": 0, @@ -303,20 +309,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "automatic", - "client_secret": "pi_3Ooefi4DenidF2LU1DyZ34Mm_secret_w379gPpBGChVwBEUepP0qlRB0", + "client_secret": "", "confirmation_method": "automatic", - "created": 1709094190, + "created": 1713393644, "currency": "aud", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3Ooefi4DenidF2LU1gG37Leq", + "latest_charge": "ch_3P6h9k4KUmrjzdw60Zc6MoUh", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1Ooefh4DenidF2LU9tRCdeQl", + "payment_method": "pm_1P6h9k4KUmrjzdw67AgkRAyO", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -341,26 +347,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Wed, 28 Feb 2024 04:23:11 GMT + recorded_at: Wed, 17 Apr 2024 22:40:45 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3Ooefi4DenidF2LU1DyZ34Mm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h9k4KUmrjzdw60CPJoVkR body: encoding: US-ASCII string: '' headers: Authorization: - - Basic c2tfdGVzdF94RmdKUU9sWHBNQUZzb3p0endGQlRGaFAwMEhHN0J1Q0ptOg== + - "" User-Agent: - Stripe/v1 ActiveMerchantBindings/1.133.0 Stripe-Version: - '2020-08-27' X-Stripe-Client-User-Agent: - - '{"bindings_version":"1.133.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","publisher":"active_merchant"}' + - "" X-Stripe-Client-User-Metadata: - '{"ip":null}' Stripe-Account: - - acct_1Ooeff4DenidF2LU + - acct_1P6h9i4KUmrjzdw6 Connection: - close Accept-Encoding: @@ -375,7 +381,7 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:23:11 GMT + - Wed, 17 Apr 2024 22:40:46 GMT Content-Type: - application/json Content-Length: @@ -400,10 +406,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_dpwxzBlEqboYmG + - req_TeEZVgd91ME3OF Stripe-Account: - - acct_1Ooeff4DenidF2LU + - acct_1P6h9i4KUmrjzdw6 Stripe-Version: - '2020-08-27' Vary: @@ -416,7 +428,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3Ooefi4DenidF2LU1DyZ34Mm", + "id": "pi_3P6h9k4KUmrjzdw60CPJoVkR", "object": "payment_intent", "amount": 1000, "amount_capturable": 0, @@ -434,7 +446,7 @@ http_interactions: "object": "list", "data": [ { - "id": "ch_3Ooefi4DenidF2LU1gG37Leq", + "id": "ch_3P6h9k4KUmrjzdw60Zc6MoUh", "object": "charge", "amount": 1000, "amount_captured": 1000, @@ -442,7 +454,7 @@ http_interactions: "application": "", "application_fee": null, "application_fee_amount": null, - "balance_transaction": "txn_3Ooefi4DenidF2LU1A5YW6L5", + "balance_transaction": "txn_3P6h9k4KUmrjzdw60hfBVh5C", "billing_details": { "address": { "city": null, @@ -458,7 +470,7 @@ http_interactions: }, "calculated_statement_descriptor": "OFNOFNOFN", "captured": true, - "created": 1709094190, + "created": 1713393644, "currency": "aud", "customer": null, "description": null, @@ -478,13 +490,13 @@ http_interactions: "network_status": "approved_by_network", "reason": null, "risk_level": "normal", - "risk_score": 60, + "risk_score": 24, "seller_message": "Payment complete.", "type": "authorized" }, "paid": true, - "payment_intent": "pi_3Ooefi4DenidF2LU1DyZ34Mm", - "payment_method": "pm_1Ooefh4DenidF2LU9tRCdeQl", + "payment_intent": "pi_3P6h9k4KUmrjzdw60CPJoVkR", + "payment_method": "pm_1P6h9k4KUmrjzdw67AgkRAyO", "payment_method_details": { "card": { "amount_authorized": 1000, @@ -495,7 +507,7 @@ http_interactions: "cvc_check": "pass" }, "country": "US", - "exp_month": 2, + "exp_month": 4, "exp_year": 2025, "extended_authorization": { "status": "disabled" @@ -527,14 +539,14 @@ http_interactions: "radar_options": {}, "receipt_email": null, "receipt_number": null, - "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xT29lZmY0RGVuaWRGMkxVKK_q-q4GMgZJ1VM-2OM6LBb4D48xGlDpdG-HkaSEFwnz19gNCEL6o7LPe7Gh8_xibxWVk8tEJTqByzNe", + "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xUDZoOWk0S1Vtcmp6ZHc2KO2fgbEGMgYXHWf51Tg6LBaTF2-PxsryTNKbJD43Hje_lrCkxMwsPW5sjduh3CKlPt6O939TJMmIHbvj", "refunded": false, "refunds": { "object": "list", "data": [], "has_more": false, "total_count": 0, - "url": "/v1/charges/ch_3Ooefi4DenidF2LU1gG37Leq/refunds" + "url": "/v1/charges/ch_3P6h9k4KUmrjzdw60Zc6MoUh/refunds" }, "review": null, "shipping": null, @@ -549,22 +561,22 @@ http_interactions: ], "has_more": false, "total_count": 1, - "url": "/v1/charges?payment_intent=pi_3Ooefi4DenidF2LU1DyZ34Mm" + "url": "/v1/charges?payment_intent=pi_3P6h9k4KUmrjzdw60CPJoVkR" }, - "client_secret": "pi_3Ooefi4DenidF2LU1DyZ34Mm_secret_w379gPpBGChVwBEUepP0qlRB0", + "client_secret": "", "confirmation_method": "automatic", - "created": 1709094190, + "created": 1713393644, "currency": "aud", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3Ooefi4DenidF2LU1gG37Leq", + "latest_charge": "ch_3P6h9k4KUmrjzdw60Zc6MoUh", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1Ooefh4DenidF2LU9tRCdeQl", + "payment_method": "pm_1P6h9k4KUmrjzdw67AgkRAyO", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -589,10 +601,10 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Wed, 28 Feb 2024 04:23:11 GMT + recorded_at: Wed, 17 Apr 2024 22:40:46 GMT - request: method: post - uri: https://api.stripe.com/v1/charges/ch_3Ooefi4DenidF2LU1gG37Leq/refunds + uri: https://api.stripe.com/v1/charges/ch_3P6h9k4KUmrjzdw60Zc6MoUh/refunds body: encoding: UTF-8 string: amount=1000&expand[0]=charge @@ -600,17 +612,17 @@ http_interactions: Content-Type: - application/x-www-form-urlencoded Authorization: - - Basic c2tfdGVzdF94RmdKUU9sWHBNQUZzb3p0endGQlRGaFAwMEhHN0J1Q0ptOg== + - "" User-Agent: - Stripe/v1 ActiveMerchantBindings/1.133.0 Stripe-Version: - '2020-08-27' X-Stripe-Client-User-Agent: - - '{"bindings_version":"1.133.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","publisher":"active_merchant"}' + - "" X-Stripe-Client-User-Metadata: - '{"ip":null}' Stripe-Account: - - acct_1Ooeff4DenidF2LU + - acct_1P6h9i4KUmrjzdw6 Connection: - close Accept-Encoding: @@ -625,7 +637,7 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:23:12 GMT + - Wed, 17 Apr 2024 22:40:47 GMT Content-Type: - application/json Content-Length: @@ -650,14 +662,20 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - f967618e-2bff-4c64-8875-82306c718be6 + - 0f9056e8-b4f2-4ab0-a33d-dbc830202e7e Original-Request: - - req_5Yjwd0ugW4geJy + - req_rgblqMAoxx1Dwh + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_5Yjwd0ugW4geJy + - req_rgblqMAoxx1Dwh Stripe-Account: - - acct_1Ooeff4DenidF2LU + - acct_1P6h9i4KUmrjzdw6 Stripe-Should-Retry: - 'false' Stripe-Version: @@ -672,12 +690,12 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "re_3Ooefi4DenidF2LU1hzSgbUz", + "id": "re_3P6h9k4KUmrjzdw60Xb35Uhh", "object": "refund", "amount": 1000, - "balance_transaction": "txn_3Ooefi4DenidF2LU1oUen4EE", + "balance_transaction": "txn_3P6h9k4KUmrjzdw60SSRfXLn", "charge": { - "id": "ch_3Ooefi4DenidF2LU1gG37Leq", + "id": "ch_3P6h9k4KUmrjzdw60Zc6MoUh", "object": "charge", "amount": 1000, "amount_captured": 1000, @@ -685,7 +703,7 @@ http_interactions: "application": "", "application_fee": null, "application_fee_amount": null, - "balance_transaction": "txn_3Ooefi4DenidF2LU1A5YW6L5", + "balance_transaction": "txn_3P6h9k4KUmrjzdw60hfBVh5C", "billing_details": { "address": { "city": null, @@ -701,7 +719,7 @@ http_interactions: }, "calculated_statement_descriptor": "OFNOFNOFN", "captured": true, - "created": 1709094190, + "created": 1713393644, "currency": "aud", "customer": null, "description": null, @@ -721,13 +739,13 @@ http_interactions: "network_status": "approved_by_network", "reason": null, "risk_level": "normal", - "risk_score": 60, + "risk_score": 24, "seller_message": "Payment complete.", "type": "authorized" }, "paid": true, - "payment_intent": "pi_3Ooefi4DenidF2LU1DyZ34Mm", - "payment_method": "pm_1Ooefh4DenidF2LU9tRCdeQl", + "payment_intent": "pi_3P6h9k4KUmrjzdw60CPJoVkR", + "payment_method": "pm_1P6h9k4KUmrjzdw67AgkRAyO", "payment_method_details": { "card": { "amount_authorized": 1000, @@ -738,7 +756,7 @@ http_interactions: "cvc_check": "pass" }, "country": "US", - "exp_month": 2, + "exp_month": 4, "exp_year": 2025, "extended_authorization": { "status": "disabled" @@ -770,18 +788,18 @@ http_interactions: "radar_options": {}, "receipt_email": null, "receipt_number": null, - "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xT29lZmY0RGVuaWRGMkxVKLDq-q4GMgYBQPWVApY6LBZIdxWS5NgOoXSKJhVtXOpcQmkL8UTt0n8vbxpQzooi76bsTotoW945k7-i", + "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xUDZoOWk0S1Vtcmp6ZHc2KO-fgbEGMgbybEkv6m46LBbvb25ggeKpISWj7n0GyRHAMlsarDDqFtG1Xm048MXeWpfspNi-widZutuK", "refunded": true, "refunds": { "object": "list", "data": [ { - "id": "re_3Ooefi4DenidF2LU1hzSgbUz", + "id": "re_3P6h9k4KUmrjzdw60Xb35Uhh", "object": "refund", "amount": 1000, - "balance_transaction": "txn_3Ooefi4DenidF2LU1oUen4EE", - "charge": "ch_3Ooefi4DenidF2LU1gG37Leq", - "created": 1709094191, + "balance_transaction": "txn_3P6h9k4KUmrjzdw60SSRfXLn", + "charge": "ch_3P6h9k4KUmrjzdw60Zc6MoUh", + "created": 1713393646, "currency": "aud", "destination_details": { "card": { @@ -792,7 +810,7 @@ http_interactions: "type": "card" }, "metadata": {}, - "payment_intent": "pi_3Ooefi4DenidF2LU1DyZ34Mm", + "payment_intent": "pi_3P6h9k4KUmrjzdw60CPJoVkR", "reason": null, "receipt_number": null, "source_transfer_reversal": null, @@ -802,7 +820,7 @@ http_interactions: ], "has_more": false, "total_count": 1, - "url": "/v1/charges/ch_3Ooefi4DenidF2LU1gG37Leq/refunds" + "url": "/v1/charges/ch_3P6h9k4KUmrjzdw60Zc6MoUh/refunds" }, "review": null, "shipping": null, @@ -814,7 +832,7 @@ http_interactions: "transfer_data": null, "transfer_group": null }, - "created": 1709094191, + "created": 1713393646, "currency": "aud", "destination_details": { "card": { @@ -825,12 +843,94 @@ http_interactions: "type": "card" }, "metadata": {}, - "payment_intent": "pi_3Ooefi4DenidF2LU1DyZ34Mm", + "payment_intent": "pi_3P6h9k4KUmrjzdw60CPJoVkR", "reason": null, "receipt_number": null, "source_transfer_reversal": null, "status": "succeeded", "transfer_reversal": null } - recorded_at: Wed, 28 Feb 2024 04:23:12 GMT + recorded_at: Wed, 17 Apr 2024 22:40:47 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/accounts/acct_1P6h9i4KUmrjzdw6 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_2Vw8RTjUU7nX2E","request_duration_ms":1414}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:40:48 GMT + Content-Type: + - application/json + Content-Length: + - '77' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts%2F%3Aaccount; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_n7PLeqVcYA2aqU + Stripe-Account: + - acct_1P6h9i4KUmrjzdw6 + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h9i4KUmrjzdw6", + "object": "account", + "deleted": true + } + recorded_at: Wed, 17 Apr 2024 22:40:48 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_error_message/when_payment_intent_state_is_not_in_requires_capture_state/does_not_succeed_if_payment_intent_state_is_not_requires_capture.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_error_message/when_payment_intent_state_is_not_in_requires_capture_state/does_not_succeed_if_payment_intent_state_is_not_requires_capture.yml new file mode 100644 index 0000000000..900270392a --- /dev/null +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_error_message/when_payment_intent_state_is_not_in_requires_capture_state/does_not_succeed_if_payment_intent_state_is_not_requires_capture.yml @@ -0,0 +1,683 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.stripe.com/v1/payment_methods/pm_card_mastercard + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_n7PLeqVcYA2aqU","request_duration_ms":1058}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:40:49 GMT + Content-Type: + - application/json + Content-Length: + - '1013' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods%2F%3Apayment_method; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_h1kUu8qlpgx3gt + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pm_1P6h9pKuuB1fWySnLHcMMJgf", + "object": "payment_method", + "allow_redisplay": "unspecified", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "card": { + "brand": "mastercard", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "unchecked" + }, + "country": "US", + "display_brand": "mastercard", + "exp_month": 4, + "exp_year": 2025, + "fingerprint": "BL35fEFVcTTS5wpE", + "funding": "credit", + "generated_from": null, + "last4": "4444", + "networks": { + "available": [ + "mastercard" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1713393649, + "customer": null, + "livemode": false, + "metadata": {}, + "type": "card" + } + recorded_at: Wed, 17 Apr 2024 22:40:49 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: amount=1000¤cy=aud&payment_method=pm_1P6h9pKuuB1fWySnLHcMMJgf&payment_method_types[0]=card&capture_method=manual + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_h1kUu8qlpgx3gt","request_duration_ms":399}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:40:50 GMT + Content-Type: + - application/json + Content-Length: + - '1344' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Idempotency-Key: + - a2896e8a-cf5c-4c28-ad57-8f0bc6c23872 + Original-Request: + - req_UDOIqvw1SJ1kJE + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_UDOIqvw1SJ1kJE + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pi_3P6h9pKuuB1fWySn0uOS8MDT", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_details": { + "tip": {} + }, + "amount_received": 0, + "application": null, + "application_fee_amount": null, + "automatic_payment_methods": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "manual", + "client_secret": "", + "confirmation_method": "automatic", + "created": 1713393649, + "currency": "aud", + "customer": null, + "description": null, + "invoice": null, + "last_payment_error": null, + "latest_charge": null, + "livemode": false, + "metadata": {}, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1P6h9pKuuB1fWySnLHcMMJgf", + "payment_method_configuration_details": null, + "payment_method_options": { + "card": { + "installments": null, + "mandate_options": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "processing": null, + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "requires_confirmation", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Wed, 17 Apr 2024 22:40:50 GMT +- request: + method: get + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h9pKuuB1fWySn0uOS8MDT + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_UDOIqvw1SJ1kJE","request_duration_ms":478}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:40:50 GMT + Content-Type: + - application/json + Content-Length: + - '1344' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents%2F%3Aintent; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_md5EJAhfQz2tq8 + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pi_3P6h9pKuuB1fWySn0uOS8MDT", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_details": { + "tip": {} + }, + "amount_received": 0, + "application": null, + "application_fee_amount": null, + "automatic_payment_methods": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "manual", + "client_secret": "", + "confirmation_method": "automatic", + "created": 1713393649, + "currency": "aud", + "customer": null, + "description": null, + "invoice": null, + "last_payment_error": null, + "latest_charge": null, + "livemode": false, + "metadata": {}, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1P6h9pKuuB1fWySnLHcMMJgf", + "payment_method_configuration_details": null, + "payment_method_options": { + "card": { + "installments": null, + "mandate_options": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "processing": null, + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "requires_confirmation", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Wed, 17 Apr 2024 22:40:50 GMT +- request: + method: post + uri: https://api.stripe.com/v1/accounts + body: + encoding: UTF-8 + string: type=standard&country=AU&email=carrot.producer%40example.com + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_md5EJAhfQz2tq8","request_duration_ms":422}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:40:52 GMT + Content-Type: + - application/json + Content-Length: + - '3046' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Idempotency-Key: + - 5e707e9a-cf32-4515-acf2-cebbcc0f6dfe + Original-Request: + - req_cbPYvYJmY3fkfJ + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_cbPYvYJmY3fkfJ + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h9q4CfczCwDwr", + "object": "account", + "business_profile": { + "annual_revenue": null, + "estimated_worker_count": null, + "mcc": null, + "name": null, + "product_description": null, + "support_address": null, + "support_email": null, + "support_phone": null, + "support_url": null, + "url": null + }, + "business_type": null, + "capabilities": {}, + "charges_enabled": false, + "controller": { + "is_controller": true, + "type": "application" + }, + "country": "AU", + "created": 1713393651, + "default_currency": "aud", + "details_submitted": false, + "email": "carrot.producer@example.com", + "external_accounts": { + "object": "list", + "data": [], + "has_more": false, + "total_count": 0, + "url": "/v1/accounts/acct_1P6h9q4CfczCwDwr/external_accounts" + }, + "future_requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [], + "disabled_reason": null, + "errors": [], + "eventually_due": [], + "past_due": [], + "pending_verification": [] + }, + "metadata": {}, + "payouts_enabled": false, + "requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "disabled_reason": "requirements.past_due", + "errors": [], + "eventually_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "past_due": [ + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "pending_verification": [] + }, + "settings": { + "bacs_debit_payments": { + "display_name": null, + "service_user_number": null + }, + "branding": { + "icon": null, + "logo": null, + "primary_color": null, + "secondary_color": null + }, + "card_issuing": { + "tos_acceptance": { + "date": null, + "ip": null + } + }, + "card_payments": { + "decline_on": { + "avs_failure": false, + "cvc_failure": false + }, + "statement_descriptor_prefix": null, + "statement_descriptor_prefix_kana": null, + "statement_descriptor_prefix_kanji": null + }, + "dashboard": { + "display_name": null, + "timezone": "Etc/UTC" + }, + "invoices": { + "default_account_tax_ids": null + }, + "payments": { + "statement_descriptor": null, + "statement_descriptor_kana": null, + "statement_descriptor_kanji": null + }, + "payouts": { + "debit_negative_balances": true, + "schedule": { + "delay_days": 2, + "interval": "daily" + }, + "statement_descriptor": null + }, + "sepa_debit_payments": {} + }, + "tos_acceptance": { + "date": null, + "ip": null, + "user_agent": null + }, + "type": "standard" + } + recorded_at: Wed, 17 Apr 2024 22:40:52 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/accounts/acct_1P6h9q4CfczCwDwr + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_cbPYvYJmY3fkfJ","request_duration_ms":1736}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:40:53 GMT + Content-Type: + - application/json + Content-Length: + - '77' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts%2F%3Aaccount; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_PeIqm3K4NmLcSX + Stripe-Account: + - acct_1P6h9q4CfczCwDwr + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h9q4CfczCwDwr", + "object": "account", + "deleted": true + } + recorded_at: Wed, 17 Apr 2024 22:40:53 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_external_payment_url/calls_Checkout_StripeRedirect.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_external_payment_url/calls_Checkout_StripeRedirect.yml new file mode 100644 index 0000000000..cd93dc0762 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_external_payment_url/calls_Checkout_StripeRedirect.yml @@ -0,0 +1,295 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.stripe.com/v1/accounts + body: + encoding: UTF-8 + string: type=standard&country=AU&email=carrot.producer%40example.com + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_1BLlFPIR0KR3cU","request_duration_ms":920}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:40:59 GMT + Content-Type: + - application/json + Content-Length: + - '3046' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Idempotency-Key: + - 06cb1af2-7708-4a82-951a-4108bb21b383 + Original-Request: + - req_WHoWij9lRj2DYF + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_WHoWij9lRj2DYF + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h9x4DCO0qaA5y", + "object": "account", + "business_profile": { + "annual_revenue": null, + "estimated_worker_count": null, + "mcc": null, + "name": null, + "product_description": null, + "support_address": null, + "support_email": null, + "support_phone": null, + "support_url": null, + "url": null + }, + "business_type": null, + "capabilities": {}, + "charges_enabled": false, + "controller": { + "is_controller": true, + "type": "application" + }, + "country": "AU", + "created": 1713393658, + "default_currency": "aud", + "details_submitted": false, + "email": "carrot.producer@example.com", + "external_accounts": { + "object": "list", + "data": [], + "has_more": false, + "total_count": 0, + "url": "/v1/accounts/acct_1P6h9x4DCO0qaA5y/external_accounts" + }, + "future_requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [], + "disabled_reason": null, + "errors": [], + "eventually_due": [], + "past_due": [], + "pending_verification": [] + }, + "metadata": {}, + "payouts_enabled": false, + "requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "disabled_reason": "requirements.past_due", + "errors": [], + "eventually_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "past_due": [ + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "pending_verification": [] + }, + "settings": { + "bacs_debit_payments": { + "display_name": null, + "service_user_number": null + }, + "branding": { + "icon": null, + "logo": null, + "primary_color": null, + "secondary_color": null + }, + "card_issuing": { + "tos_acceptance": { + "date": null, + "ip": null + } + }, + "card_payments": { + "decline_on": { + "avs_failure": false, + "cvc_failure": false + }, + "statement_descriptor_prefix": null, + "statement_descriptor_prefix_kana": null, + "statement_descriptor_prefix_kanji": null + }, + "dashboard": { + "display_name": null, + "timezone": "Etc/UTC" + }, + "invoices": { + "default_account_tax_ids": null + }, + "payments": { + "statement_descriptor": null, + "statement_descriptor_kana": null, + "statement_descriptor_kanji": null + }, + "payouts": { + "debit_negative_balances": true, + "schedule": { + "delay_days": 2, + "interval": "daily" + }, + "statement_descriptor": null + }, + "sepa_debit_payments": {} + }, + "tos_acceptance": { + "date": null, + "ip": null, + "user_agent": null + }, + "type": "standard" + } + recorded_at: Wed, 17 Apr 2024 22:40:59 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/accounts/acct_1P6h9x4DCO0qaA5y + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_WHoWij9lRj2DYF","request_duration_ms":1922}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:41:00 GMT + Content-Type: + - application/json + Content-Length: + - '77' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts%2F%3Aaccount; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_zc8hvLjwOG6Dsw + Stripe-Account: + - acct_1P6h9x4DCO0qaA5y + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h9x4DCO0qaA5y", + "object": "account", + "deleted": true + } + recorded_at: Wed, 17 Apr 2024 22:41:00 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_external_payment_url/returns_nil_when_an_order_is_not_supplied.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_external_payment_url/returns_nil_when_an_order_is_not_supplied.yml new file mode 100644 index 0000000000..bb0803997c --- /dev/null +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_external_payment_url/returns_nil_when_an_order_is_not_supplied.yml @@ -0,0 +1,295 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.stripe.com/v1/accounts + body: + encoding: UTF-8 + string: type=standard&country=AU&email=carrot.producer%40example.com + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_PeIqm3K4NmLcSX","request_duration_ms":1329}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:40:55 GMT + Content-Type: + - application/json + Content-Length: + - '3046' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Idempotency-Key: + - 424e9683-d74d-4586-8c22-a634b09f0c62 + Original-Request: + - req_YIVljRloNvDNcT + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_YIVljRloNvDNcT + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h9uQTgAPMAm48", + "object": "account", + "business_profile": { + "annual_revenue": null, + "estimated_worker_count": null, + "mcc": null, + "name": null, + "product_description": null, + "support_address": null, + "support_email": null, + "support_phone": null, + "support_url": null, + "url": null + }, + "business_type": null, + "capabilities": {}, + "charges_enabled": false, + "controller": { + "is_controller": true, + "type": "application" + }, + "country": "AU", + "created": 1713393654, + "default_currency": "aud", + "details_submitted": false, + "email": "carrot.producer@example.com", + "external_accounts": { + "object": "list", + "data": [], + "has_more": false, + "total_count": 0, + "url": "/v1/accounts/acct_1P6h9uQTgAPMAm48/external_accounts" + }, + "future_requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [], + "disabled_reason": null, + "errors": [], + "eventually_due": [], + "past_due": [], + "pending_verification": [] + }, + "metadata": {}, + "payouts_enabled": false, + "requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "disabled_reason": "requirements.past_due", + "errors": [], + "eventually_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "past_due": [ + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "pending_verification": [] + }, + "settings": { + "bacs_debit_payments": { + "display_name": null, + "service_user_number": null + }, + "branding": { + "icon": null, + "logo": null, + "primary_color": null, + "secondary_color": null + }, + "card_issuing": { + "tos_acceptance": { + "date": null, + "ip": null + } + }, + "card_payments": { + "decline_on": { + "avs_failure": false, + "cvc_failure": false + }, + "statement_descriptor_prefix": null, + "statement_descriptor_prefix_kana": null, + "statement_descriptor_prefix_kanji": null + }, + "dashboard": { + "display_name": null, + "timezone": "Etc/UTC" + }, + "invoices": { + "default_account_tax_ids": null + }, + "payments": { + "statement_descriptor": null, + "statement_descriptor_kana": null, + "statement_descriptor_kanji": null + }, + "payouts": { + "debit_negative_balances": true, + "schedule": { + "delay_days": 2, + "interval": "daily" + }, + "statement_descriptor": null + }, + "sepa_debit_payments": {} + }, + "tos_acceptance": { + "date": null, + "ip": null, + "user_agent": null + }, + "type": "standard" + } + recorded_at: Wed, 17 Apr 2024 22:40:55 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/accounts/acct_1P6h9uQTgAPMAm48 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_YIVljRloNvDNcT","request_duration_ms":2032}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:40:56 GMT + Content-Type: + - application/json + Content-Length: + - '77' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts%2F%3Aaccount; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_1BLlFPIR0KR3cU + Stripe-Account: + - acct_1P6h9uQTgAPMAm48 + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h9uQTgAPMAm48", + "object": "account", + "deleted": true + } + recorded_at: Wed, 17 Apr 2024 22:40:56 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_Gateway_StripeSCA/_purchase/completes_the_purchase.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_purchase/completes_the_purchase.yml similarity index 57% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_Gateway_StripeSCA/_purchase/completes_the_purchase.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_purchase/completes_the_purchase.yml index 71b0d7ee4e..1648c6d679 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_Gateway_StripeSCA/_purchase/completes_the_purchase.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_purchase/completes_the_purchase.yml @@ -8,18 +8,17 @@ http_interactions: string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_XG8res7ijCpIgW","request_duration_ms":817}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -32,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:22:50 GMT + - Wed, 17 Apr 2024 22:40:15 GMT Content-Type: - application/json Content-Length: - - '977' + - '1013' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -57,10 +56,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_C80lOiQ174c6i0 + - req_O2pHXZ0HmoJnt9 Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -71,8 +76,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoefOKuuB1fWySnRppMNGu2", + "id": "pm_1P6h9GKuuB1fWySnIaGI3GWN", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -95,7 +101,7 @@ http_interactions: }, "country": "US", "display_brand": "mastercard", - "exp_month": 2, + "exp_month": 4, "exp_year": 2025, "fingerprint": "BL35fEFVcTTS5wpE", "funding": "credit", @@ -112,35 +118,32 @@ http_interactions: }, "wallet": null }, - "created": 1709094170, + "created": 1713393615, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Wed, 28 Feb 2024 04:22:50 GMT + recorded_at: Wed, 17 Apr 2024 22:40:15 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=1000¤cy=aud&payment_method=pm_1OoefOKuuB1fWySnRppMNGu2&payment_method_types[0]=card&capture_method=manual + string: amount=1000¤cy=aud&payment_method=pm_1P6h9GKuuB1fWySnIaGI3GWN&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_C80lOiQ174c6i0","request_duration_ms":534}}' + - '{"last_request_metrics":{"request_id":"req_O2pHXZ0HmoJnt9","request_duration_ms":489}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -153,7 +156,7 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:22:51 GMT + - Wed, 17 Apr 2024 22:40:15 GMT Content-Type: - application/json Content-Length: @@ -177,16 +180,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - b22256dd-6a6a-4d2f-8165-1ab4b95b7cce + - 1e87d5f2-0448-4a51-8a5e-b3f8aefcf226 Original-Request: - - req_I48KhbL4d4cHh2 + - req_pWQG2yG1Ax4jRk + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_I48KhbL4d4cHh2 + - req_pWQG2yG1Ax4jRk Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -197,7 +206,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoefPKuuB1fWySn2a1CUhKr", + "id": "pi_3P6h9HKuuB1fWySn0GX7USzi", "object": "payment_intent", "amount": 1000, "amount_capturable": 0, @@ -211,9 +220,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoefPKuuB1fWySn2a1CUhKr_secret_jrv3bAuw620fN4yEQ39dnpTkT", + "client_secret": "", "confirmation_method": "automatic", - "created": 1709094171, + "created": 1713393615, "currency": "aud", "customer": null, "description": null, @@ -224,7 +233,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoefOKuuB1fWySnRppMNGu2", + "payment_method": "pm_1P6h9GKuuB1fWySnIaGI3GWN", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -249,29 +258,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Wed, 28 Feb 2024 04:22:51 GMT + recorded_at: Wed, 17 Apr 2024 22:40:15 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoefPKuuB1fWySn2a1CUhKr/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h9HKuuB1fWySn0GX7USzi/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_I48KhbL4d4cHh2","request_duration_ms":444}}' + - '{"last_request_metrics":{"request_id":"req_pWQG2yG1Ax4jRk","request_duration_ms":511}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -284,7 +290,7 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:22:52 GMT + - Wed, 17 Apr 2024 22:40:16 GMT Content-Type: - application/json Content-Length: @@ -309,16 +315,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 87c23353-1da7-4401-90d8-782133288905 + - 6900a9b9-af42-4425-a398-7843acfef5a1 Original-Request: - - req_3MS3zmJh2lqbIp + - req_etWiRHdjekM9MP + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_3MS3zmJh2lqbIp + - req_etWiRHdjekM9MP Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -329,7 +341,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoefPKuuB1fWySn2a1CUhKr", + "id": "pi_3P6h9HKuuB1fWySn0GX7USzi", "object": "payment_intent", "amount": 1000, "amount_capturable": 1000, @@ -343,20 +355,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoefPKuuB1fWySn2a1CUhKr_secret_jrv3bAuw620fN4yEQ39dnpTkT", + "client_secret": "", "confirmation_method": "automatic", - "created": 1709094171, + "created": 1713393615, "currency": "aud", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoefPKuuB1fWySn2XgChplD", + "latest_charge": "ch_3P6h9HKuuB1fWySn0ZlVda9w", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoefOKuuB1fWySnRppMNGu2", + "payment_method": "pm_1P6h9GKuuB1fWySnIaGI3GWN", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -381,29 +393,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Wed, 28 Feb 2024 04:22:52 GMT + recorded_at: Wed, 17 Apr 2024 22:40:16 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoefPKuuB1fWySn2a1CUhKr + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h9HKuuB1fWySn0GX7USzi body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_3MS3zmJh2lqbIp","request_duration_ms":985}}' + - '{"last_request_metrics":{"request_id":"req_etWiRHdjekM9MP","request_duration_ms":1123}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -416,7 +425,7 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:22:53 GMT + - Wed, 17 Apr 2024 22:40:18 GMT Content-Type: - application/json Content-Length: @@ -441,10 +450,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_XPJt16n7nTK00g + - req_4YLLSSEOs3AoNr Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -455,7 +470,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoefPKuuB1fWySn2a1CUhKr", + "id": "pi_3P6h9HKuuB1fWySn0GX7USzi", "object": "payment_intent", "amount": 1000, "amount_capturable": 1000, @@ -469,20 +484,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoefPKuuB1fWySn2a1CUhKr_secret_jrv3bAuw620fN4yEQ39dnpTkT", + "client_secret": "", "confirmation_method": "automatic", - "created": 1709094171, + "created": 1713393615, "currency": "aud", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoefPKuuB1fWySn2XgChplD", + "latest_charge": "ch_3P6h9HKuuB1fWySn0ZlVda9w", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoefOKuuB1fWySnRppMNGu2", + "payment_method": "pm_1P6h9GKuuB1fWySnIaGI3GWN", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -507,10 +522,10 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Wed, 28 Feb 2024 04:22:53 GMT + recorded_at: Wed, 17 Apr 2024 22:40:18 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoefPKuuB1fWySn2a1CUhKr/capture + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h9HKuuB1fWySn0GX7USzi/capture body: encoding: UTF-8 string: amount_to_capture=1000 @@ -518,13 +533,13 @@ http_interactions: Content-Type: - application/x-www-form-urlencoded Authorization: - - Basic c2tfdGVzdF94RmdKUU9sWHBNQUZzb3p0endGQlRGaFAwMEhHN0J1Q0ptOg== + - "" User-Agent: - Stripe/v1 ActiveMerchantBindings/1.133.0 Stripe-Version: - '2020-08-27' X-Stripe-Client-User-Agent: - - '{"bindings_version":"1.133.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","publisher":"active_merchant"}' + - "" X-Stripe-Client-User-Metadata: - '{"ip":null}' Connection: @@ -541,11 +556,11 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:22:54 GMT + - Wed, 17 Apr 2024 22:40:19 GMT Content-Type: - application/json Content-Length: - - '5163' + - '5162' Connection: - close Access-Control-Allow-Credentials: @@ -566,12 +581,18 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 924a5a52-a3b7-454d-9525-a4f745643bcc + - e8a4740c-4718-432d-8824-a71d0b172c29 Original-Request: - - req_0mMZdvmaHu1xkb + - req_QJFfo9qsolrC9c + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_0mMZdvmaHu1xkb + - req_QJFfo9qsolrC9c Stripe-Should-Retry: - 'false' Stripe-Version: @@ -586,7 +607,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoefPKuuB1fWySn2a1CUhKr", + "id": "pi_3P6h9HKuuB1fWySn0GX7USzi", "object": "payment_intent", "amount": 1000, "amount_capturable": 0, @@ -604,7 +625,7 @@ http_interactions: "object": "list", "data": [ { - "id": "ch_3OoefPKuuB1fWySn2XgChplD", + "id": "ch_3P6h9HKuuB1fWySn0ZlVda9w", "object": "charge", "amount": 1000, "amount_captured": 1000, @@ -613,7 +634,7 @@ http_interactions: "application": null, "application_fee": null, "application_fee_amount": null, - "balance_transaction": "txn_3OoefPKuuB1fWySn2KbEy5KT", + "balance_transaction": "txn_3P6h9HKuuB1fWySn0z60JBQl", "billing_details": { "address": { "city": null, @@ -629,7 +650,7 @@ http_interactions: }, "calculated_statement_descriptor": "OFNOFNOFN", "captured": true, - "created": 1709094171, + "created": 1713393616, "currency": "aud", "customer": null, "description": null, @@ -649,25 +670,25 @@ http_interactions: "network_status": "approved_by_network", "reason": null, "risk_level": "normal", - "risk_score": 24, + "risk_score": 8, "seller_message": "Payment complete.", "type": "authorized" }, "paid": true, - "payment_intent": "pi_3OoefPKuuB1fWySn2a1CUhKr", - "payment_method": "pm_1OoefOKuuB1fWySnRppMNGu2", + "payment_intent": "pi_3P6h9HKuuB1fWySn0GX7USzi", + "payment_method": "pm_1P6h9GKuuB1fWySnIaGI3GWN", "payment_method_details": { "card": { "amount_authorized": 1000, "brand": "mastercard", - "capture_before": 1709698971, + "capture_before": 1713998416, "checks": { "address_line1_check": null, "address_postal_code_check": null, "cvc_check": "pass" }, "country": "US", - "exp_month": 2, + "exp_month": 4, "exp_year": 2025, "extended_authorization": { "status": "disabled" @@ -699,14 +720,14 @@ http_interactions: "radar_options": {}, "receipt_email": null, "receipt_number": null, - "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xRmlxRXNLdXVCMWZXeVNuKJ7q-q4GMgbcaqyB9xQ6LBbyuqO6Pzq_DRbuPPU_3KgWARob19ouqfjqfTie9nYDPO4CNF1NF5JvJAg2", + "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xRmlxRXNLdXVCMWZXeVNuKNOfgbEGMgZW-K9ZLyQ6LBa1WWsudaCUMFn4r4uwwKLy3tUo96EdnX7UMZrufRqKnME_ob6IQXFUNWQD", "refunded": false, "refunds": { "object": "list", "data": [], "has_more": false, "total_count": 0, - "url": "/v1/charges/ch_3OoefPKuuB1fWySn2XgChplD/refunds" + "url": "/v1/charges/ch_3P6h9HKuuB1fWySn0ZlVda9w/refunds" }, "review": null, "shipping": null, @@ -721,22 +742,22 @@ http_interactions: ], "has_more": false, "total_count": 1, - "url": "/v1/charges?payment_intent=pi_3OoefPKuuB1fWySn2a1CUhKr" + "url": "/v1/charges?payment_intent=pi_3P6h9HKuuB1fWySn0GX7USzi" }, - "client_secret": "pi_3OoefPKuuB1fWySn2a1CUhKr_secret_jrv3bAuw620fN4yEQ39dnpTkT", + "client_secret": "", "confirmation_method": "automatic", - "created": 1709094171, + "created": 1713393615, "currency": "aud", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoefPKuuB1fWySn2XgChplD", + "latest_charge": "ch_3P6h9HKuuB1fWySn0ZlVda9w", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoefOKuuB1fWySnRppMNGu2", + "payment_method": "pm_1P6h9GKuuB1fWySnIaGI3GWN", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -761,5 +782,297 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Wed, 28 Feb 2024 04:22:54 GMT + recorded_at: Wed, 17 Apr 2024 22:40:19 GMT +- request: + method: post + uri: https://api.stripe.com/v1/accounts + body: + encoding: UTF-8 + string: type=standard&country=AU&email=carrot.producer%40example.com + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_4YLLSSEOs3AoNr","request_duration_ms":411}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:40:21 GMT + Content-Type: + - application/json + Content-Length: + - '3046' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Idempotency-Key: + - f4c18e62-0428-4d9c-92f4-ce07663cd854 + Original-Request: + - req_UWNXrzSmFKrfLJ + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_UWNXrzSmFKrfLJ + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h9M4JJZUDYfa9", + "object": "account", + "business_profile": { + "annual_revenue": null, + "estimated_worker_count": null, + "mcc": null, + "name": null, + "product_description": null, + "support_address": null, + "support_email": null, + "support_phone": null, + "support_url": null, + "url": null + }, + "business_type": null, + "capabilities": {}, + "charges_enabled": false, + "controller": { + "is_controller": true, + "type": "application" + }, + "country": "AU", + "created": 1713393620, + "default_currency": "aud", + "details_submitted": false, + "email": "carrot.producer@example.com", + "external_accounts": { + "object": "list", + "data": [], + "has_more": false, + "total_count": 0, + "url": "/v1/accounts/acct_1P6h9M4JJZUDYfa9/external_accounts" + }, + "future_requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [], + "disabled_reason": null, + "errors": [], + "eventually_due": [], + "past_due": [], + "pending_verification": [] + }, + "metadata": {}, + "payouts_enabled": false, + "requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "disabled_reason": "requirements.past_due", + "errors": [], + "eventually_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "past_due": [ + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "pending_verification": [] + }, + "settings": { + "bacs_debit_payments": { + "display_name": null, + "service_user_number": null + }, + "branding": { + "icon": null, + "logo": null, + "primary_color": null, + "secondary_color": null + }, + "card_issuing": { + "tos_acceptance": { + "date": null, + "ip": null + } + }, + "card_payments": { + "decline_on": { + "avs_failure": false, + "cvc_failure": false + }, + "statement_descriptor_prefix": null, + "statement_descriptor_prefix_kana": null, + "statement_descriptor_prefix_kanji": null + }, + "dashboard": { + "display_name": null, + "timezone": "Etc/UTC" + }, + "invoices": { + "default_account_tax_ids": null + }, + "payments": { + "statement_descriptor": null, + "statement_descriptor_kana": null, + "statement_descriptor_kanji": null + }, + "payouts": { + "debit_negative_balances": true, + "schedule": { + "delay_days": 2, + "interval": "daily" + }, + "statement_descriptor": null + }, + "sepa_debit_payments": {} + }, + "tos_acceptance": { + "date": null, + "ip": null, + "user_agent": null + }, + "type": "standard" + } + recorded_at: Wed, 17 Apr 2024 22:40:21 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/accounts/acct_1P6h9M4JJZUDYfa9 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_UWNXrzSmFKrfLJ","request_duration_ms":1870}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:40:22 GMT + Content-Type: + - application/json + Content-Length: + - '77' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts%2F%3Aaccount; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_YcxRlceSDH1DK0 + Stripe-Account: + - acct_1P6h9M4JJZUDYfa9 + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h9M4JJZUDYfa9", + "object": "account", + "deleted": true + } + recorded_at: Wed, 17 Apr 2024 22:40:22 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_purchase/provides_an_error_message_to_help_developer_debug.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_purchase/provides_an_error_message_to_help_developer_debug.yml new file mode 100644 index 0000000000..30a1f796bb --- /dev/null +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_purchase/provides_an_error_message_to_help_developer_debug.yml @@ -0,0 +1,689 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.stripe.com/v1/payment_methods/pm_card_mastercard + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_YcxRlceSDH1DK0","request_duration_ms":1014}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:40:23 GMT + Content-Type: + - application/json + Content-Length: + - '1013' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods%2F%3Apayment_method; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_j7DLIIuuhURNC9 + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pm_1P6h9OKuuB1fWySn36I1mtH7", + "object": "payment_method", + "allow_redisplay": "unspecified", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "card": { + "brand": "mastercard", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "unchecked" + }, + "country": "US", + "display_brand": "mastercard", + "exp_month": 4, + "exp_year": 2025, + "fingerprint": "BL35fEFVcTTS5wpE", + "funding": "credit", + "generated_from": null, + "last4": "4444", + "networks": { + "available": [ + "mastercard" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1713393622, + "customer": null, + "livemode": false, + "metadata": {}, + "type": "card" + } + recorded_at: Wed, 17 Apr 2024 22:40:23 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: amount=1000¤cy=aud&payment_method=pm_1P6h9OKuuB1fWySn36I1mtH7&payment_method_types[0]=card&capture_method=manual + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_j7DLIIuuhURNC9","request_duration_ms":431}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:40:23 GMT + Content-Type: + - application/json + Content-Length: + - '1344' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Idempotency-Key: + - 87ca1f94-71d6-4eec-995c-087f6b4408cb + Original-Request: + - req_UQ7IiEc3ReGp38 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_UQ7IiEc3ReGp38 + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pi_3P6h9PKuuB1fWySn0qF0wV9W", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_details": { + "tip": {} + }, + "amount_received": 0, + "application": null, + "application_fee_amount": null, + "automatic_payment_methods": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "manual", + "client_secret": "", + "confirmation_method": "automatic", + "created": 1713393623, + "currency": "aud", + "customer": null, + "description": null, + "invoice": null, + "last_payment_error": null, + "latest_charge": null, + "livemode": false, + "metadata": {}, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1P6h9OKuuB1fWySn36I1mtH7", + "payment_method_configuration_details": null, + "payment_method_options": { + "card": { + "installments": null, + "mandate_options": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "processing": null, + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "requires_confirmation", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Wed, 17 Apr 2024 22:40:23 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h9PKuuB1fWySn0qF0wV9W/confirm + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_UQ7IiEc3ReGp38","request_duration_ms":444}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:40:24 GMT + Content-Type: + - application/json + Content-Length: + - '1367' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents%2F%3Aintent%2Fconfirm; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Idempotency-Key: + - 1d4f4716-9b01-4f8a-a467-61656a62f35e + Original-Request: + - req_ix8R2kZj087MSe + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_ix8R2kZj087MSe + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pi_3P6h9PKuuB1fWySn0qF0wV9W", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 1000, + "amount_details": { + "tip": {} + }, + "amount_received": 0, + "application": null, + "application_fee_amount": null, + "automatic_payment_methods": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "manual", + "client_secret": "", + "confirmation_method": "automatic", + "created": 1713393623, + "currency": "aud", + "customer": null, + "description": null, + "invoice": null, + "last_payment_error": null, + "latest_charge": "ch_3P6h9PKuuB1fWySn0pPG4M92", + "livemode": false, + "metadata": {}, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1P6h9OKuuB1fWySn36I1mtH7", + "payment_method_configuration_details": null, + "payment_method_options": { + "card": { + "installments": null, + "mandate_options": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "processing": null, + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "requires_capture", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Wed, 17 Apr 2024 22:40:24 GMT +- request: + method: post + uri: https://api.stripe.com/v1/accounts + body: + encoding: UTF-8 + string: type=standard&country=AU&email=carrot.producer%40example.com + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_ix8R2kZj087MSe","request_duration_ms":1025}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:40:26 GMT + Content-Type: + - application/json + Content-Length: + - '3046' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Idempotency-Key: + - 5d49d0bd-1024-4c27-aec0-db6138a26672 + Original-Request: + - req_aZu7Ip7h6hMWEw + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_aZu7Ip7h6hMWEw + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h9RQTKNivUWku", + "object": "account", + "business_profile": { + "annual_revenue": null, + "estimated_worker_count": null, + "mcc": null, + "name": null, + "product_description": null, + "support_address": null, + "support_email": null, + "support_phone": null, + "support_url": null, + "url": null + }, + "business_type": null, + "capabilities": {}, + "charges_enabled": false, + "controller": { + "is_controller": true, + "type": "application" + }, + "country": "AU", + "created": 1713393626, + "default_currency": "aud", + "details_submitted": false, + "email": "carrot.producer@example.com", + "external_accounts": { + "object": "list", + "data": [], + "has_more": false, + "total_count": 0, + "url": "/v1/accounts/acct_1P6h9RQTKNivUWku/external_accounts" + }, + "future_requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [], + "disabled_reason": null, + "errors": [], + "eventually_due": [], + "past_due": [], + "pending_verification": [] + }, + "metadata": {}, + "payouts_enabled": false, + "requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "disabled_reason": "requirements.past_due", + "errors": [], + "eventually_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "past_due": [ + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "pending_verification": [] + }, + "settings": { + "bacs_debit_payments": { + "display_name": null, + "service_user_number": null + }, + "branding": { + "icon": null, + "logo": null, + "primary_color": null, + "secondary_color": null + }, + "card_issuing": { + "tos_acceptance": { + "date": null, + "ip": null + } + }, + "card_payments": { + "decline_on": { + "avs_failure": false, + "cvc_failure": false + }, + "statement_descriptor_prefix": null, + "statement_descriptor_prefix_kana": null, + "statement_descriptor_prefix_kanji": null + }, + "dashboard": { + "display_name": null, + "timezone": "Etc/UTC" + }, + "invoices": { + "default_account_tax_ids": null + }, + "payments": { + "statement_descriptor": null, + "statement_descriptor_kana": null, + "statement_descriptor_kanji": null + }, + "payouts": { + "debit_negative_balances": true, + "schedule": { + "delay_days": 2, + "interval": "daily" + }, + "statement_descriptor": null + }, + "sepa_debit_payments": {} + }, + "tos_acceptance": { + "date": null, + "ip": null, + "user_agent": null + }, + "type": "standard" + } + recorded_at: Wed, 17 Apr 2024 22:40:27 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/accounts/acct_1P6h9RQTKNivUWku + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_aZu7Ip7h6hMWEw","request_duration_ms":1707}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:40:28 GMT + Content-Type: + - application/json + Content-Length: + - '77' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts%2F%3Aaccount; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_Hc6RJleCBVQrji + Stripe-Account: + - acct_1P6h9RQTKNivUWku + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h9RQTKNivUWku", + "object": "account", + "deleted": true + } + recorded_at: Wed, 17 Apr 2024 22:40:28 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_Gateway_StripeSCA/_void/with_a_confirmed_payment/refunds_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_void/with_a_confirmed_payment/refunds_the_payment.yml similarity index 75% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_Gateway_StripeSCA/_void/with_a_confirmed_payment/refunds_the_payment.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_void/with_a_confirmed_payment/refunds_the_payment.yml index e5130bd32f..3d2bcbc9c7 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_Gateway_StripeSCA/_void/with_a_confirmed_payment/refunds_the_payment.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_void/with_a_confirmed_payment/refunds_the_payment.yml @@ -8,20 +8,17 @@ http_interactions: string: type=standard&country=AU&email=carrot.producer%40example.com headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_RZnI8d1lN97iCq","request_duration_ms":986}}' + - '{"last_request_metrics":{"request_id":"req_Hc6RJleCBVQrji","request_duration_ms":1120}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,7 +31,7 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:22:58 GMT + - Wed, 17 Apr 2024 22:40:30 GMT Content-Type: - application/json Content-Length: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 54580d6e-e359-4cb8-bd6f-19755b32a54b + - 92dec14b-edaa-4248-aa04-9e403571116e Original-Request: - - req_tvTBJjnxpf5qXy + - req_NGp4nup5Hy409f + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_tvTBJjnxpf5qXy + - req_NGp4nup5Hy409f Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,7 +81,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "acct_1OoefV4C2tKH5dGL", + "id": "acct_1P6h9U4J9zQRH3My", "object": "account", "business_profile": { "annual_revenue": null, @@ -100,7 +103,7 @@ http_interactions: "type": "application" }, "country": "AU", - "created": 1709094178, + "created": 1713393629, "default_currency": "aud", "details_submitted": false, "email": "carrot.producer@example.com", @@ -109,7 +112,7 @@ http_interactions: "data": [], "has_more": false, "total_count": 0, - "url": "/v1/accounts/acct_1OoefV4C2tKH5dGL/external_accounts" + "url": "/v1/accounts/acct_1P6h9U4J9zQRH3My/external_accounts" }, "future_requirements": { "alternatives": [], @@ -206,7 +209,7 @@ http_interactions: }, "type": "standard" } - recorded_at: Wed, 28 Feb 2024 04:22:58 GMT + recorded_at: Wed, 17 Apr 2024 22:40:30 GMT - request: method: get uri: https://api.stripe.com/v1/payment_methods/pm_card_mastercard @@ -215,20 +218,17 @@ http_interactions: string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_tvTBJjnxpf5qXy","request_duration_ms":1696}}' + - '{"last_request_metrics":{"request_id":"req_NGp4nup5Hy409f","request_duration_ms":2034}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -241,11 +241,11 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:23:00 GMT + - Wed, 17 Apr 2024 22:40:31 GMT Content-Type: - application/json Content-Length: - - '977' + - '1013' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -266,10 +266,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_vV7bfcGNN6GDXn + - req_5nEx5aRlvAqSnI Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -280,8 +286,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoefXKuuB1fWySn407A6STW", + "id": "pm_1P6h9XKuuB1fWySnxUKsZ4Rc", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -304,7 +311,7 @@ http_interactions: }, "country": "US", "display_brand": "mastercard", - "exp_month": 2, + "exp_month": 4, "exp_year": 2025, "fingerprint": "BL35fEFVcTTS5wpE", "funding": "credit", @@ -321,13 +328,13 @@ http_interactions: }, "wallet": null }, - "created": 1709094179, + "created": 1713393631, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Wed, 28 Feb 2024 04:23:00 GMT + recorded_at: Wed, 17 Apr 2024 22:40:31 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents @@ -336,22 +343,19 @@ http_interactions: string: amount=1000¤cy=aud&payment_method=pm_card_mastercard&payment_method_types[0]=card&capture_method=automatic&confirm=true headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_vV7bfcGNN6GDXn","request_duration_ms":381}}' + - '{"last_request_metrics":{"request_id":"req_5nEx5aRlvAqSnI","request_duration_ms":432}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Stripe-Account: - - acct_1OoefV4C2tKH5dGL + - acct_1P6h9U4J9zQRH3My Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -364,7 +368,7 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:23:01 GMT + - Wed, 17 Apr 2024 22:40:32 GMT Content-Type: - application/json Content-Length: @@ -388,18 +392,24 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 2989f409-6a08-4cfa-a4fa-dd10e361ed8c + - d508fb8d-38d8-4a0b-811a-9bb831203e0d Original-Request: - - req_t1G1fXjle87ldK + - req_n8JawX3qxyVWiw + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_t1G1fXjle87ldK + - req_n8JawX3qxyVWiw Stripe-Account: - - acct_1OoefV4C2tKH5dGL + - acct_1P6h9U4J9zQRH3My Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -410,7 +420,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoefY4C2tKH5dGL1GZJ9p6K", + "id": "pi_3P6h9X4J9zQRH3My1lrN8v5w", "object": "payment_intent", "amount": 1000, "amount_capturable": 0, @@ -424,20 +434,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "automatic", - "client_secret": "pi_3OoefY4C2tKH5dGL1GZJ9p6K_secret_yTGvOEMPhBORAgEQagwJpXTPI", + "client_secret": "", "confirmation_method": "automatic", - "created": 1709094180, + "created": 1713393631, "currency": "aud", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoefY4C2tKH5dGL1VlO0lYA", + "latest_charge": "ch_3P6h9X4J9zQRH3My1zpsSRbK", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoefY4C2tKH5dGL4j5cFhFa", + "payment_method": "pm_1P6h9X4J9zQRH3MydDNs5uI5", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -462,31 +472,28 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Wed, 28 Feb 2024 04:23:01 GMT + recorded_at: Wed, 17 Apr 2024 22:40:32 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoefY4C2tKH5dGL1GZJ9p6K + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h9X4J9zQRH3My1lrN8v5w body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_t1G1fXjle87ldK","request_duration_ms":1504}}' + - '{"last_request_metrics":{"request_id":"req_n8JawX3qxyVWiw","request_duration_ms":1428}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Stripe-Account: - - acct_1OoefV4C2tKH5dGL + - acct_1P6h9U4J9zQRH3My Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -499,7 +506,7 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:23:01 GMT + - Wed, 17 Apr 2024 22:40:33 GMT Content-Type: - application/json Content-Length: @@ -524,12 +531,18 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_lZyw7j5pG8K6Cv + - req_trWQLXd1iOtBPW Stripe-Account: - - acct_1OoefV4C2tKH5dGL + - acct_1P6h9U4J9zQRH3My Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -540,7 +553,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoefY4C2tKH5dGL1GZJ9p6K", + "id": "pi_3P6h9X4J9zQRH3My1lrN8v5w", "object": "payment_intent", "amount": 1000, "amount_capturable": 0, @@ -554,20 +567,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "automatic", - "client_secret": "pi_3OoefY4C2tKH5dGL1GZJ9p6K_secret_yTGvOEMPhBORAgEQagwJpXTPI", + "client_secret": "", "confirmation_method": "automatic", - "created": 1709094180, + "created": 1713393631, "currency": "aud", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoefY4C2tKH5dGL1VlO0lYA", + "latest_charge": "ch_3P6h9X4J9zQRH3My1zpsSRbK", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoefY4C2tKH5dGL4j5cFhFa", + "payment_method": "pm_1P6h9X4J9zQRH3MydDNs5uI5", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -592,26 +605,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Wed, 28 Feb 2024 04:23:01 GMT + recorded_at: Wed, 17 Apr 2024 22:40:33 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoefY4C2tKH5dGL1GZJ9p6K + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h9X4J9zQRH3My1lrN8v5w body: encoding: US-ASCII string: '' headers: Authorization: - - Basic c2tfdGVzdF94RmdKUU9sWHBNQUZzb3p0endGQlRGaFAwMEhHN0J1Q0ptOg== + - "" User-Agent: - Stripe/v1 ActiveMerchantBindings/1.133.0 Stripe-Version: - '2020-08-27' X-Stripe-Client-User-Agent: - - '{"bindings_version":"1.133.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","publisher":"active_merchant"}' + - "" X-Stripe-Client-User-Metadata: - '{"ip":null}' Stripe-Account: - - acct_1OoefV4C2tKH5dGL + - acct_1P6h9U4J9zQRH3My Connection: - close Accept-Encoding: @@ -626,11 +639,11 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:23:02 GMT + - Wed, 17 Apr 2024 22:40:33 GMT Content-Type: - application/json Content-Length: - - '5159' + - '5160' Connection: - close Access-Control-Allow-Credentials: @@ -651,10 +664,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_FH8bGixsjbByLa + - req_56qLfIgLmecudN Stripe-Account: - - acct_1OoefV4C2tKH5dGL + - acct_1P6h9U4J9zQRH3My Stripe-Version: - '2020-08-27' Vary: @@ -667,7 +686,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoefY4C2tKH5dGL1GZJ9p6K", + "id": "pi_3P6h9X4J9zQRH3My1lrN8v5w", "object": "payment_intent", "amount": 1000, "amount_capturable": 0, @@ -685,7 +704,7 @@ http_interactions: "object": "list", "data": [ { - "id": "ch_3OoefY4C2tKH5dGL1VlO0lYA", + "id": "ch_3P6h9X4J9zQRH3My1zpsSRbK", "object": "charge", "amount": 1000, "amount_captured": 1000, @@ -693,7 +712,7 @@ http_interactions: "application": "", "application_fee": null, "application_fee_amount": null, - "balance_transaction": "txn_3OoefY4C2tKH5dGL13dcK4j1", + "balance_transaction": "txn_3P6h9X4J9zQRH3My19TMsgUl", "billing_details": { "address": { "city": null, @@ -709,7 +728,7 @@ http_interactions: }, "calculated_statement_descriptor": "OFNOFNOFN", "captured": true, - "created": 1709094180, + "created": 1713393631, "currency": "aud", "customer": null, "description": null, @@ -729,13 +748,13 @@ http_interactions: "network_status": "approved_by_network", "reason": null, "risk_level": "normal", - "risk_score": 7, + "risk_score": 25, "seller_message": "Payment complete.", "type": "authorized" }, "paid": true, - "payment_intent": "pi_3OoefY4C2tKH5dGL1GZJ9p6K", - "payment_method": "pm_1OoefY4C2tKH5dGL4j5cFhFa", + "payment_intent": "pi_3P6h9X4J9zQRH3My1lrN8v5w", + "payment_method": "pm_1P6h9X4J9zQRH3MydDNs5uI5", "payment_method_details": { "card": { "amount_authorized": 1000, @@ -746,7 +765,7 @@ http_interactions: "cvc_check": "pass" }, "country": "US", - "exp_month": 2, + "exp_month": 4, "exp_year": 2025, "extended_authorization": { "status": "disabled" @@ -778,14 +797,14 @@ http_interactions: "radar_options": {}, "receipt_email": null, "receipt_number": null, - "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xT29lZlY0QzJ0S0g1ZEdMKKbq-q4GMgaRkN_RRNQ6LBZz6CQXHZCrsn25QS9Jm5gbb44sYBgtlhvBnbTpsJMQXRa5GaNsE626dU5n", + "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xUDZoOVU0Sjl6UVJIM015KOGfgbEGMgaJ38Vstsk6LBZqZ4EqA_Jb1nXwx7qoa52FEauKV8E9KD9JKvi9eVJz0rjBaa9Gn_Hxu-mB", "refunded": false, "refunds": { "object": "list", "data": [], "has_more": false, "total_count": 0, - "url": "/v1/charges/ch_3OoefY4C2tKH5dGL1VlO0lYA/refunds" + "url": "/v1/charges/ch_3P6h9X4J9zQRH3My1zpsSRbK/refunds" }, "review": null, "shipping": null, @@ -800,22 +819,22 @@ http_interactions: ], "has_more": false, "total_count": 1, - "url": "/v1/charges?payment_intent=pi_3OoefY4C2tKH5dGL1GZJ9p6K" + "url": "/v1/charges?payment_intent=pi_3P6h9X4J9zQRH3My1lrN8v5w" }, - "client_secret": "pi_3OoefY4C2tKH5dGL1GZJ9p6K_secret_yTGvOEMPhBORAgEQagwJpXTPI", + "client_secret": "", "confirmation_method": "automatic", - "created": 1709094180, + "created": 1713393631, "currency": "aud", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoefY4C2tKH5dGL1VlO0lYA", + "latest_charge": "ch_3P6h9X4J9zQRH3My1zpsSRbK", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoefY4C2tKH5dGL4j5cFhFa", + "payment_method": "pm_1P6h9X4J9zQRH3MydDNs5uI5", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -840,10 +859,10 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Wed, 28 Feb 2024 04:23:02 GMT + recorded_at: Wed, 17 Apr 2024 22:40:33 GMT - request: method: post - uri: https://api.stripe.com/v1/charges/ch_3OoefY4C2tKH5dGL1VlO0lYA/refunds + uri: https://api.stripe.com/v1/charges/ch_3P6h9X4J9zQRH3My1zpsSRbK/refunds body: encoding: UTF-8 string: amount=1000&expand[0]=charge @@ -851,17 +870,17 @@ http_interactions: Content-Type: - application/x-www-form-urlencoded Authorization: - - Basic c2tfdGVzdF94RmdKUU9sWHBNQUZzb3p0endGQlRGaFAwMEhHN0J1Q0ptOg== + - "" User-Agent: - Stripe/v1 ActiveMerchantBindings/1.133.0 Stripe-Version: - '2020-08-27' X-Stripe-Client-User-Agent: - - '{"bindings_version":"1.133.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","publisher":"active_merchant"}' + - "" X-Stripe-Client-User-Metadata: - '{"ip":null}' Stripe-Account: - - acct_1OoefV4C2tKH5dGL + - acct_1P6h9U4J9zQRH3My Connection: - close Accept-Encoding: @@ -876,11 +895,11 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:23:03 GMT + - Wed, 17 Apr 2024 22:40:35 GMT Content-Type: - application/json Content-Length: - - '4535' + - '4536' Connection: - close Access-Control-Allow-Credentials: @@ -901,14 +920,20 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - e3b5a699-fd66-4438-acf5-dbcdd0c0cd8f + - 9d127053-8fbc-47b8-af3c-33154315c0f9 Original-Request: - - req_gnYblTnZmxelLp + - req_q1VaJ3ZV8IX30r + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_gnYblTnZmxelLp + - req_q1VaJ3ZV8IX30r Stripe-Account: - - acct_1OoefV4C2tKH5dGL + - acct_1P6h9U4J9zQRH3My Stripe-Should-Retry: - 'false' Stripe-Version: @@ -923,12 +948,12 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "re_3OoefY4C2tKH5dGL13F5cUVM", + "id": "re_3P6h9X4J9zQRH3My1kW0Cu0Q", "object": "refund", "amount": 1000, - "balance_transaction": "txn_3OoefY4C2tKH5dGL1DQGbKPm", + "balance_transaction": "txn_3P6h9X4J9zQRH3My1sUbTVx5", "charge": { - "id": "ch_3OoefY4C2tKH5dGL1VlO0lYA", + "id": "ch_3P6h9X4J9zQRH3My1zpsSRbK", "object": "charge", "amount": 1000, "amount_captured": 1000, @@ -936,7 +961,7 @@ http_interactions: "application": "", "application_fee": null, "application_fee_amount": null, - "balance_transaction": "txn_3OoefY4C2tKH5dGL13dcK4j1", + "balance_transaction": "txn_3P6h9X4J9zQRH3My19TMsgUl", "billing_details": { "address": { "city": null, @@ -952,7 +977,7 @@ http_interactions: }, "calculated_statement_descriptor": "OFNOFNOFN", "captured": true, - "created": 1709094180, + "created": 1713393631, "currency": "aud", "customer": null, "description": null, @@ -972,13 +997,13 @@ http_interactions: "network_status": "approved_by_network", "reason": null, "risk_level": "normal", - "risk_score": 7, + "risk_score": 25, "seller_message": "Payment complete.", "type": "authorized" }, "paid": true, - "payment_intent": "pi_3OoefY4C2tKH5dGL1GZJ9p6K", - "payment_method": "pm_1OoefY4C2tKH5dGL4j5cFhFa", + "payment_intent": "pi_3P6h9X4J9zQRH3My1lrN8v5w", + "payment_method": "pm_1P6h9X4J9zQRH3MydDNs5uI5", "payment_method_details": { "card": { "amount_authorized": 1000, @@ -989,7 +1014,7 @@ http_interactions: "cvc_check": "pass" }, "country": "US", - "exp_month": 2, + "exp_month": 4, "exp_year": 2025, "extended_authorization": { "status": "disabled" @@ -1021,18 +1046,18 @@ http_interactions: "radar_options": {}, "receipt_email": null, "receipt_number": null, - "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xT29lZlY0QzJ0S0g1ZEdMKKfq-q4GMgaZksVQP2U6LBbzMTFesAxG2bPJiPJrrQg4rFEMLvIeOgyWS0m6-vJl8TTT-s9srkaZHmxm", + "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xUDZoOVU0Sjl6UVJIM015KOOfgbEGMga7crcak446LBZV8k3AdZ7kcO6J93E0lqOsRbVAkzRhffx3G6xc_Xn9HEH4rs_wV9FwBuv_", "refunded": true, "refunds": { "object": "list", "data": [ { - "id": "re_3OoefY4C2tKH5dGL13F5cUVM", + "id": "re_3P6h9X4J9zQRH3My1kW0Cu0Q", "object": "refund", "amount": 1000, - "balance_transaction": "txn_3OoefY4C2tKH5dGL1DQGbKPm", - "charge": "ch_3OoefY4C2tKH5dGL1VlO0lYA", - "created": 1709094182, + "balance_transaction": "txn_3P6h9X4J9zQRH3My1sUbTVx5", + "charge": "ch_3P6h9X4J9zQRH3My1zpsSRbK", + "created": 1713393634, "currency": "aud", "destination_details": { "card": { @@ -1043,7 +1068,7 @@ http_interactions: "type": "card" }, "metadata": {}, - "payment_intent": "pi_3OoefY4C2tKH5dGL1GZJ9p6K", + "payment_intent": "pi_3P6h9X4J9zQRH3My1lrN8v5w", "reason": null, "receipt_number": null, "source_transfer_reversal": null, @@ -1053,7 +1078,7 @@ http_interactions: ], "has_more": false, "total_count": 1, - "url": "/v1/charges/ch_3OoefY4C2tKH5dGL1VlO0lYA/refunds" + "url": "/v1/charges/ch_3P6h9X4J9zQRH3My1zpsSRbK/refunds" }, "review": null, "shipping": null, @@ -1065,7 +1090,7 @@ http_interactions: "transfer_data": null, "transfer_group": null }, - "created": 1709094182, + "created": 1713393634, "currency": "aud", "destination_details": { "card": { @@ -1076,12 +1101,94 @@ http_interactions: "type": "card" }, "metadata": {}, - "payment_intent": "pi_3OoefY4C2tKH5dGL1GZJ9p6K", + "payment_intent": "pi_3P6h9X4J9zQRH3My1lrN8v5w", "reason": null, "receipt_number": null, "source_transfer_reversal": null, "status": "succeeded", "transfer_reversal": null } - recorded_at: Wed, 28 Feb 2024 04:23:03 GMT + recorded_at: Wed, 17 Apr 2024 22:40:35 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/accounts/acct_1P6h9U4J9zQRH3My + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_trWQLXd1iOtBPW","request_duration_ms":394}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:40:36 GMT + Content-Type: + - application/json + Content-Length: + - '77' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts%2F%3Aaccount; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_fv2gjlLRUsoRVA + Stripe-Account: + - acct_1P6h9U4J9zQRH3My + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h9U4J9zQRH3My", + "object": "account", + "deleted": true + } + recorded_at: Wed, 17 Apr 2024 22:40:36 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_Gateway_StripeSCA/_void/with_a_voidable_payment/void_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_void/with_a_voidable_payment/void_the_payment.yml similarity index 72% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_Gateway_StripeSCA/_void/with_a_voidable_payment/void_the_payment.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_void/with_a_voidable_payment/void_the_payment.yml index ce315fb2b1..51223a0dd6 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Spree_Gateway_StripeSCA/_void/with_a_voidable_payment/void_the_payment.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Spree_Gateway_StripeSCA/_void/with_a_voidable_payment/void_the_payment.yml @@ -8,20 +8,17 @@ http_interactions: string: type=standard&country=AU&email=carrot.producer%40example.com headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_lZyw7j5pG8K6Cv","request_duration_ms":296}}' + - '{"last_request_metrics":{"request_id":"req_fv2gjlLRUsoRVA","request_duration_ms":1024}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,7 +31,7 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:23:05 GMT + - Wed, 17 Apr 2024 22:40:38 GMT Content-Type: - application/json Content-Length: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 1ef2201e-0e24-4640-982d-6568c4052527 + - 3c3bece9-daff-4fb1-9ce0-425023ae7683 Original-Request: - - req_s4ofxXP0G2Y783 + - req_sEpazGkTWBhiqv + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_s4ofxXP0G2Y783 + - req_sEpazGkTWBhiqv Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,7 +81,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "acct_1Ooefb4DjmilFkgB", + "id": "acct_1P6h9c3PPJnQM4Nb", "object": "account", "business_profile": { "annual_revenue": null, @@ -100,7 +103,7 @@ http_interactions: "type": "application" }, "country": "AU", - "created": 1709094184, + "created": 1713393637, "default_currency": "aud", "details_submitted": false, "email": "carrot.producer@example.com", @@ -109,7 +112,7 @@ http_interactions: "data": [], "has_more": false, "total_count": 0, - "url": "/v1/accounts/acct_1Ooefb4DjmilFkgB/external_accounts" + "url": "/v1/accounts/acct_1P6h9c3PPJnQM4Nb/external_accounts" }, "future_requirements": { "alternatives": [], @@ -206,7 +209,7 @@ http_interactions: }, "type": "standard" } - recorded_at: Wed, 28 Feb 2024 04:23:05 GMT + recorded_at: Wed, 17 Apr 2024 22:40:38 GMT - request: method: get uri: https://api.stripe.com/v1/payment_methods/pm_card_mastercard @@ -215,20 +218,17 @@ http_interactions: string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_s4ofxXP0G2Y783","request_duration_ms":1698}}' + - '{"last_request_metrics":{"request_id":"req_sEpazGkTWBhiqv","request_duration_ms":1696}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -241,11 +241,11 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:23:06 GMT + - Wed, 17 Apr 2024 22:40:39 GMT Content-Type: - application/json Content-Length: - - '977' + - '1013' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -266,10 +266,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_YRYMRdfcJyCfpc + - req_C4Mv9CPrpMkRrT Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -280,8 +286,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoefeKuuB1fWySn4sV0w7me", + "id": "pm_1P6h9fKuuB1fWySn5z3LyCFT", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -304,7 +311,7 @@ http_interactions: }, "country": "US", "display_brand": "mastercard", - "exp_month": 2, + "exp_month": 4, "exp_year": 2025, "fingerprint": "BL35fEFVcTTS5wpE", "funding": "credit", @@ -321,13 +328,13 @@ http_interactions: }, "wallet": null }, - "created": 1709094186, + "created": 1713393639, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Wed, 28 Feb 2024 04:23:06 GMT + recorded_at: Wed, 17 Apr 2024 22:40:39 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents @@ -336,22 +343,19 @@ http_interactions: string: amount=1000¤cy=aud&payment_method=pm_card_mastercard&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_YRYMRdfcJyCfpc","request_duration_ms":414}}' + - '{"last_request_metrics":{"request_id":"req_C4Mv9CPrpMkRrT","request_duration_ms":539}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Stripe-Account: - - acct_1Ooefb4DjmilFkgB + - acct_1P6h9c3PPJnQM4Nb Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -364,7 +368,7 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:23:06 GMT + - Wed, 17 Apr 2024 22:40:39 GMT Content-Type: - application/json Content-Length: @@ -388,18 +392,24 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 4709c865-413b-4f63-92de-88ea134ca3fc + - ef909d12-ae9d-4c10-98eb-70181d39f195 Original-Request: - - req_924xRbbZ96ZSGs + - req_NKSYSayqFPaZmQ + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_924xRbbZ96ZSGs + - req_NKSYSayqFPaZmQ Stripe-Account: - - acct_1Ooefb4DjmilFkgB + - acct_1P6h9c3PPJnQM4Nb Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -410,7 +420,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3Ooefe4DjmilFkgB0MRGxtD7", + "id": "pi_3P6h9f3PPJnQM4Nb1soYNeEx", "object": "payment_intent", "amount": 1000, "amount_capturable": 0, @@ -424,9 +434,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3Ooefe4DjmilFkgB0MRGxtD7_secret_m61Cyi5MpCkThDwF1HOTfVtTh", + "client_secret": "", "confirmation_method": "automatic", - "created": 1709094186, + "created": 1713393639, "currency": "aud", "customer": null, "description": null, @@ -437,7 +447,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1Ooefe4DjmilFkgBPSiob94t", + "payment_method": "pm_1P6h9f3PPJnQM4NbdZWYb7Mn", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -462,31 +472,28 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Wed, 28 Feb 2024 04:23:06 GMT + recorded_at: Wed, 17 Apr 2024 22:40:39 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3Ooefe4DjmilFkgB0MRGxtD7 + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h9f3PPJnQM4Nb1soYNeEx body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_924xRbbZ96ZSGs","request_duration_ms":508}}' + - '{"last_request_metrics":{"request_id":"req_NKSYSayqFPaZmQ","request_duration_ms":537}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Stripe-Account: - - acct_1Ooefb4DjmilFkgB + - acct_1P6h9c3PPJnQM4Nb Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -499,7 +506,7 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:23:07 GMT + - Wed, 17 Apr 2024 22:40:40 GMT Content-Type: - application/json Content-Length: @@ -524,12 +531,18 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_o2i92svEF6wZ9X + - req_y5YXRAeQMZrIzE Stripe-Account: - - acct_1Ooefb4DjmilFkgB + - acct_1P6h9c3PPJnQM4Nb Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -540,7 +553,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3Ooefe4DjmilFkgB0MRGxtD7", + "id": "pi_3P6h9f3PPJnQM4Nb1soYNeEx", "object": "payment_intent", "amount": 1000, "amount_capturable": 0, @@ -554,9 +567,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3Ooefe4DjmilFkgB0MRGxtD7_secret_m61Cyi5MpCkThDwF1HOTfVtTh", + "client_secret": "", "confirmation_method": "automatic", - "created": 1709094186, + "created": 1713393639, "currency": "aud", "customer": null, "description": null, @@ -567,7 +580,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1Ooefe4DjmilFkgBPSiob94t", + "payment_method": "pm_1P6h9f3PPJnQM4NbdZWYb7Mn", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -592,10 +605,10 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Wed, 28 Feb 2024 04:23:07 GMT + recorded_at: Wed, 17 Apr 2024 22:40:40 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3Ooefe4DjmilFkgB0MRGxtD7/cancel + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h9f3PPJnQM4Nb1soYNeEx/cancel body: encoding: US-ASCII string: '' @@ -603,17 +616,17 @@ http_interactions: Content-Type: - application/x-www-form-urlencoded Authorization: - - Basic c2tfdGVzdF94RmdKUU9sWHBNQUZzb3p0endGQlRGaFAwMEhHN0J1Q0ptOg== + - "" User-Agent: - Stripe/v1 ActiveMerchantBindings/1.133.0 Stripe-Version: - '2020-08-27' X-Stripe-Client-User-Agent: - - '{"bindings_version":"1.133.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","publisher":"active_merchant"}' + - "" X-Stripe-Client-User-Metadata: - '{"ip":null}' Stripe-Account: - - acct_1Ooefb4DjmilFkgB + - acct_1P6h9c3PPJnQM4Nb Connection: - close Accept-Encoding: @@ -628,7 +641,7 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:23:07 GMT + - Wed, 17 Apr 2024 22:40:40 GMT Content-Type: - application/json Content-Length: @@ -653,14 +666,20 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - a75b58f8-d2f4-43b6-aff2-21023fcc77f2 + - 6cb49bb9-8d9b-49c3-b9ef-50d86e81ed5a Original-Request: - - req_WU2ReDoGdQvhVb + - req_RSjiYLCTAQHsEs + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_WU2ReDoGdQvhVb + - req_RSjiYLCTAQHsEs Stripe-Account: - - acct_1Ooefb4DjmilFkgB + - acct_1P6h9c3PPJnQM4Nb Stripe-Should-Retry: - 'false' Stripe-Version: @@ -675,7 +694,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3Ooefe4DjmilFkgB0MRGxtD7", + "id": "pi_3P6h9f3PPJnQM4Nb1soYNeEx", "object": "payment_intent", "amount": 1000, "amount_capturable": 0, @@ -686,7 +705,7 @@ http_interactions: "application": "", "application_fee_amount": null, "automatic_payment_methods": null, - "canceled_at": 1709094187, + "canceled_at": 1713393640, "cancellation_reason": null, "capture_method": "manual", "charges": { @@ -694,11 +713,11 @@ http_interactions: "data": [], "has_more": false, "total_count": 0, - "url": "/v1/charges?payment_intent=pi_3Ooefe4DjmilFkgB0MRGxtD7" + "url": "/v1/charges?payment_intent=pi_3P6h9f3PPJnQM4Nb1soYNeEx" }, - "client_secret": "pi_3Ooefe4DjmilFkgB0MRGxtD7_secret_m61Cyi5MpCkThDwF1HOTfVtTh", + "client_secret": "", "confirmation_method": "automatic", - "created": 1709094186, + "created": 1713393639, "currency": "aud", "customer": null, "description": null, @@ -709,7 +728,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1Ooefe4DjmilFkgBPSiob94t", + "payment_method": "pm_1P6h9f3PPJnQM4NbdZWYb7Mn", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -734,5 +753,87 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Wed, 28 Feb 2024 04:23:07 GMT + recorded_at: Wed, 17 Apr 2024 22:40:41 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/accounts/acct_1P6h9c3PPJnQM4Nb + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_y5YXRAeQMZrIzE","request_duration_ms":359}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:40:42 GMT + Content-Type: + - application/json + Content-Length: + - '77' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts%2F%3Aaccount; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_B60iS3d4eUM92l + Stripe-Account: + - acct_1P6h9c3PPJnQM4Nb + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h9c3PPJnQM4Nb", + "object": "account", + "deleted": true + } + recorded_at: Wed, 17 Apr 2024 22:40:42 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripeAccount/deauthorize_and_destroy/when_the_Stripe_API_disconnect_fails/destroys_the_record_and_notifies_Bugsnag.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripeAccount/deauthorize_and_destroy/when_the_Stripe_API_disconnect_fails/destroys_the_record_and_notifies_Bugsnag.yml new file mode 100644 index 0000000000..a44adc3684 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripeAccount/deauthorize_and_destroy/when_the_Stripe_API_disconnect_fails/destroys_the_record_and_notifies_Bugsnag.yml @@ -0,0 +1,92 @@ +--- +http_interactions: +- request: + method: post + uri: https://connect.stripe.com/oauth/deauthorize + body: + encoding: UTF-8 + string: stripe_user_id=&client_id=bogus_client_id + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_zc8hvLjwOG6Dsw","request_duration_ms":1019}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 401 + message: Unauthorized + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:41:00 GMT + Content-Type: + - application/json + Content-Length: + - '110' + Connection: + - keep-alive + Cache-Control: + - max-age=0, no-cache, no-store, must-revalidate + Content-Security-Policy: + - report-uri /csp-report?p=%2Foauth%2Fdeauthorize;block-all-mixed-content;default-src + 'none' 'report-sample';base-uri 'none';form-action 'none';style-src 'unsafe-inline';frame-ancestors + 'self';connect-src 'self';img-src 'self' https://b.stripecdn.com + Cross-Origin-Opener-Policy-Report-Only: + - same-origin-allow-popups; report-to="coop" + Expires: + - '0' + Pragma: + - no-cache + Referrer-Policy: + - strict-origin-when-cross-origin + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_NSGSltGyJ7L7cj + Set-Cookie: + - __stripe_orig_props=%7B%22referrer%22%3A%22%22%2C%22landing%22%3A%22https%3A%2F%2Fconnect.stripe.com%2Foauth%2Fdeauthorize%22%7D; + domain=stripe.com; path=/; expires=Thu, 17 Apr 2025 22:41:00 GMT; secure; + HttpOnly; SameSite=Lax + - cid=5145cfc5-24a6-40e3-abb8-90bfe57bad32; domain=stripe.com; path=/; expires=Tue, + 16 Jul 2024 22:41:00 GMT; secure; SameSite=Lax + - machine_identifier=BCqb3iQpc%2FaqdFTVTawu6mbVZbkeldjYEgeOKCps5Hj7cLsLdzK8GGhBvJ2a6imtb0U%3D; + domain=stripe.com; path=/; expires=Thu, 17 Apr 2025 22:41:00 GMT; secure; + HttpOnly; SameSite=Lax + - private_machine_identifier=7YF7smRjWUw8eD17qPxfSf2k5rE7OXma5BrYsJQF0b%2FAcfLtuciB8wVuVUcFdQHSFIU%3D; + domain=stripe.com; path=/; expires=Thu, 17 Apr 2025 22:41:00 GMT; secure; + HttpOnly; SameSite=None + - stripe.csrf=QsoKbV0fwPYXcMT4Y87keEJgYX0F6EmDzYbKqjlGBNiO7fw9AhXQ_uB5f2NNsl-zScHN2J7YxmbbatQpJKZ1cjw-AYTZVJyNhnBKgQZbBXeSlsF-lgGOfzsFYUgeV-mUUrkFUEfweg%3D%3D; + domain=stripe.com; path=/; secure; HttpOnly; SameSite=None + Stripe-Kill-Route: + - "[]" + Stripe-Version: + - '2024-04-10' + Www-Authenticate: + - Bearer realm="Stripe" + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: '{"error":"invalid_client","error_description":"No such application: + ''bogus_client_id''","stripe_user_id":null} + + ' + recorded_at: Wed, 17 Apr 2024 22:41:00 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripeAccount/deauthorize_and_destroy/when_the_Stripe_API_disconnect_succeeds/destroys_the_record.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripeAccount/deauthorize_and_destroy/when_the_Stripe_API_disconnect_succeeds/destroys_the_record.yml similarity index 72% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripeAccount/deauthorize_and_destroy/when_the_Stripe_API_disconnect_succeeds/destroys_the_record.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripeAccount/deauthorize_and_destroy/when_the_Stripe_API_disconnect_succeeds/destroys_the_record.yml index 6ef0bdc77c..c8aa1ce714 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripeAccount/deauthorize_and_destroy/when_the_Stripe_API_disconnect_succeeds/destroys_the_record.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripeAccount/deauthorize_and_destroy/when_the_Stripe_API_disconnect_succeeds/destroys_the_record.yml @@ -8,20 +8,17 @@ http_interactions: string: type=standard&country=AU&email=jumping.jack%40example.com headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_4LwwjkiCeJTWny","request_duration_ms":281}}' + - '{"last_request_metrics":{"request_id":"req_zc8hvLjwOG6Dsw","request_duration_ms":1019}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,7 +31,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:28 GMT + - Wed, 17 Apr 2024 22:41:02 GMT Content-Type: - application/json Content-Length: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 2ec3d890-51fb-4bef-8edc-8a0280fc4d6f + - e3a2c76a-3783-4d5b-8bd1-0b059c7cc17b Original-Request: - - req_MhARQZfcxlupB0 + - req_y4sp0UmrRilWdn + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_MhARQZfcxlupB0 + - req_y4sp0UmrRilWdn Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,7 +81,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "acct_1OoDRHQRupqKVzqU", + "id": "acct_1P6hA14CyWKcBaxF", "object": "account", "business_profile": { "annual_revenue": null, @@ -100,7 +103,7 @@ http_interactions: "type": "application" }, "country": "AU", - "created": 1708989507, + "created": 1713393662, "default_currency": "aud", "details_submitted": false, "email": "jumping.jack@example.com", @@ -109,7 +112,7 @@ http_interactions: "data": [], "has_more": false, "total_count": 0, - "url": "/v1/accounts/acct_1OoDRHQRupqKVzqU/external_accounts" + "url": "/v1/accounts/acct_1P6hA14CyWKcBaxF/external_accounts" }, "future_requirements": { "alternatives": [], @@ -206,29 +209,26 @@ http_interactions: }, "type": "standard" } - recorded_at: Mon, 26 Feb 2024 23:18:28 GMT + recorded_at: Wed, 17 Apr 2024 22:41:03 GMT - request: method: post uri: https://connect.stripe.com/oauth/deauthorize body: encoding: UTF-8 - string: stripe_user_id=acct_1OoDRHQRupqKVzqU&client_id= + string: stripe_user_id=acct_1P6hA14CyWKcBaxF&client_id= headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_MhARQZfcxlupB0","request_duration_ms":1638}}' + - '{"last_request_metrics":{"request_id":"req_y4sp0UmrRilWdn","request_duration_ms":2030}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -241,11 +241,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:29 GMT + - Wed, 17 Apr 2024 22:41:03 GMT Content-Type: - application/json Content-Length: - - '47' + - '81' Connection: - keep-alive Cache-Control: @@ -255,44 +255,45 @@ http_interactions: 'none' 'report-sample';base-uri 'none';form-action 'none';style-src 'unsafe-inline';frame-ancestors 'self';connect-src 'self';img-src 'self' https://b.stripecdn.com Cross-Origin-Opener-Policy-Report-Only: - - same-origin; report-to=https://q.stripe.com/coop-report + - same-origin-allow-popups; report-to="coop" Expires: - '0' Pragma: - no-cache Referrer-Policy: - strict-origin-when-cross-origin + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_KzegHddQIdmvfb + - req_tuOGRA5fMeWcGd Set-Cookie: - - __Host-session=; path=/; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT; - secure; SameSite=None - __stripe_orig_props=%7B%22referrer%22%3A%22%22%2C%22landing%22%3A%22https%3A%2F%2Fconnect.stripe.com%2Foauth%2Fdeauthorize%22%7D; - domain=stripe.com; path=/; expires=Tue, 25 Feb 2025 23:18:29 GMT; secure; + domain=stripe.com; path=/; expires=Thu, 17 Apr 2025 22:41:03 GMT; secure; HttpOnly; SameSite=Lax - - cid=55982463-3b25-4408-93b2-27bec85dfcfc; domain=stripe.com; path=/; expires=Sun, - 26 May 2024 23:18:29 GMT; secure; SameSite=Lax - - machine_identifier=w54MzMN5c6Eiz4eEDC8wa7rkzspJn4yvGQZMotkt76iaPFhsSLKXI0PWu%2F2P%2BmRTDqU%3D; - domain=stripe.com; path=/; expires=Tue, 25 Feb 2025 23:18:29 GMT; secure; + - cid=bf73f2f1-2730-4bfe-b876-eb2a52e4962b; domain=stripe.com; path=/; expires=Tue, + 16 Jul 2024 22:41:03 GMT; secure; SameSite=Lax + - machine_identifier=PlXTX3M37xnhrzfE%2FTYiF1zopgjPNwB%2BbIhFkFQGbea1hcnRQd%2Bnc69or4YgFhmh4kk%3D; + domain=stripe.com; path=/; expires=Thu, 17 Apr 2025 22:41:03 GMT; secure; HttpOnly; SameSite=Lax - - private_machine_identifier=8CTJtExCiBX06tvQfQHq3SpwiRP08AVl8vjeuqf8SugPBHIcHu7KZ0Bdl8SyqyqdoO4%3D; - domain=stripe.com; path=/; expires=Tue, 25 Feb 2025 23:18:29 GMT; secure; + - private_machine_identifier=dnLBg3Z4kBckQs94fSyCCFWmWRjRbJlO5detDWo3Kpbysho0cR%2B%2BEm7sk4bzCTmuTqQ%3D; + domain=stripe.com; path=/; expires=Thu, 17 Apr 2025 22:41:03 GMT; secure; HttpOnly; SameSite=None - - site-auth=; domain=stripe.com; path=/; max-age=0; expires=Thu, 01 Jan 1970 - 00:00:00 GMT; secure - - stripe.csrf=WWGSDArstUczHDfLq2EbInmbStxGgwxwqsr1SFMfWhQU8oWACZCaedj_xk64p0Qy5ZBtd62ivStoMuUHXRspETw-AYTZVJwuGdncr-p6Z3s2Kp7CqE4cqE8Jy4zw7q7dSD5XzTnalw%3D%3D; + - stripe.csrf=ZVM3UQ2vutPuntBqAZtAvnXXWxcVydPwAZ9KWGkoqXqSIzPNAhcjwh-JqCiVIs9GUx3FOyEHaW4WmhAix-M9Ujw-AYTZVJw3wFcX1VecoxDMwYHHg7CC2d5XmPzDtYpnBy0C0_jQkw%3D%3D; domain=stripe.com; path=/; secure; HttpOnly; SameSite=None Stripe-Kill-Route: - "[]" + Stripe-Version: + - '2024-04-10' X-Stripe-Routing-Context-Priority-Tier: - api-testmode Strict-Transport-Security: - max-age=63072000; includeSubDomains; preload body: encoding: UTF-8 - string: |- - { - "stripe_user_id": "acct_1OoDRHQRupqKVzqU" - } - recorded_at: Mon, 26 Feb 2024 23:18:29 GMT + string: '{"error":null,"error_description":null,"stripe_user_id":"acct_1P6hA14CyWKcBaxF"} + + ' + recorded_at: Wed, 17 Apr 2024 22:41:03 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripePaymentStatus/_stripe_captured_/when_the_Stripe_payment_has_been_captured/returns_true.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripePaymentStatus/_stripe_captured_/when_the_Stripe_payment_has_been_captured/returns_true.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripePaymentStatus/_stripe_captured_/when_the_Stripe_payment_has_been_captured/returns_true.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripePaymentStatus/_stripe_captured_/when_the_Stripe_payment_has_been_captured/returns_true.yml index d340cf0078..250abd8df5 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripePaymentStatus/_stripe_captured_/when_the_Stripe_payment_has_been_captured/returns_true.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripePaymentStatus/_stripe_captured_/when_the_Stripe_payment_has_been_captured/returns_true.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4242424242424242&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_S5vWMffhsD2jZ1","request_duration_ms":1330}}' + - '{"last_request_metrics":{"request_id":"req_N9r6YNyPTBTY9H","request_duration_ms":1297}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:36 GMT + - Wed, 17 Apr 2024 22:41:11 GMT Content-Type: - application/json Content-Length: - - '960' + - '996' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 7544d038-fad8-43ee-86f9-caddc486fecd + - 26396e04-a63b-42de-8e4d-14a2c1bffb08 Original-Request: - - req_oFzey3OGumMfZV + - req_hapdhSFa9oklw7 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_oFzey3OGumMfZV + - req_hapdhSFa9oklw7 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDRQKuuB1fWySn4AM42kc4", + "id": "pm_1P6hABKuuB1fWySnAN7nHeKK", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989516, + "created": 1713393671, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:18:36 GMT + recorded_at: Wed, 17 Apr 2024 22:41:11 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=aud&payment_method=pm_1OoDRQKuuB1fWySn4AM42kc4&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=aud&payment_method=pm_1P6hABKuuB1fWySnAN7nHeKK&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_oFzey3OGumMfZV","request_duration_ms":426}}' + - '{"last_request_metrics":{"request_id":"req_hapdhSFa9oklw7","request_duration_ms":551}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:36 GMT + - Wed, 17 Apr 2024 22:41:12 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - b1a94c75-0f61-4435-9b46-18d579948dd9 + - e475cdc8-4c3f-420c-9f5e-498af7f45c66 Original-Request: - - req_CcG8mNLWRGDXDr + - req_MmWJ8o9z3LAZrf + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_CcG8mNLWRGDXDr + - req_MmWJ8o9z3LAZrf Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDRQKuuB1fWySn01FSE5yV", + "id": "pi_3P6hABKuuB1fWySn1DUCSQ4r", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDRQKuuB1fWySn01FSE5yV_secret_WEQfT3kIi9xm0Z61CLSOOkfnw", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989516, + "created": 1713393671, "currency": "aud", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDRQKuuB1fWySn4AM42kc4", + "payment_method": "pm_1P6hABKuuB1fWySnAN7nHeKK", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:18:36 GMT + recorded_at: Wed, 17 Apr 2024 22:41:12 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDRQKuuB1fWySn01FSE5yV/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6hABKuuB1fWySn1DUCSQ4r/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_CcG8mNLWRGDXDr","request_duration_ms":384}}' + - '{"last_request_metrics":{"request_id":"req_MmWJ8o9z3LAZrf","request_duration_ms":509}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:37 GMT + - Wed, 17 Apr 2024 22:41:13 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 57f9bfb7-bed5-4590-a4e5-ff02c3b54457 + - 477a4847-5315-440a-b513-9699b8f8e6b7 Original-Request: - - req_2yo7AM38rcYqU3 + - req_aW9KyGjMWnuRW6 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_2yo7AM38rcYqU3 + - req_aW9KyGjMWnuRW6 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDRQKuuB1fWySn01FSE5yV", + "id": "pi_3P6hABKuuB1fWySn1DUCSQ4r", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDRQKuuB1fWySn01FSE5yV_secret_WEQfT3kIi9xm0Z61CLSOOkfnw", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989516, + "created": 1713393671, "currency": "aud", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDRQKuuB1fWySn0dPeuvdJ", + "latest_charge": "ch_3P6hABKuuB1fWySn1odNJCg9", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDRQKuuB1fWySn4AM42kc4", + "payment_method": "pm_1P6hABKuuB1fWySnAN7nHeKK", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,29 +398,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:18:38 GMT + recorded_at: Wed, 17 Apr 2024 22:41:13 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDRQKuuB1fWySn01FSE5yV/capture + uri: https://api.stripe.com/v1/payment_intents/pi_3P6hABKuuB1fWySn1DUCSQ4r/capture body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_2yo7AM38rcYqU3","request_duration_ms":1028}}' + - '{"last_request_metrics":{"request_id":"req_aW9KyGjMWnuRW6","request_duration_ms":1124}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -423,7 +430,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:39 GMT + - Wed, 17 Apr 2024 22:41:14 GMT Content-Type: - application/json Content-Length: @@ -448,16 +455,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - aef103c3-ca69-41fc-9250-8594f754a320 + - 4da9cbf3-5f37-46a2-818e-4415bcade748 Original-Request: - - req_yGL8lkFrtz4YGt + - req_uqFRchNX2gvVd6 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_yGL8lkFrtz4YGt + - req_uqFRchNX2gvVd6 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -468,7 +481,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDRQKuuB1fWySn01FSE5yV", + "id": "pi_3P6hABKuuB1fWySn1DUCSQ4r", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -482,20 +495,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDRQKuuB1fWySn01FSE5yV_secret_WEQfT3kIi9xm0Z61CLSOOkfnw", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989516, + "created": 1713393671, "currency": "aud", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDRQKuuB1fWySn0dPeuvdJ", + "latest_charge": "ch_3P6hABKuuB1fWySn1odNJCg9", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDRQKuuB1fWySn4AM42kc4", + "payment_method": "pm_1P6hABKuuB1fWySnAN7nHeKK", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -520,29 +533,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:18:39 GMT + recorded_at: Wed, 17 Apr 2024 22:41:14 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDRQKuuB1fWySn01FSE5yV + uri: https://api.stripe.com/v1/payment_intents/pi_3P6hABKuuB1fWySn1DUCSQ4r body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_yGL8lkFrtz4YGt","request_duration_ms":1520}}' + - '{"last_request_metrics":{"request_id":"req_uqFRchNX2gvVd6","request_duration_ms":1227}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -555,7 +565,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:39 GMT + - Wed, 17 Apr 2024 22:41:15 GMT Content-Type: - application/json Content-Length: @@ -580,10 +590,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_BvR0PpVZI1wbmF + - req_ujKgcbLv0jphd1 Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -594,7 +610,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDRQKuuB1fWySn01FSE5yV", + "id": "pi_3P6hABKuuB1fWySn1DUCSQ4r", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -608,20 +624,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDRQKuuB1fWySn01FSE5yV_secret_WEQfT3kIi9xm0Z61CLSOOkfnw", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989516, + "created": 1713393671, "currency": "aud", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDRQKuuB1fWySn0dPeuvdJ", + "latest_charge": "ch_3P6hABKuuB1fWySn1odNJCg9", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDRQKuuB1fWySn4AM42kc4", + "payment_method": "pm_1P6hABKuuB1fWySnAN7nHeKK", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -646,5 +662,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:18:40 GMT + recorded_at: Wed, 17 Apr 2024 22:41:15 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripePaymentStatus/_stripe_captured_/when_the_payment_is_not_a_Stripe_payment_or_does_not_have_a_payment_intent/returns_false.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripePaymentStatus/_stripe_captured_/when_the_payment_is_not_a_Stripe_payment_or_does_not_have_a_payment_intent/returns_false.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripePaymentStatus/_stripe_captured_/when_the_payment_is_not_a_Stripe_payment_or_does_not_have_a_payment_intent/returns_false.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripePaymentStatus/_stripe_captured_/when_the_payment_is_not_a_Stripe_payment_or_does_not_have_a_payment_intent/returns_false.yml index e20d0fc2cd..58cf51155c 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripePaymentStatus/_stripe_captured_/when_the_payment_is_not_a_Stripe_payment_or_does_not_have_a_payment_intent/returns_false.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripePaymentStatus/_stripe_captured_/when_the_payment_is_not_a_Stripe_payment_or_does_not_have_a_payment_intent/returns_false.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4242424242424242&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_3ENCAVgSNLEU8u","request_duration_ms":405}}' + - '{"last_request_metrics":{"request_id":"req_QvJSfTMIm7JeuJ","request_duration_ms":603}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:33 GMT + - Wed, 17 Apr 2024 22:41:08 GMT Content-Type: - application/json Content-Length: - - '960' + - '996' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 67e3bf04-e17c-4f31-bb33-78920895cf3a + - f57ce768-268b-4f0d-a6b1-eef93704de10 Original-Request: - - req_DaTatZTGGmYDLw + - req_DncMJMBbT2DNTW + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_DaTatZTGGmYDLw + - req_DncMJMBbT2DNTW Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDRMKuuB1fWySnPyCI08ej", + "id": "pm_1P6hA7KuuB1fWySnwaPwdSUt", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989513, + "created": 1713393667, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:18:33 GMT + recorded_at: Wed, 17 Apr 2024 22:41:08 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=aud&payment_method=pm_1OoDRMKuuB1fWySnPyCI08ej&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=aud&payment_method=pm_1P6hA7KuuB1fWySnwaPwdSUt&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_DaTatZTGGmYDLw","request_duration_ms":397}}' + - '{"last_request_metrics":{"request_id":"req_DncMJMBbT2DNTW","request_duration_ms":562}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:33 GMT + - Wed, 17 Apr 2024 22:41:08 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - f5a3a049-8ecb-49ba-877c-498da9a2d613 + - 786961a2-32d7-4970-89cc-ca91ccdb3b40 Original-Request: - - req_diqAsQaMOTGX7U + - req_HGftEu3PUpgLU3 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_diqAsQaMOTGX7U + - req_HGftEu3PUpgLU3 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDRNKuuB1fWySn2aHY3j3K", + "id": "pi_3P6hA8KuuB1fWySn2Q9nbu4a", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDRNKuuB1fWySn2aHY3j3K_secret_gPr7pHMirBoc1WyLD0ZbgyzDr", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989513, + "created": 1713393668, "currency": "aud", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDRMKuuB1fWySnPyCI08ej", + "payment_method": "pm_1P6hA7KuuB1fWySnwaPwdSUt", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:18:33 GMT + recorded_at: Wed, 17 Apr 2024 22:41:08 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDRNKuuB1fWySn2aHY3j3K/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6hA8KuuB1fWySn2Q9nbu4a/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_diqAsQaMOTGX7U","request_duration_ms":495}}' + - '{"last_request_metrics":{"request_id":"req_HGftEu3PUpgLU3","request_duration_ms":509}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:34 GMT + - Wed, 17 Apr 2024 22:41:09 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 51346a93-ee03-4317-96e4-aecf97c2c06a + - 80df136b-4d7e-4f83-9261-2d986c9a01a9 Original-Request: - - req_lyGde7ZHBIrjUM + - req_K5wxwLJ4VRCgKC + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_lyGde7ZHBIrjUM + - req_K5wxwLJ4VRCgKC Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDRNKuuB1fWySn2aHY3j3K", + "id": "pi_3P6hA8KuuB1fWySn2Q9nbu4a", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDRNKuuB1fWySn2aHY3j3K_secret_gPr7pHMirBoc1WyLD0ZbgyzDr", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989513, + "created": 1713393668, "currency": "aud", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDRNKuuB1fWySn2g3MZFSI", + "latest_charge": "ch_3P6hA8KuuB1fWySn2quGri3T", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDRMKuuB1fWySnPyCI08ej", + "payment_method": "pm_1P6hA7KuuB1fWySnwaPwdSUt", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,29 +398,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:18:34 GMT + recorded_at: Wed, 17 Apr 2024 22:41:09 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDRNKuuB1fWySn2aHY3j3K/capture + uri: https://api.stripe.com/v1/payment_intents/pi_3P6hA8KuuB1fWySn2Q9nbu4a/capture body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_lyGde7ZHBIrjUM","request_duration_ms":1021}}' + - '{"last_request_metrics":{"request_id":"req_K5wxwLJ4VRCgKC","request_duration_ms":950}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -423,7 +430,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:36 GMT + - Wed, 17 Apr 2024 22:41:10 GMT Content-Type: - application/json Content-Length: @@ -448,16 +455,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 35d0fb13-5a0b-4053-bbef-152d6f589a3d + - ed0243b4-4673-41dd-92a2-2444d6068a00 Original-Request: - - req_S5vWMffhsD2jZ1 + - req_N9r6YNyPTBTY9H + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_S5vWMffhsD2jZ1 + - req_N9r6YNyPTBTY9H Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -468,7 +481,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDRNKuuB1fWySn2aHY3j3K", + "id": "pi_3P6hA8KuuB1fWySn2Q9nbu4a", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -482,20 +495,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDRNKuuB1fWySn2aHY3j3K_secret_gPr7pHMirBoc1WyLD0ZbgyzDr", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989513, + "created": 1713393668, "currency": "aud", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDRNKuuB1fWySn2g3MZFSI", + "latest_charge": "ch_3P6hA8KuuB1fWySn2quGri3T", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDRMKuuB1fWySnPyCI08ej", + "payment_method": "pm_1P6hA7KuuB1fWySnwaPwdSUt", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -520,5 +533,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:18:36 GMT + recorded_at: Wed, 17 Apr 2024 22:41:10 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripePaymentStatus/_stripe_status/when_the_payment_has_a_payment_intent/and_the_last_action_on_the_Stripe_payment_failed/returns_failed_response.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripePaymentStatus/_stripe_status/when_the_payment_has_a_payment_intent/and_the_last_action_on_the_Stripe_payment_failed/returns_failed_response.yml similarity index 75% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripePaymentStatus/_stripe_status/when_the_payment_has_a_payment_intent/and_the_last_action_on_the_Stripe_payment_failed/returns_failed_response.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripePaymentStatus/_stripe_status/when_the_payment_has_a_payment_intent/and_the_last_action_on_the_Stripe_payment_failed/returns_failed_response.yml index 7242e998af..5c801a7783 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripePaymentStatus/_stripe_status/when_the_payment_has_a_payment_intent/and_the_last_action_on_the_Stripe_payment_failed/returns_failed_response.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripePaymentStatus/_stripe_status/when_the_payment_has_a_payment_intent/and_the_last_action_on_the_Stripe_payment_failed/returns_failed_response.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4242424242424242&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_l95jpFal7tpCXh","request_duration_ms":381}}' + - '{"last_request_metrics":{"request_id":"req_ps1V3QDUfb1bDT","request_duration_ms":337}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:32 GMT + - Wed, 17 Apr 2024 22:41:06 GMT Content-Type: - application/json Content-Length: - - '960' + - '996' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 6c29d490-1aa7-4645-9dc2-9b928e6a2d21 + - 065c9008-97c7-48eb-a878-586faa3481f1 Original-Request: - - req_A0YMPOSD3dL6Ol + - req_sAU94bsNaeDGEN + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_A0YMPOSD3dL6Ol + - req_sAU94bsNaeDGEN Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDRLKuuB1fWySnk7w5UxCE", + "id": "pm_1P6hA6KuuB1fWySny9DoLWz3", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989512, + "created": 1713393666, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:18:32 GMT + recorded_at: Wed, 17 Apr 2024 22:41:06 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=aud&payment_method=pm_1OoDRLKuuB1fWySnk7w5UxCE&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=aud&payment_method=pm_1P6hA6KuuB1fWySny9DoLWz3&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_A0YMPOSD3dL6Ol","request_duration_ms":521}}' + - '{"last_request_metrics":{"request_id":"req_sAU94bsNaeDGEN","request_duration_ms":442}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:32 GMT + - Wed, 17 Apr 2024 22:41:07 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 1eb5e180-a632-4537-b4d9-c3cf509862fd + - 2c1af106-1cef-4835-971a-420f6d300b4a Original-Request: - - req_3ENCAVgSNLEU8u + - req_QvJSfTMIm7JeuJ + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_3ENCAVgSNLEU8u + - req_QvJSfTMIm7JeuJ Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDRMKuuB1fWySn0Z7GBkCb", + "id": "pi_3P6hA7KuuB1fWySn2Oq11BYe", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDRMKuuB1fWySn0Z7GBkCb_secret_lqJvYKENvmNtKKzFbW5TCLr6C", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989512, + "created": 1713393667, "currency": "aud", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDRLKuuB1fWySnk7w5UxCE", + "payment_method": "pm_1P6hA6KuuB1fWySny9DoLWz3", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,5 +263,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:18:32 GMT + recorded_at: Wed, 17 Apr 2024 22:41:07 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripePaymentStatus/_stripe_status/when_the_payment_has_a_payment_intent/fetches_the_status_with_Stripe_PaymentIntentValidator.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripePaymentStatus/_stripe_status/when_the_payment_has_a_payment_intent/fetches_the_status_with_Stripe_PaymentIntentValidator.yml similarity index 75% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripePaymentStatus/_stripe_status/when_the_payment_has_a_payment_intent/fetches_the_status_with_Stripe_PaymentIntentValidator.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripePaymentStatus/_stripe_status/when_the_payment_has_a_payment_intent/fetches_the_status_with_Stripe_PaymentIntentValidator.yml index d6aed7a90c..6aa71bce08 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripePaymentStatus/_stripe_status/when_the_payment_has_a_payment_intent/fetches_the_status_with_Stripe_PaymentIntentValidator.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripePaymentStatus/_stripe_status/when_the_payment_has_a_payment_intent/fetches_the_status_with_Stripe_PaymentIntentValidator.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4242424242424242&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_Ud3GvkZwrHn7hr","request_duration_ms":407}}' + - '{"last_request_metrics":{"request_id":"req_02Nb5gHl50fjAA","request_duration_ms":415}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:30 GMT + - Wed, 17 Apr 2024 22:41:05 GMT Content-Type: - application/json Content-Length: - - '960' + - '996' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - df5ca5c9-dfbd-4662-b345-0117fb0c27e0 + - 007a2eb1-7b77-4657-8775-e3aba9bfdb53 Original-Request: - - req_HdBvPUyvjHC10F + - req_Y3gX21v7ld8VY4 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_HdBvPUyvjHC10F + - req_Y3gX21v7ld8VY4 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDRKKuuB1fWySnEh1IcuMp", + "id": "pm_1P6hA5KuuB1fWySnlRmVNC4N", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989510, + "created": 1713393665, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:18:30 GMT + recorded_at: Wed, 17 Apr 2024 22:41:05 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=aud&payment_method=pm_1OoDRKKuuB1fWySnEh1IcuMp&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=aud&payment_method=pm_1P6hA5KuuB1fWySnlRmVNC4N&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_HdBvPUyvjHC10F","request_duration_ms":441}}' + - '{"last_request_metrics":{"request_id":"req_Y3gX21v7ld8VY4","request_duration_ms":536}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:31 GMT + - Wed, 17 Apr 2024 22:41:05 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 6260a6d8-22ef-4108-8343-07cde35a054b + - 1dfb7bfe-8a45-428b-8ecc-2f55782ed3f7 Original-Request: - - req_sFwoqoFnMRcKoS + - req_CIV79hZFWbdloN + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_sFwoqoFnMRcKoS + - req_CIV79hZFWbdloN Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDRLKuuB1fWySn1hFcJ8w2", + "id": "pi_3P6hA5KuuB1fWySn1isKoCdb", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDRLKuuB1fWySn1hFcJ8w2_secret_q6RoUdzpod2WIcu28ehN1ZdlV", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989511, + "created": 1713393665, "currency": "aud", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDRKKuuB1fWySnEh1IcuMp", + "payment_method": "pm_1P6hA5KuuB1fWySnlRmVNC4N", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:18:31 GMT + recorded_at: Wed, 17 Apr 2024 22:41:05 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDRLKuuB1fWySn1hFcJ8w2 + uri: https://api.stripe.com/v1/payment_intents/pi_3P6hA5KuuB1fWySn1isKoCdb body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_sFwoqoFnMRcKoS","request_duration_ms":447}}' + - '{"last_request_metrics":{"request_id":"req_CIV79hZFWbdloN","request_duration_ms":400}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:31 GMT + - Wed, 17 Apr 2024 22:41:06 GMT Content-Type: - application/json Content-Length: @@ -316,10 +320,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_l95jpFal7tpCXh + - req_ps1V3QDUfb1bDT Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -330,7 +340,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDRLKuuB1fWySn1hFcJ8w2", + "id": "pi_3P6hA5KuuB1fWySn1isKoCdb", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -344,9 +354,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDRLKuuB1fWySn1hFcJ8w2_secret_q6RoUdzpod2WIcu28ehN1ZdlV", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989511, + "created": 1713393665, "currency": "aud", "customer": null, "description": null, @@ -357,7 +367,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDRKKuuB1fWySnEh1IcuMp", + "payment_method": "pm_1P6hA5KuuB1fWySnlRmVNC4N", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -382,5 +392,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:18:31 GMT + recorded_at: Wed, 17 Apr 2024 22:41:06 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripePaymentStatus/_stripe_status/when_the_payment_is_not_a_Stripe_payment_or_does_not_have_a_payment_intent/returns_nil.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripePaymentStatus/_stripe_status/when_the_payment_is_not_a_Stripe_payment_or_does_not_have_a_payment_intent/returns_nil.yml similarity index 75% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripePaymentStatus/_stripe_status/when_the_payment_is_not_a_Stripe_payment_or_does_not_have_a_payment_intent/returns_nil.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripePaymentStatus/_stripe_status/when_the_payment_is_not_a_Stripe_payment_or_does_not_have_a_payment_intent/returns_nil.yml index 495ec548f5..ced209fbf1 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/StripePaymentStatus/_stripe_status/when_the_payment_is_not_a_Stripe_payment_or_does_not_have_a_payment_intent/returns_nil.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/StripePaymentStatus/_stripe_status/when_the_payment_is_not_a_Stripe_payment_or_does_not_have_a_payment_intent/returns_nil.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4242424242424242&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_KzegHddQIdmvfb","request_duration_ms":606}}' + - '{"last_request_metrics":{"request_id":"req_tuOGRA5fMeWcGd","request_duration_ms":502}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:29 GMT + - Wed, 17 Apr 2024 22:41:04 GMT Content-Type: - application/json Content-Length: - - '960' + - '996' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 69031e0e-5fa5-4b61-b0f2-36c9eeb70cf8 + - 0e4003f5-cfa9-45c1-b28f-61db03179a1b Original-Request: - - req_1YFxL61FVM0ylG + - req_yaZAESQjszRb8P + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_1YFxL61FVM0ylG + - req_yaZAESQjszRb8P Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDRJKuuB1fWySn9WZqskdy", + "id": "pm_1P6hA4KuuB1fWySnLXFYlYnm", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989509, + "created": 1713393664, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:18:29 GMT + recorded_at: Wed, 17 Apr 2024 22:41:04 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=aud&payment_method=pm_1OoDRJKuuB1fWySn9WZqskdy&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=aud&payment_method=pm_1P6hA4KuuB1fWySnLXFYlYnm&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_1YFxL61FVM0ylG","request_duration_ms":433}}' + - '{"last_request_metrics":{"request_id":"req_yaZAESQjszRb8P","request_duration_ms":531}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:30 GMT + - Wed, 17 Apr 2024 22:41:04 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - a77ee7b9-5892-4322-b33c-6c934f72dfbd + - 92fb7cc0-f8c0-4014-868d-db8086c49695 Original-Request: - - req_Ud3GvkZwrHn7hr + - req_02Nb5gHl50fjAA + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_Ud3GvkZwrHn7hr + - req_02Nb5gHl50fjAA Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDRKKuuB1fWySn2rxLNNEZ", + "id": "pi_3P6hA4KuuB1fWySn1QPPDvHu", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDRKKuuB1fWySn2rxLNNEZ_secret_XU5hRrvBxgnexwsidz9uGQmZf", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989510, + "created": 1713393664, "currency": "aud", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDRJKuuB1fWySn9WZqskdy", + "payment_method": "pm_1P6hA4KuuB1fWySnLXFYlYnm", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,5 +263,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:18:30 GMT + recorded_at: Wed, 17 Apr 2024 22:41:04 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_CreditCardCloner/_find_or_clone/when_called_with_a_card_without_a_customer_one_time_usage_card_/clones_the_payment_method_only.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_CreditCardCloner/_find_or_clone/when_called_with_a_card_without_a_customer_one_time_usage_card_/clones_the_payment_method_only.yml similarity index 70% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_CreditCardCloner/_find_or_clone/when_called_with_a_card_without_a_customer_one_time_usage_card_/clones_the_payment_method_only.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_CreditCardCloner/_find_or_clone/when_called_with_a_card_without_a_customer_one_time_usage_card_/clones_the_payment_method_only.yml index 19cd539979..183ff13fc7 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_CreditCardCloner/_find_or_clone/when_called_with_a_card_without_a_customer_one_time_usage_card_/clones_the_payment_method_only.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_CreditCardCloner/_find_or_clone/when_called_with_a_card_without_a_customer_one_time_usage_card_/clones_the_payment_method_only.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_MZVWecwtG9mJav","request_duration_ms":385}}' + - '{"last_request_metrics":{"request_id":"req_BHrjo9C9dXpZ55","request_duration_ms":711}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:07 GMT + - Wed, 17 Apr 2024 22:37:50 GMT Content-Type: - application/json Content-Length: - - '959' + - '995' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - d42600f9-7142-4b5c-89a7-2bf77c0cdb91 + - a27ea2bc-5029-4881-ae9a-daef21c06ce6 Original-Request: - - req_yqckvbWzoXBGP5 + - req_hgMR8K0DpYEzxW + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_yqckvbWzoXBGP5 + - req_hgMR8K0DpYEzxW Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDP1KuuB1fWySn4TnExuUO", + "id": "pm_1P6h6wKuuB1fWySn88ABa5q1", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,13 +123,13 @@ http_interactions: }, "wallet": null }, - "created": 1708989367, + "created": 1713393470, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:07 GMT + recorded_at: Wed, 17 Apr 2024 22:37:50 GMT - request: method: post uri: https://api.stripe.com/v1/accounts @@ -134,20 +138,17 @@ http_interactions: string: type=standard&country=AU&email=apple.producer%40example.com headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_yqckvbWzoXBGP5","request_duration_ms":407}}' + - '{"last_request_metrics":{"request_id":"req_hgMR8K0DpYEzxW","request_duration_ms":550}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:09 GMT + - Wed, 17 Apr 2024 22:37:52 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - df9b90f9-3ce2-4546-b340-8c8ce5509db7 + - 1c46df6a-d266-4fda-8a44-95d275eb2b88 Original-Request: - - req_ByJHh6CkWvjRnF + - req_mfzCZD5X8Ot9MF + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_ByJHh6CkWvjRnF + - req_mfzCZD5X8Ot9MF Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "acct_1OoDP1QRmd4V01E9", + "id": "acct_1P6h6xQPNAORwPNv", "object": "account", "business_profile": { "annual_revenue": null, @@ -226,7 +233,7 @@ http_interactions: "type": "application" }, "country": "AU", - "created": 1708989368, + "created": 1713393471, "default_currency": "aud", "details_submitted": false, "email": "apple.producer@example.com", @@ -235,7 +242,7 @@ http_interactions: "data": [], "has_more": false, "total_count": 0, - "url": "/v1/accounts/acct_1OoDP1QRmd4V01E9/external_accounts" + "url": "/v1/accounts/acct_1P6h6xQPNAORwPNv/external_accounts" }, "future_requirements": { "alternatives": [], @@ -332,29 +339,26 @@ http_interactions: }, "type": "standard" } - recorded_at: Mon, 26 Feb 2024 23:16:09 GMT + recorded_at: Wed, 17 Apr 2024 22:37:52 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_methods/pm_1OoDP1KuuB1fWySn4TnExuUO + uri: https://api.stripe.com/v1/payment_methods/pm_1P6h6wKuuB1fWySn88ABa5q1 body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_ByJHh6CkWvjRnF","request_duration_ms":1728}}' + - '{"last_request_metrics":{"request_id":"req_mfzCZD5X8Ot9MF","request_duration_ms":1714}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -367,11 +371,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:09 GMT + - Wed, 17 Apr 2024 22:37:52 GMT Content-Type: - application/json Content-Length: - - '959' + - '995' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -392,10 +396,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_DonQPjc5BjRzmG + - req_unSlSEY8qgECJb Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -406,8 +416,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDP1KuuB1fWySn4TnExuUO", + "id": "pm_1P6h6wKuuB1fWySn88ABa5q1", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -447,13 +458,13 @@ http_interactions: }, "wallet": null }, - "created": 1708989367, + "created": 1713393470, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:09 GMT + recorded_at: Wed, 17 Apr 2024 22:37:53 GMT - request: method: get uri: https://api.stripe.com/v1/customers?email=apple.customer@example.com&limit=100 @@ -462,22 +473,19 @@ http_interactions: string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_DonQPjc5BjRzmG","request_duration_ms":304}}' + - '{"last_request_metrics":{"request_id":"req_unSlSEY8qgECJb","request_duration_ms":402}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Stripe-Account: - - acct_1OoDP1QRmd4V01E9 + - acct_1P6h6xQPNAORwPNv Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -490,7 +498,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:10 GMT + - Wed, 17 Apr 2024 22:37:53 GMT Content-Type: - application/json Content-Length: @@ -514,12 +522,18 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fcustomers; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_qo4s5qhtNpP4BE + - req_1DxTRdjbmg7rwk Stripe-Account: - - acct_1OoDP1QRmd4V01E9 + - acct_1P6h6xQPNAORwPNv Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -535,31 +549,28 @@ http_interactions: "has_more": false, "url": "/v1/customers" } - recorded_at: Mon, 26 Feb 2024 23:16:10 GMT + recorded_at: Wed, 17 Apr 2024 22:37:53 GMT - request: method: post uri: https://api.stripe.com/v1/payment_methods body: encoding: UTF-8 - string: payment_method=pm_1OoDP1KuuB1fWySn4TnExuUO + string: payment_method=pm_1P6h6wKuuB1fWySn88ABa5q1 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_qo4s5qhtNpP4BE","request_duration_ms":306}}' + - '{"last_request_metrics":{"request_id":"req_1DxTRdjbmg7rwk","request_duration_ms":407}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Stripe-Account: - - acct_1OoDP1QRmd4V01E9 + - acct_1P6h6xQPNAORwPNv Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -572,11 +583,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:10 GMT + - Wed, 17 Apr 2024 22:37:53 GMT Content-Type: - application/json Content-Length: - - '959' + - '995' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -596,18 +607,24 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - fbc9ce5c-f5dd-4008-a521-d3a86a0e5ba7 + - 2eadc7da-9341-464f-92c9-dbb7ce6d58d9 Original-Request: - - req_kn6uYApFH1OQg3 + - req_Cdg2FoG9HNnA2p + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_kn6uYApFH1OQg3 + - req_Cdg2FoG9HNnA2p Stripe-Account: - - acct_1OoDP1QRmd4V01E9 + - acct_1P6h6xQPNAORwPNv Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -618,8 +635,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDP4QRmd4V01E9B2qRFYKx", + "id": "pm_1P6h6zQPNAORwPNva14N63Oi", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -659,11 +677,93 @@ http_interactions: }, "wallet": null }, - "created": 1708989370, + "created": 1713393473, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:10 GMT + recorded_at: Wed, 17 Apr 2024 22:37:53 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/accounts/acct_1P6h6xQPNAORwPNv + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_Cdg2FoG9HNnA2p","request_duration_ms":410}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:37:54 GMT + Content-Type: + - application/json + Content-Length: + - '77' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts%2F%3Aaccount; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_rNzhu1sbYbbr6t + Stripe-Account: + - acct_1P6h6xQPNAORwPNv + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h6xQPNAORwPNv", + "object": "account", + "deleted": true + } + recorded_at: Wed, 17 Apr 2024 22:37:55 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_CreditCardCloner/_find_or_clone/when_called_with_a_valid_customer_and_payment_method/clones_both_the_payment_method_and_the_customer.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_CreditCardCloner/_find_or_clone/when_called_with_a_valid_customer_and_payment_method/clones_both_the_payment_method_and_the_customer.yml similarity index 72% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_CreditCardCloner/_find_or_clone/when_called_with_a_valid_customer_and_payment_method/clones_both_the_payment_method_and_the_customer.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_CreditCardCloner/_find_or_clone/when_called_with_a_valid_customer_and_payment_method/clones_both_the_payment_method_and_the_customer.yml index 1c90962380..ad7bcc0c85 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_CreditCardCloner/_find_or_clone/when_called_with_a_valid_customer_and_payment_method/clones_both_the_payment_method_and_the_customer.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_CreditCardCloner/_find_or_clone/when_called_with_a_valid_customer_and_payment_method/clones_both_the_payment_method_and_the_customer.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_kn6uYApFH1OQg3","request_duration_ms":404}}' + - '{"last_request_metrics":{"request_id":"req_rNzhu1sbYbbr6t","request_duration_ms":1113}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:11 GMT + - Wed, 17 Apr 2024 22:37:55 GMT Content-Type: - application/json Content-Length: - - '959' + - '995' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 15bf1865-ece2-47ce-ae42-92f3949d070b + - de4587ad-fb95-4b60-b583-3ad671a47023 Original-Request: - - req_AYTuBbb8BtPB1C + - req_sEl1WCoGkCpPJV + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_AYTuBbb8BtPB1C + - req_sEl1WCoGkCpPJV Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDP4KuuB1fWySnRSuHiW2X", + "id": "pm_1P6h71KuuB1fWySnfweYNVxV", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,13 +123,13 @@ http_interactions: }, "wallet": null }, - "created": 1708989370, + "created": 1713393475, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:11 GMT + recorded_at: Wed, 17 Apr 2024 22:37:55 GMT - request: method: post uri: https://api.stripe.com/v1/customers @@ -134,20 +138,17 @@ http_interactions: string: name=Apple+Customer&email=apple.customer%40example.com headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_AYTuBbb8BtPB1C","request_duration_ms":565}}' + - '{"last_request_metrics":{"request_id":"req_sEl1WCoGkCpPJV","request_duration_ms":513}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:11 GMT + - Wed, 17 Apr 2024 22:37:56 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fcustomers; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 96cc5473-b89c-46f5-87a4-1f6e45c0fa8f + - 6b0499f0-f28b-4463-8b80-21506b13c2d6 Original-Request: - - req_O6yHKzQr514fRg + - req_2XoLNlMGODJlRA + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_O6yHKzQr514fRg + - req_2XoLNlMGODJlRA Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,18 +211,18 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "cus_PdUNsw15MhudtN", + "id": "cus_PwaHzpMjdK6VfR", "object": "customer", "address": null, "balance": 0, - "created": 1708989371, + "created": 1713393475, "currency": null, "default_source": null, "delinquent": false, "description": null, "discount": null, "email": "apple.customer@example.com", - "invoice_prefix": "50F6A45B", + "invoice_prefix": "71CBC2AB", "invoice_settings": { "custom_fields": null, "default_payment_method": null, @@ -232,29 +239,26 @@ http_interactions: "tax_exempt": "none", "test_clock": null } - recorded_at: Mon, 26 Feb 2024 23:16:11 GMT + recorded_at: Wed, 17 Apr 2024 22:37:56 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_methods/pm_1OoDP4KuuB1fWySnRSuHiW2X/attach + uri: https://api.stripe.com/v1/payment_methods/pm_1P6h71KuuB1fWySnfweYNVxV/attach body: encoding: UTF-8 - string: customer=cus_PdUNsw15MhudtN + string: customer=cus_PwaHzpMjdK6VfR headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_O6yHKzQr514fRg","request_duration_ms":511}}' + - '{"last_request_metrics":{"request_id":"req_2XoLNlMGODJlRA","request_duration_ms":509}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -267,11 +271,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:12 GMT + - Wed, 17 Apr 2024 22:37:56 GMT Content-Type: - application/json Content-Length: - - '970' + - '1006' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -292,16 +296,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 251f94d1-1e01-4140-858f-622c61c48788 + - 0023b4dc-6ef0-4205-960a-8ee6ba127d4d Original-Request: - - req_KLfAYfeJx2QNQZ + - req_IxsD8jT35QAMkS + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_KLfAYfeJx2QNQZ + - req_IxsD8jT35QAMkS Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -312,8 +322,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDP4KuuB1fWySnRSuHiW2X", + "id": "pm_1P6h71KuuB1fWySnfweYNVxV", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -353,13 +364,13 @@ http_interactions: }, "wallet": null }, - "created": 1708989370, - "customer": "cus_PdUNsw15MhudtN", + "created": 1713393475, + "customer": "cus_PwaHzpMjdK6VfR", "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:12 GMT + recorded_at: Wed, 17 Apr 2024 22:37:56 GMT - request: method: post uri: https://api.stripe.com/v1/accounts @@ -368,20 +379,17 @@ http_interactions: string: type=standard&country=AU&email=apple.producer%40example.com headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_KLfAYfeJx2QNQZ","request_duration_ms":633}}' + - '{"last_request_metrics":{"request_id":"req_IxsD8jT35QAMkS","request_duration_ms":818}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -394,7 +402,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:13 GMT + - Wed, 17 Apr 2024 22:37:58 GMT Content-Type: - application/json Content-Length: @@ -418,16 +426,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 731c8244-9ee2-413a-adeb-cfe791e108ad + - 17d828a1-a874-4b99-a4cb-b76046c26a9f Original-Request: - - req_WSjNv6uVHshYTe + - req_SqKaW98rp2HKkW + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_WSjNv6uVHshYTe + - req_SqKaW98rp2HKkW Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -438,7 +452,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "acct_1OoDP64GcAVqSETF", + "id": "acct_1P6h73QQ40FmawRZ", "object": "account", "business_profile": { "annual_revenue": null, @@ -460,7 +474,7 @@ http_interactions: "type": "application" }, "country": "AU", - "created": 1708989373, + "created": 1713393477, "default_currency": "aud", "details_submitted": false, "email": "apple.producer@example.com", @@ -469,7 +483,7 @@ http_interactions: "data": [], "has_more": false, "total_count": 0, - "url": "/v1/accounts/acct_1OoDP64GcAVqSETF/external_accounts" + "url": "/v1/accounts/acct_1P6h73QQ40FmawRZ/external_accounts" }, "future_requirements": { "alternatives": [], @@ -566,29 +580,26 @@ http_interactions: }, "type": "standard" } - recorded_at: Mon, 26 Feb 2024 23:16:14 GMT + recorded_at: Wed, 17 Apr 2024 22:37:58 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_methods/pm_1OoDP4KuuB1fWySnRSuHiW2X + uri: https://api.stripe.com/v1/payment_methods/pm_1P6h71KuuB1fWySnfweYNVxV body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_WSjNv6uVHshYTe","request_duration_ms":1713}}' + - '{"last_request_metrics":{"request_id":"req_SqKaW98rp2HKkW","request_duration_ms":1618}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -601,11 +612,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:14 GMT + - Wed, 17 Apr 2024 22:37:58 GMT Content-Type: - application/json Content-Length: - - '970' + - '1006' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -626,10 +637,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_xu9F71ozltowtt + - req_Pz35fqKr7kw1tG Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -640,8 +657,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDP4KuuB1fWySnRSuHiW2X", + "id": "pm_1P6h71KuuB1fWySnfweYNVxV", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -681,13 +699,13 @@ http_interactions: }, "wallet": null }, - "created": 1708989370, - "customer": "cus_PdUNsw15MhudtN", + "created": 1713393475, + "customer": "cus_PwaHzpMjdK6VfR", "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:14 GMT + recorded_at: Wed, 17 Apr 2024 22:37:59 GMT - request: method: get uri: https://api.stripe.com/v1/customers?email=apple.customer@example.com&limit=100 @@ -696,22 +714,19 @@ http_interactions: string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_xu9F71ozltowtt","request_duration_ms":305}}' + - '{"last_request_metrics":{"request_id":"req_Pz35fqKr7kw1tG","request_duration_ms":403}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Stripe-Account: - - acct_1OoDP64GcAVqSETF + - acct_1P6h73QQ40FmawRZ Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -724,7 +739,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:14 GMT + - Wed, 17 Apr 2024 22:37:59 GMT Content-Type: - application/json Content-Length: @@ -748,12 +763,18 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fcustomers; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_NjmKwbLvNF2PMs + - req_RWZdYTAKZQdoWn Stripe-Account: - - acct_1OoDP64GcAVqSETF + - acct_1P6h73QQ40FmawRZ Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -769,31 +790,28 @@ http_interactions: "has_more": false, "url": "/v1/customers" } - recorded_at: Mon, 26 Feb 2024 23:16:14 GMT + recorded_at: Wed, 17 Apr 2024 22:37:59 GMT - request: method: post uri: https://api.stripe.com/v1/payment_methods body: encoding: UTF-8 - string: customer=cus_PdUNsw15MhudtN&payment_method=pm_1OoDP4KuuB1fWySnRSuHiW2X + string: customer=cus_PwaHzpMjdK6VfR&payment_method=pm_1P6h71KuuB1fWySnfweYNVxV headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_NjmKwbLvNF2PMs","request_duration_ms":306}}' + - '{"last_request_metrics":{"request_id":"req_RWZdYTAKZQdoWn","request_duration_ms":407}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Stripe-Account: - - acct_1OoDP64GcAVqSETF + - acct_1P6h73QQ40FmawRZ Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -806,11 +824,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:14 GMT + - Wed, 17 Apr 2024 22:37:59 GMT Content-Type: - application/json Content-Length: - - '954' + - '990' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -830,18 +848,24 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 86649db3-183b-4ec6-9ec0-d569d6e45b4d + - a2187df8-c274-49bc-9f65-693fac9de453 Original-Request: - - req_KEvL9iGODGScws + - req_IsDKt1nOL7a9fZ + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_KEvL9iGODGScws + - req_IsDKt1nOL7a9fZ Stripe-Account: - - acct_1OoDP64GcAVqSETF + - acct_1P6h73QQ40FmawRZ Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -852,8 +876,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDP84GcAVqSETF2bhHnfxp", + "id": "pm_1P6h75QQ40FmawRZTNhCPYJg", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -893,13 +918,13 @@ http_interactions: }, "wallet": null }, - "created": 1708989374, + "created": 1713393479, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:14 GMT + recorded_at: Wed, 17 Apr 2024 22:37:59 GMT - request: method: post uri: https://api.stripe.com/v1/customers @@ -908,22 +933,19 @@ http_interactions: string: email=apple.customer%40example.com headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_KEvL9iGODGScws","request_duration_ms":322}}' + - '{"last_request_metrics":{"request_id":"req_IsDKt1nOL7a9fZ","request_duration_ms":511}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Stripe-Account: - - acct_1OoDP64GcAVqSETF + - acct_1P6h73QQ40FmawRZ Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -936,7 +958,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:15 GMT + - Wed, 17 Apr 2024 22:38:00 GMT Content-Type: - application/json Content-Length: @@ -960,18 +982,24 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fcustomers; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 4fef06e9-8ab6-4350-b6f2-c18195b81fe0 + - dd0eee51-1d29-418f-a2aa-769b22299d86 Original-Request: - - req_sPHgP52CMFhkwe + - req_zlySuQqkr9lBvl + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_sPHgP52CMFhkwe + - req_zlySuQqkr9lBvl Stripe-Account: - - acct_1OoDP64GcAVqSETF + - acct_1P6h73QQ40FmawRZ Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -982,18 +1010,18 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "cus_PdUN2nwDg4RLMC", + "id": "cus_PwaHCh7jj6scbH", "object": "customer", "address": null, "balance": 0, - "created": 1708989375, + "created": 1713393480, "currency": null, "default_source": null, "delinquent": false, "description": null, "discount": null, "email": "apple.customer@example.com", - "invoice_prefix": "9347D35E", + "invoice_prefix": "27EF2351", "invoice_settings": { "custom_fields": null, "default_payment_method": null, @@ -1010,31 +1038,28 @@ http_interactions: "tax_exempt": "none", "test_clock": null } - recorded_at: Mon, 26 Feb 2024 23:16:15 GMT + recorded_at: Wed, 17 Apr 2024 22:38:00 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_methods/pm_1OoDP84GcAVqSETF2bhHnfxp/attach + uri: https://api.stripe.com/v1/payment_methods/pm_1P6h75QQ40FmawRZTNhCPYJg/attach body: encoding: UTF-8 - string: customer=cus_PdUN2nwDg4RLMC + string: customer=cus_PwaHCh7jj6scbH headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_sPHgP52CMFhkwe","request_duration_ms":394}}' + - '{"last_request_metrics":{"request_id":"req_zlySuQqkr9lBvl","request_duration_ms":407}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Stripe-Account: - - acct_1OoDP64GcAVqSETF + - acct_1P6h73QQ40FmawRZ Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -1047,11 +1072,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:15 GMT + - Wed, 17 Apr 2024 22:38:00 GMT Content-Type: - application/json Content-Length: - - '970' + - '1006' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -1072,18 +1097,24 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - a188b723-97b3-4006-97e4-5831daaeb273 + - 2f7d4e50-acd5-4757-9bc0-ac5227c1ac9f Original-Request: - - req_uiAClbGo4GktMK + - req_liovngFFihrPwi + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_uiAClbGo4GktMK + - req_liovngFFihrPwi Stripe-Account: - - acct_1OoDP64GcAVqSETF + - acct_1P6h73QQ40FmawRZ Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -1094,8 +1125,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDP84GcAVqSETF2bhHnfxp", + "id": "pm_1P6h75QQ40FmawRZTNhCPYJg", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -1135,37 +1167,34 @@ http_interactions: }, "wallet": null }, - "created": 1708989374, - "customer": "cus_PdUN2nwDg4RLMC", + "created": 1713393479, + "customer": "cus_PwaHCh7jj6scbH", "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:15 GMT + recorded_at: Wed, 17 Apr 2024 22:38:00 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_methods/pm_1OoDP84GcAVqSETF2bhHnfxp + uri: https://api.stripe.com/v1/payment_methods/pm_1P6h75QQ40FmawRZTNhCPYJg body: encoding: UTF-8 string: metadata[ofn-clone]=true headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_uiAClbGo4GktMK","request_duration_ms":373}}' + - '{"last_request_metrics":{"request_id":"req_liovngFFihrPwi","request_duration_ms":509}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Stripe-Account: - - acct_1OoDP64GcAVqSETF + - acct_1P6h73QQ40FmawRZ Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -1178,11 +1207,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:16 GMT + - Wed, 17 Apr 2024 22:38:01 GMT Content-Type: - application/json Content-Length: - - '997' + - '1033' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -1203,18 +1232,24 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 3cabaca5-7ff3-4c0e-83d2-9129acc5e789 + - ce0cb2e2-2792-4dd2-9ef0-1047e8eafd65 Original-Request: - - req_3vLQhj4nsp5zf1 + - req_dKTf1EYVfNjB01 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_3vLQhj4nsp5zf1 + - req_dKTf1EYVfNjB01 Stripe-Account: - - acct_1OoDP64GcAVqSETF + - acct_1P6h73QQ40FmawRZ Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -1225,8 +1260,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDP84GcAVqSETF2bhHnfxp", + "id": "pm_1P6h75QQ40FmawRZTNhCPYJg", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -1266,13 +1302,95 @@ http_interactions: }, "wallet": null }, - "created": 1708989374, - "customer": "cus_PdUN2nwDg4RLMC", + "created": 1713393479, + "customer": "cus_PwaHCh7jj6scbH", "livemode": false, "metadata": { "ofn-clone": "true" }, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:16 GMT + recorded_at: Wed, 17 Apr 2024 22:38:01 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/accounts/acct_1P6h73QQ40FmawRZ + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_dKTf1EYVfNjB01","request_duration_ms":509}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:38:02 GMT + Content-Type: + - application/json + Content-Length: + - '77' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts%2F%3Aaccount; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_Fy0JTu17KQh7sg + Stripe-Account: + - acct_1P6h73QQ40FmawRZ + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h73QQ40FmawRZ", + "object": "account", + "deleted": true + } + recorded_at: Wed, 17 Apr 2024 22:38:02 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_CreditCardRemover/_remove/Stripe_customer_does_not_exist/raises_an_error.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_CreditCardRemover/_remove/Stripe_customer_does_not_exist/raises_an_error.yml new file mode 100644 index 0000000000..797c2ee1cd --- /dev/null +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_CreditCardRemover/_remove/Stripe_customer_does_not_exist/raises_an_error.yml @@ -0,0 +1,511 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.stripe.com/v1/payment_methods + body: + encoding: UTF-8 + string: type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2025&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_iTb9sKFigz7sHq","request_duration_ms":1018}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:38:13 GMT + Content-Type: + - application/json + Content-Length: + - '995' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Idempotency-Key: + - 99f1d6e2-378f-40b9-9d20-2fb43881fd9f + Original-Request: + - req_vfZ5VjBdyMDgFj + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_vfZ5VjBdyMDgFj + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pm_1P6h7JKuuB1fWySneht2cVGh", + "object": "payment_method", + "allow_redisplay": "unspecified", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "unchecked" + }, + "country": "US", + "display_brand": "visa", + "exp_month": 8, + "exp_year": 2025, + "fingerprint": "6E6tgVjx6U65iHFV", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1713393493, + "customer": null, + "livemode": false, + "metadata": {}, + "type": "card" + } + recorded_at: Wed, 17 Apr 2024 22:38:13 GMT +- request: + method: get + uri: https://api.stripe.com/v1/customers/non_existing_customer_id + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_vfZ5VjBdyMDgFj","request_duration_ms":444}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 404 + message: Not Found + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:38:13 GMT + Content-Type: + - application/json + Content-Length: + - '339' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fcustomers%2F%3Acustomer; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_AAG94JYQ2aQnuO + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "error": { + "code": "resource_missing", + "doc_url": "https://stripe.com/docs/error-codes/resource-missing", + "message": "No such customer: 'non_existing_customer_id'", + "param": "id", + "request_log_url": "https://dashboard.stripe.com/test/logs/req_AAG94JYQ2aQnuO?t=1713393493", + "type": "invalid_request_error" + } + } + recorded_at: Wed, 17 Apr 2024 22:38:13 GMT +- request: + method: post + uri: https://api.stripe.com/v1/accounts + body: + encoding: UTF-8 + string: type=standard&country=AU&email=apple.producer%40example.com + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_vfZ5VjBdyMDgFj","request_duration_ms":444}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:38:15 GMT + Content-Type: + - application/json + Content-Length: + - '3045' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Idempotency-Key: + - c2fb3984-a965-4f0d-a533-6112e4f253e1 + Original-Request: + - req_D5UhU7Scg3L2gq + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_D5UhU7Scg3L2gq + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h7KQR64sIdptS", + "object": "account", + "business_profile": { + "annual_revenue": null, + "estimated_worker_count": null, + "mcc": null, + "name": null, + "product_description": null, + "support_address": null, + "support_email": null, + "support_phone": null, + "support_url": null, + "url": null + }, + "business_type": null, + "capabilities": {}, + "charges_enabled": false, + "controller": { + "is_controller": true, + "type": "application" + }, + "country": "AU", + "created": 1713393494, + "default_currency": "aud", + "details_submitted": false, + "email": "apple.producer@example.com", + "external_accounts": { + "object": "list", + "data": [], + "has_more": false, + "total_count": 0, + "url": "/v1/accounts/acct_1P6h7KQR64sIdptS/external_accounts" + }, + "future_requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [], + "disabled_reason": null, + "errors": [], + "eventually_due": [], + "past_due": [], + "pending_verification": [] + }, + "metadata": {}, + "payouts_enabled": false, + "requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "disabled_reason": "requirements.past_due", + "errors": [], + "eventually_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "past_due": [ + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "pending_verification": [] + }, + "settings": { + "bacs_debit_payments": { + "display_name": null, + "service_user_number": null + }, + "branding": { + "icon": null, + "logo": null, + "primary_color": null, + "secondary_color": null + }, + "card_issuing": { + "tos_acceptance": { + "date": null, + "ip": null + } + }, + "card_payments": { + "decline_on": { + "avs_failure": false, + "cvc_failure": false + }, + "statement_descriptor_prefix": null, + "statement_descriptor_prefix_kana": null, + "statement_descriptor_prefix_kanji": null + }, + "dashboard": { + "display_name": null, + "timezone": "Etc/UTC" + }, + "invoices": { + "default_account_tax_ids": null + }, + "payments": { + "statement_descriptor": null, + "statement_descriptor_kana": null, + "statement_descriptor_kanji": null + }, + "payouts": { + "debit_negative_balances": true, + "schedule": { + "delay_days": 2, + "interval": "daily" + }, + "statement_descriptor": null + }, + "sepa_debit_payments": {} + }, + "tos_acceptance": { + "date": null, + "ip": null, + "user_agent": null + }, + "type": "standard" + } + recorded_at: Wed, 17 Apr 2024 22:38:15 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/accounts/acct_1P6h7KQR64sIdptS + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_D5UhU7Scg3L2gq","request_duration_ms":1677}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:38:16 GMT + Content-Type: + - application/json + Content-Length: + - '77' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts%2F%3Aaccount; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_6erFBt8I8770U0 + Stripe-Account: + - acct_1P6h7KQR64sIdptS + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h7KQR64sIdptS", + "object": "account", + "deleted": true + } + recorded_at: Wed, 17 Apr 2024 22:38:16 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_CreditCardRemover/_remove/Stripe_customer_exists/and_is_not_deleted/deletes_the_credit_card_clone_and_the_customer.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_CreditCardRemover/_remove/Stripe_customer_exists/and_is_deleted/deletes_the_credit_card_clone.yml similarity index 55% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_CreditCardRemover/_remove/Stripe_customer_exists/and_is_not_deleted/deletes_the_credit_card_clone_and_the_customer.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_CreditCardRemover/_remove/Stripe_customer_exists/and_is_deleted/deletes_the_credit_card_clone.yml index 1fba9186bf..2b3ac2617a 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_CreditCardRemover/_remove/Stripe_customer_exists/and_is_not_deleted/deletes_the_credit_card_clone_and_the_customer.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_CreditCardRemover/_remove/Stripe_customer_exists/and_is_deleted/deletes_the_credit_card_clone.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_3vLQhj4nsp5zf1","request_duration_ms":443}}' + - '{"last_request_metrics":{"request_id":"req_8dNi2QaYaG1AMO","request_duration_ms":991}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:16 GMT + - Wed, 17 Apr 2024 22:38:08 GMT Content-Type: - application/json Content-Length: - - '959' + - '995' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 877727d0-490b-4119-b299-21862609b98a + - 3136c020-eb68-49a2-8729-26a04ddc9809 Original-Request: - - req_qDda2CdD89FBg7 + - req_l5Ppcr2CrfjgfT + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_qDda2CdD89FBg7 + - req_l5Ppcr2CrfjgfT Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDPAKuuB1fWySnHB5k8Xdr", + "id": "pm_1P6h7EKuuB1fWySn0El7pnzD", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,13 +123,13 @@ http_interactions: }, "wallet": null }, - "created": 1708989376, + "created": 1713393488, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:16 GMT + recorded_at: Wed, 17 Apr 2024 22:38:08 GMT - request: method: post uri: https://api.stripe.com/v1/customers @@ -134,20 +138,17 @@ http_interactions: string: name=Apple+Customer&email=applecustomer%40example.com headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_qDda2CdD89FBg7","request_duration_ms":405}}' + - '{"last_request_metrics":{"request_id":"req_l5Ppcr2CrfjgfT","request_duration_ms":512}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:17 GMT + - Wed, 17 Apr 2024 22:38:08 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fcustomers; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - d99a3d4a-4cd2-41cf-afd3-1229add56295 + - 5844e356-9fc2-4e02-bf97-ccda2a0a3631 Original-Request: - - req_owkriGiaWPLaiF + - req_dWZffZ3uDufpk6 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_owkriGiaWPLaiF + - req_dWZffZ3uDufpk6 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,18 +211,18 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "cus_PdUNwYjpPCRZ2J", + "id": "cus_PwaHCzG0Sae8wW", "object": "customer", "address": null, "balance": 0, - "created": 1708989376, + "created": 1713393488, "currency": null, "default_source": null, "delinquent": false, "description": null, "discount": null, "email": "applecustomer@example.com", - "invoice_prefix": "A72EC627", + "invoice_prefix": "CB64C917", "invoice_settings": { "custom_fields": null, "default_payment_method": null, @@ -232,29 +239,26 @@ http_interactions: "tax_exempt": "none", "test_clock": null } - recorded_at: Mon, 26 Feb 2024 23:16:17 GMT + recorded_at: Wed, 17 Apr 2024 22:38:09 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_methods/pm_1OoDPAKuuB1fWySnHB5k8Xdr/attach + uri: https://api.stripe.com/v1/payment_methods/pm_1P6h7EKuuB1fWySn0El7pnzD/attach body: encoding: UTF-8 - string: customer=cus_PdUNwYjpPCRZ2J + string: customer=cus_PwaHCzG0Sae8wW headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_owkriGiaWPLaiF","request_duration_ms":392}}' + - '{"last_request_metrics":{"request_id":"req_dWZffZ3uDufpk6","request_duration_ms":622}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -267,11 +271,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:17 GMT + - Wed, 17 Apr 2024 22:38:09 GMT Content-Type: - application/json Content-Length: - - '970' + - '1006' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -292,16 +296,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - c1fa6c3a-3cf9-4801-9b8b-d40e2829e81d + - e3ff6833-f6b9-49a2-958d-5d5a2ba08230 Original-Request: - - req_u2Xr4QOWypHU8F + - req_PKnbarmnJ4yI12 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_u2Xr4QOWypHU8F + - req_PKnbarmnJ4yI12 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -312,8 +322,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDPAKuuB1fWySnHB5k8Xdr", + "id": "pm_1P6h7EKuuB1fWySn0El7pnzD", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -353,35 +364,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989376, - "customer": "cus_PdUNwYjpPCRZ2J", + "created": 1713393488, + "customer": "cus_PwaHCzG0Sae8wW", "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:17 GMT + recorded_at: Wed, 17 Apr 2024 22:38:09 GMT - request: - method: get - uri: https://api.stripe.com/v1/customers/cus_PdUNwYjpPCRZ2J + method: post + uri: https://api.stripe.com/v1/accounts body: - encoding: US-ASCII - string: '' + encoding: UTF-8 + string: type=standard&country=AU&email=apple.producer%40example.com headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_u2Xr4QOWypHU8F","request_duration_ms":685}}' + - '{"last_request_metrics":{"request_id":"req_PKnbarmnJ4yI12","request_duration_ms":750}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -394,11 +402,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:17 GMT + - Wed, 17 Apr 2024 22:38:11 GMT Content-Type: - application/json Content-Length: - - '649' + - '3045' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -415,14 +423,25 @@ http_interactions: Cache-Control: - no-cache, no-store Content-Security-Policy: - - report-uri https://q.stripe.com/csp-report?p=v1%2Fcustomers%2F%3Acustomer; - block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action - 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; - style-src 'self' + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Idempotency-Key: + - 751bd0a5-1578-4edb-b78b-6e4e1f7362cd + Original-Request: + - req_U0yy1ngokIQhOh + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_UhmT9op37JI9Qi + - req_U0yy1ngokIQhOh + Stripe-Should-Retry: + - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -433,57 +452,154 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "cus_PdUNwYjpPCRZ2J", - "object": "customer", - "address": null, - "balance": 0, - "created": 1708989376, - "currency": null, - "default_source": null, - "delinquent": false, - "description": null, - "discount": null, - "email": "applecustomer@example.com", - "invoice_prefix": "A72EC627", - "invoice_settings": { - "custom_fields": null, - "default_payment_method": null, - "footer": null, - "rendering_options": null + "id": "acct_1P6h7GQRuPXu1EC9", + "object": "account", + "business_profile": { + "annual_revenue": null, + "estimated_worker_count": null, + "mcc": null, + "name": null, + "product_description": null, + "support_address": null, + "support_email": null, + "support_phone": null, + "support_url": null, + "url": null + }, + "business_type": null, + "capabilities": {}, + "charges_enabled": false, + "controller": { + "is_controller": true, + "type": "application" + }, + "country": "AU", + "created": 1713393491, + "default_currency": "aud", + "details_submitted": false, + "email": "apple.producer@example.com", + "external_accounts": { + "object": "list", + "data": [], + "has_more": false, + "total_count": 0, + "url": "/v1/accounts/acct_1P6h7GQRuPXu1EC9/external_accounts" + }, + "future_requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [], + "disabled_reason": null, + "errors": [], + "eventually_due": [], + "past_due": [], + "pending_verification": [] }, - "livemode": false, "metadata": {}, - "name": "Apple Customer", - "next_invoice_sequence": 1, - "phone": null, - "preferred_locales": [], - "shipping": null, - "tax_exempt": "none", - "test_clock": null + "payouts_enabled": false, + "requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "disabled_reason": "requirements.past_due", + "errors": [], + "eventually_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "past_due": [ + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "pending_verification": [] + }, + "settings": { + "bacs_debit_payments": { + "display_name": null, + "service_user_number": null + }, + "branding": { + "icon": null, + "logo": null, + "primary_color": null, + "secondary_color": null + }, + "card_issuing": { + "tos_acceptance": { + "date": null, + "ip": null + } + }, + "card_payments": { + "decline_on": { + "avs_failure": false, + "cvc_failure": false + }, + "statement_descriptor_prefix": null, + "statement_descriptor_prefix_kana": null, + "statement_descriptor_prefix_kanji": null + }, + "dashboard": { + "display_name": null, + "timezone": "Etc/UTC" + }, + "invoices": { + "default_account_tax_ids": null + }, + "payments": { + "statement_descriptor": null, + "statement_descriptor_kana": null, + "statement_descriptor_kanji": null + }, + "payouts": { + "debit_negative_balances": true, + "schedule": { + "delay_days": 2, + "interval": "daily" + }, + "statement_descriptor": null + }, + "sepa_debit_payments": {} + }, + "tos_acceptance": { + "date": null, + "ip": null, + "user_agent": null + }, + "type": "standard" } - recorded_at: Mon, 26 Feb 2024 23:16:17 GMT + recorded_at: Wed, 17 Apr 2024 22:38:11 GMT - request: method: delete - uri: https://api.stripe.com/v1/customers/cus_PdUNwYjpPCRZ2J + uri: https://api.stripe.com/v1/accounts/acct_1P6h7GQRuPXu1EC9 body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_UhmT9op37JI9Qi","request_duration_ms":250}}' + - '{"last_request_metrics":{"request_id":"req_U0yy1ngokIQhOh","request_duration_ms":2089}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -496,11 +612,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:18 GMT + - Wed, 17 Apr 2024 22:38:12 GMT Content-Type: - application/json Content-Length: - - '75' + - '77' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -517,14 +633,21 @@ http_interactions: Cache-Control: - no-cache, no-store Content-Security-Policy: - - report-uri https://q.stripe.com/csp-report?p=v1%2Fcustomers%2F%3Acustomer; - block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action - 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; - style-src 'self' + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts%2F%3Aaccount; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_jagI9P8dKgmSWe + - req_iTb9sKFigz7sHq + Stripe-Account: + - acct_1P6h7GQRuPXu1EC9 Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -535,9 +658,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "cus_PdUNwYjpPCRZ2J", - "object": "customer", + "id": "acct_1P6h7GQRuPXu1EC9", + "object": "account", "deleted": true } - recorded_at: Mon, 26 Feb 2024 23:16:18 GMT + recorded_at: Wed, 17 Apr 2024 22:38:12 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_CreditCardRemover/_remove/Stripe_customer_exists/and_is_not_deleted/deletes_the_credit_card_clone_and_the_customer.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_CreditCardRemover/_remove/Stripe_customer_exists/and_is_not_deleted/deletes_the_credit_card_clone_and_the_customer.yml new file mode 100644 index 0000000000..6e01ee6b47 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_CreditCardRemover/_remove/Stripe_customer_exists/and_is_not_deleted/deletes_the_credit_card_clone_and_the_customer.yml @@ -0,0 +1,852 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.stripe.com/v1/payment_methods + body: + encoding: UTF-8 + string: type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2025&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_Fy0JTu17KQh7sg","request_duration_ms":1122}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:38:03 GMT + Content-Type: + - application/json + Content-Length: + - '995' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Idempotency-Key: + - 60f4303a-a8de-4b0d-b05d-63893c9c34e4 + Original-Request: + - req_N9tn5rXAaDskcR + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_N9tn5rXAaDskcR + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pm_1P6h78KuuB1fWySnaoZBwaA6", + "object": "payment_method", + "allow_redisplay": "unspecified", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "unchecked" + }, + "country": "US", + "display_brand": "visa", + "exp_month": 8, + "exp_year": 2025, + "fingerprint": "6E6tgVjx6U65iHFV", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1713393482, + "customer": null, + "livemode": false, + "metadata": {}, + "type": "card" + } + recorded_at: Wed, 17 Apr 2024 22:38:03 GMT +- request: + method: post + uri: https://api.stripe.com/v1/customers + body: + encoding: UTF-8 + string: name=Apple+Customer&email=applecustomer%40example.com + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_N9tn5rXAaDskcR","request_duration_ms":498}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:38:03 GMT + Content-Type: + - application/json + Content-Length: + - '649' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fcustomers; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Idempotency-Key: + - cd947f4b-584f-4de4-ab2d-3e14ff6f57d2 + Original-Request: + - req_Xn6OlThVxqX4YT + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_Xn6OlThVxqX4YT + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "cus_PwaHrAtJs0d8j4", + "object": "customer", + "address": null, + "balance": 0, + "created": 1713393483, + "currency": null, + "default_source": null, + "delinquent": false, + "description": null, + "discount": null, + "email": "applecustomer@example.com", + "invoice_prefix": "7DCAD279", + "invoice_settings": { + "custom_fields": null, + "default_payment_method": null, + "footer": null, + "rendering_options": null + }, + "livemode": false, + "metadata": {}, + "name": "Apple Customer", + "next_invoice_sequence": 1, + "phone": null, + "preferred_locales": [], + "shipping": null, + "tax_exempt": "none", + "test_clock": null + } + recorded_at: Wed, 17 Apr 2024 22:38:03 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_methods/pm_1P6h78KuuB1fWySnaoZBwaA6/attach + body: + encoding: UTF-8 + string: customer=cus_PwaHrAtJs0d8j4 + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_Xn6OlThVxqX4YT","request_duration_ms":524}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:38:04 GMT + Content-Type: + - application/json + Content-Length: + - '1006' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods%2F%3Apayment_method%2Fattach; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Idempotency-Key: + - db32d730-4f8b-4e64-8ab2-c9cf2c71c19a + Original-Request: + - req_jciiJEVy0NNzrX + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_jciiJEVy0NNzrX + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pm_1P6h78KuuB1fWySnaoZBwaA6", + "object": "payment_method", + "allow_redisplay": "unspecified", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "display_brand": "visa", + "exp_month": 8, + "exp_year": 2025, + "fingerprint": "6E6tgVjx6U65iHFV", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1713393482, + "customer": "cus_PwaHrAtJs0d8j4", + "livemode": false, + "metadata": {}, + "type": "card" + } + recorded_at: Wed, 17 Apr 2024 22:38:04 GMT +- request: + method: get + uri: https://api.stripe.com/v1/customers/cus_PwaHrAtJs0d8j4 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_jciiJEVy0NNzrX","request_duration_ms":714}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:38:04 GMT + Content-Type: + - application/json + Content-Length: + - '649' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fcustomers%2F%3Acustomer; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_BuypPaKbtBaK2j + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "cus_PwaHrAtJs0d8j4", + "object": "customer", + "address": null, + "balance": 0, + "created": 1713393483, + "currency": null, + "default_source": null, + "delinquent": false, + "description": null, + "discount": null, + "email": "applecustomer@example.com", + "invoice_prefix": "7DCAD279", + "invoice_settings": { + "custom_fields": null, + "default_payment_method": null, + "footer": null, + "rendering_options": null + }, + "livemode": false, + "metadata": {}, + "name": "Apple Customer", + "next_invoice_sequence": 1, + "phone": null, + "preferred_locales": [], + "shipping": null, + "tax_exempt": "none", + "test_clock": null + } + recorded_at: Wed, 17 Apr 2024 22:38:04 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/customers/cus_PwaHrAtJs0d8j4 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_BuypPaKbtBaK2j","request_duration_ms":390}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:38:05 GMT + Content-Type: + - application/json + Content-Length: + - '75' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fcustomers%2F%3Acustomer; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_z8q9WENhyIJzFP + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "cus_PwaHrAtJs0d8j4", + "object": "customer", + "deleted": true + } + recorded_at: Wed, 17 Apr 2024 22:38:05 GMT +- request: + method: post + uri: https://api.stripe.com/v1/accounts + body: + encoding: UTF-8 + string: type=standard&country=AU&email=apple.producer%40example.com + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_z8q9WENhyIJzFP","request_duration_ms":510}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:38:06 GMT + Content-Type: + - application/json + Content-Length: + - '3045' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Idempotency-Key: + - 07daa1bc-6c3a-474d-a5f1-d39cbd0d8df4 + Original-Request: + - req_BvCYA0IunDIZ2h + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_BvCYA0IunDIZ2h + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h7B38uxo8Qrfr", + "object": "account", + "business_profile": { + "annual_revenue": null, + "estimated_worker_count": null, + "mcc": null, + "name": null, + "product_description": null, + "support_address": null, + "support_email": null, + "support_phone": null, + "support_url": null, + "url": null + }, + "business_type": null, + "capabilities": {}, + "charges_enabled": false, + "controller": { + "is_controller": true, + "type": "application" + }, + "country": "AU", + "created": 1713393486, + "default_currency": "aud", + "details_submitted": false, + "email": "apple.producer@example.com", + "external_accounts": { + "object": "list", + "data": [], + "has_more": false, + "total_count": 0, + "url": "/v1/accounts/acct_1P6h7B38uxo8Qrfr/external_accounts" + }, + "future_requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [], + "disabled_reason": null, + "errors": [], + "eventually_due": [], + "past_due": [], + "pending_verification": [] + }, + "metadata": {}, + "payouts_enabled": false, + "requirements": { + "alternatives": [], + "current_deadline": null, + "currently_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "disabled_reason": "requirements.past_due", + "errors": [], + "eventually_due": [ + "business_profile.product_description", + "business_profile.support_phone", + "business_profile.url", + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "past_due": [ + "external_account", + "tos_acceptance.date", + "tos_acceptance.ip" + ], + "pending_verification": [] + }, + "settings": { + "bacs_debit_payments": { + "display_name": null, + "service_user_number": null + }, + "branding": { + "icon": null, + "logo": null, + "primary_color": null, + "secondary_color": null + }, + "card_issuing": { + "tos_acceptance": { + "date": null, + "ip": null + } + }, + "card_payments": { + "decline_on": { + "avs_failure": false, + "cvc_failure": false + }, + "statement_descriptor_prefix": null, + "statement_descriptor_prefix_kana": null, + "statement_descriptor_prefix_kanji": null + }, + "dashboard": { + "display_name": null, + "timezone": "Etc/UTC" + }, + "invoices": { + "default_account_tax_ids": null + }, + "payments": { + "statement_descriptor": null, + "statement_descriptor_kana": null, + "statement_descriptor_kanji": null + }, + "payouts": { + "debit_negative_balances": true, + "schedule": { + "delay_days": 2, + "interval": "daily" + }, + "statement_descriptor": null + }, + "sepa_debit_payments": {} + }, + "tos_acceptance": { + "date": null, + "ip": null, + "user_agent": null + }, + "type": "standard" + } + recorded_at: Wed, 17 Apr 2024 22:38:06 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/accounts/acct_1P6h7B38uxo8Qrfr + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_BvCYA0IunDIZ2h","request_duration_ms":1564}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:38:07 GMT + Content-Type: + - application/json + Content-Length: + - '77' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts%2F%3Aaccount; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_8dNi2QaYaG1AMO + Stripe-Account: + - acct_1P6h7B38uxo8Qrfr + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6h7B38uxo8Qrfr", + "object": "account", + "deleted": true + } + recorded_at: Wed, 17 Apr 2024 22:38:07 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Exceeding_velocity_limit_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Exceeding_velocity_limit_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml similarity index 79% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Exceeding_velocity_limit_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Exceeding_velocity_limit_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml index b201989650..44a82d621f 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Exceeding_velocity_limit_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Exceeding_velocity_limit_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4000000000006975&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_AyeNpHCuhODsbo","request_duration_ms":510}}' + - '{"last_request_metrics":{"request_id":"req_MTnLIBxp9QZPi2","request_duration_ms":529}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:57 GMT + - Wed, 17 Apr 2024 22:40:07 GMT Content-Type: - application/json Content-Length: - - '960' + - '996' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - fc8326cc-93c0-4440-aeda-5aa8f9ba07f1 + - '09b0f20d-fff3-4742-92c3-dd5365c9ad01' Original-Request: - - req_r01okPnDzeMISz + - req_1ebsHfB6iwjJOf + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_r01okPnDzeMISz + - req_1ebsHfB6iwjJOf Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQnKuuB1fWySnPCAaOv4x", + "id": "pm_1P6h98KuuB1fWySnPmskOrli", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989477, + "created": 1713393607, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:57 GMT + recorded_at: Wed, 17 Apr 2024 22:40:07 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDQnKuuB1fWySnPCAaOv4x&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h98KuuB1fWySnPmskOrli&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_r01okPnDzeMISz","request_duration_ms":421}}' + - '{"last_request_metrics":{"request_id":"req_1ebsHfB6iwjJOf","request_duration_ms":577}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:57 GMT + - Wed, 17 Apr 2024 22:40:07 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 4e8d394c-6efc-4f7c-a84d-ec03935a2d97 + - 8d303864-b4fd-48c3-812e-7fdd7d4651f6 Original-Request: - - req_LTPedcXLyXiFZW + - req_ClLaOaXNsGN8vL + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_LTPedcXLyXiFZW + - req_ClLaOaXNsGN8vL Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQnKuuB1fWySn0MC05wGZ", + "id": "pi_3P6h99KuuB1fWySn2OfdkSPl", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQnKuuB1fWySn0MC05wGZ_secret_VdPIGu9Egxe0MiTPQymTZ2eGg", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989477, + "created": 1713393607, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQnKuuB1fWySnPCAaOv4x", + "payment_method": "pm_1P6h98KuuB1fWySnPmskOrli", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:57 GMT + recorded_at: Wed, 17 Apr 2024 22:40:07 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQnKuuB1fWySn0MC05wGZ/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h99KuuB1fWySn2OfdkSPl/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_LTPedcXLyXiFZW","request_duration_ms":387}}' + - '{"last_request_metrics":{"request_id":"req_ClLaOaXNsGN8vL","request_duration_ms":510}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,11 +295,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:58 GMT + - Wed, 17 Apr 2024 22:40:08 GMT Content-Type: - application/json Content-Length: - - '4942' + - '5026' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 87b70386-5d72-4cf7-8b89-bfddd2e64d2f + - ea22918b-5183-4f44-ac27-63e7299546d3 Original-Request: - - req_xMAsv16AErIXOO + - req_HGck6NCIT0pJKh + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_xMAsv16AErIXOO + - req_HGck6NCIT0pJKh Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -337,13 +347,13 @@ http_interactions: string: | { "error": { - "charge": "ch_3OoDQnKuuB1fWySn0ndgG85Q", + "charge": "ch_3P6h99KuuB1fWySn2Sv33DqP", "code": "card_declined", "decline_code": "card_velocity_exceeded", "doc_url": "https://stripe.com/docs/error-codes/card-declined", "message": "Your card was declined for making repeated attempts too frequently or exceeding its amount limit.", "payment_intent": { - "id": "pi_3OoDQnKuuB1fWySn0MC05wGZ", + "id": "pi_3P6h99KuuB1fWySn2OfdkSPl", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -358,22 +368,23 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQnKuuB1fWySn0MC05wGZ_secret_VdPIGu9Egxe0MiTPQymTZ2eGg", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989477, + "created": 1713393607, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": { - "charge": "ch_3OoDQnKuuB1fWySn0ndgG85Q", + "charge": "ch_3P6h99KuuB1fWySn2Sv33DqP", "code": "card_declined", "decline_code": "card_velocity_exceeded", "doc_url": "https://stripe.com/docs/error-codes/card-declined", "message": "Your card was declined for making repeated attempts too frequently or exceeding its amount limit.", "payment_method": { - "id": "pm_1OoDQnKuuB1fWySnPCAaOv4x", + "id": "pm_1P6h98KuuB1fWySnPmskOrli", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -413,7 +424,7 @@ http_interactions: }, "wallet": null }, - "created": 1708989477, + "created": 1713393607, "customer": null, "livemode": false, "metadata": { @@ -422,7 +433,7 @@ http_interactions: }, "type": "card_error" }, - "latest_charge": "ch_3OoDQnKuuB1fWySn0ndgG85Q", + "latest_charge": "ch_3P6h99KuuB1fWySn2Sv33DqP", "livemode": false, "metadata": { }, @@ -454,8 +465,9 @@ http_interactions: "transfer_group": null }, "payment_method": { - "id": "pm_1OoDQnKuuB1fWySnPCAaOv4x", + "id": "pm_1P6h98KuuB1fWySnPmskOrli", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -495,16 +507,16 @@ http_interactions: }, "wallet": null }, - "created": 1708989477, + "created": 1713393607, "customer": null, "livemode": false, "metadata": { }, "type": "card" }, - "request_log_url": "https://dashboard.stripe.com/test/logs/req_xMAsv16AErIXOO?t=1708989477", + "request_log_url": "https://dashboard.stripe.com/test/logs/req_HGck6NCIT0pJKh?t=1713393607", "type": "card_error" } } - recorded_at: Mon, 26 Feb 2024 23:17:58 GMT + recorded_at: Wed, 17 Apr 2024 22:40:08 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Expired_card_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Expired_card_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml similarity index 79% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Expired_card_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Expired_card_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml index 794eb20c48..9c9221e541 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Expired_card_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Expired_card_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4000000000000069&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_it1mYKQGWiiXSo","request_duration_ms":513}}' + - '{"last_request_metrics":{"request_id":"req_91pHPi8RnhHsyR","request_duration_ms":1226}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:51 GMT + - Wed, 17 Apr 2024 22:40:00 GMT Content-Type: - application/json Content-Length: - - '960' + - '996' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 7e0697d6-538a-46f0-99c3-6e859bfff22c + - 95f41437-34b8-485a-8963-822e63ab7c47 Original-Request: - - req_dTTrWZI9tkUu6n + - req_vwfQav2GN0SQ4r + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_dTTrWZI9tkUu6n + - req_vwfQav2GN0SQ4r Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQhKuuB1fWySnEHtv7tdi", + "id": "pm_1P6h92KuuB1fWySn0HDWMel6", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989471, + "created": 1713393600, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:51 GMT + recorded_at: Wed, 17 Apr 2024 22:40:00 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDQhKuuB1fWySnEHtv7tdi&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h92KuuB1fWySn0HDWMel6&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_dTTrWZI9tkUu6n","request_duration_ms":500}}' + - '{"last_request_metrics":{"request_id":"req_vwfQav2GN0SQ4r","request_duration_ms":497}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:52 GMT + - Wed, 17 Apr 2024 22:40:00 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - ef65f1a9-2cf8-41f6-8299-0f1e09537578 + - 102af3c2-a4d1-4f44-ab50-2a4f827c0cf9 Original-Request: - - req_xfUXVWjlALxHQl + - req_AcKGwgfHNiqkQ2 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_xfUXVWjlALxHQl + - req_AcKGwgfHNiqkQ2 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQhKuuB1fWySn2GJxyGlI", + "id": "pi_3P6h92KuuB1fWySn10XVZK55", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQhKuuB1fWySn2GJxyGlI_secret_63O0gUCHKn59KAqTrhz8JulCR", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989471, + "created": 1713393600, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQhKuuB1fWySnEHtv7tdi", + "payment_method": "pm_1P6h92KuuB1fWySn0HDWMel6", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:52 GMT + recorded_at: Wed, 17 Apr 2024 22:40:00 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQhKuuB1fWySn2GJxyGlI/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h92KuuB1fWySn10XVZK55/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_xfUXVWjlALxHQl","request_duration_ms":409}}' + - '{"last_request_metrics":{"request_id":"req_AcKGwgfHNiqkQ2","request_duration_ms":510}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,11 +295,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:53 GMT + - Wed, 17 Apr 2024 22:40:02 GMT Content-Type: - application/json Content-Length: - - '4748' + - '4832' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 4c3c72ef-10d2-4773-b515-8520bf48ff33 + - 961364ed-f77a-46c9-8425-bff589bef4d6 Original-Request: - - req_qELxBmYqT3kUy2 + - req_obyVJ21H3H5mhN + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_qELxBmYqT3kUy2 + - req_obyVJ21H3H5mhN Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -337,13 +347,13 @@ http_interactions: string: | { "error": { - "charge": "ch_3OoDQhKuuB1fWySn2oLhUB42", + "charge": "ch_3P6h92KuuB1fWySn1vimbcUq", "code": "expired_card", "doc_url": "https://stripe.com/docs/error-codes/expired-card", "message": "Your card has expired.", "param": "exp_month", "payment_intent": { - "id": "pi_3OoDQhKuuB1fWySn2GJxyGlI", + "id": "pi_3P6h92KuuB1fWySn10XVZK55", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -358,22 +368,23 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQhKuuB1fWySn2GJxyGlI_secret_63O0gUCHKn59KAqTrhz8JulCR", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989471, + "created": 1713393600, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": { - "charge": "ch_3OoDQhKuuB1fWySn2oLhUB42", + "charge": "ch_3P6h92KuuB1fWySn1vimbcUq", "code": "expired_card", "doc_url": "https://stripe.com/docs/error-codes/expired-card", "message": "Your card has expired.", "param": "exp_month", "payment_method": { - "id": "pm_1OoDQhKuuB1fWySnEHtv7tdi", + "id": "pm_1P6h92KuuB1fWySn0HDWMel6", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -413,7 +424,7 @@ http_interactions: }, "wallet": null }, - "created": 1708989471, + "created": 1713393600, "customer": null, "livemode": false, "metadata": { @@ -422,7 +433,7 @@ http_interactions: }, "type": "card_error" }, - "latest_charge": "ch_3OoDQhKuuB1fWySn2oLhUB42", + "latest_charge": "ch_3P6h92KuuB1fWySn1vimbcUq", "livemode": false, "metadata": { }, @@ -454,8 +465,9 @@ http_interactions: "transfer_group": null }, "payment_method": { - "id": "pm_1OoDQhKuuB1fWySnEHtv7tdi", + "id": "pm_1P6h92KuuB1fWySn0HDWMel6", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -495,16 +507,16 @@ http_interactions: }, "wallet": null }, - "created": 1708989471, + "created": 1713393600, "customer": null, "livemode": false, "metadata": { }, "type": "card" }, - "request_log_url": "https://dashboard.stripe.com/test/logs/req_qELxBmYqT3kUy2?t=1708989472", + "request_log_url": "https://dashboard.stripe.com/test/logs/req_obyVJ21H3H5mhN?t=1713393601", "type": "card_error" } } - recorded_at: Mon, 26 Feb 2024 23:17:53 GMT + recorded_at: Wed, 17 Apr 2024 22:40:02 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Generic_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Generic_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml similarity index 79% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Generic_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Generic_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml index 7998e5a4b0..2a4f03f7be 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Generic_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Generic_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4000000000000002&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_NgVZAfvQo7sWeS","request_duration_ms":285}}' + - '{"last_request_metrics":{"request_id":"req_zvf4CAVwSgnYlD","request_duration_ms":325}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:43 GMT + - Wed, 17 Apr 2024 22:39:51 GMT Content-Type: - application/json Content-Length: - - '960' + - '996' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 93422b41-9d6b-4ca8-bda9-9c37c45c0cb6 + - 3e2ebf31-c7da-4577-a8dc-1a2b58d16b4f Original-Request: - - req_dgAXMr8QqOSEcQ + - req_JEskdY1fDUZiGK + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_dgAXMr8QqOSEcQ + - req_JEskdY1fDUZiGK Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQZKuuB1fWySnK8H5CQpG", + "id": "pm_1P6h8tKuuB1fWySnVkyyCW9S", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989463, + "created": 1713393591, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:43 GMT + recorded_at: Wed, 17 Apr 2024 22:39:51 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDQZKuuB1fWySnK8H5CQpG&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h8tKuuB1fWySnVkyyCW9S&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_dgAXMr8QqOSEcQ","request_duration_ms":463}}' + - '{"last_request_metrics":{"request_id":"req_JEskdY1fDUZiGK","request_duration_ms":549}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:44 GMT + - Wed, 17 Apr 2024 22:39:51 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 3dee6be9-68cb-4987-9734-7ce17ecfe56e + - a9b30257-3b69-44bb-b62c-4f1b28088b3d Original-Request: - - req_6T95wtszit0CGU + - req_ozBWc8q3xpqvDc + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_6T95wtszit0CGU + - req_ozBWc8q3xpqvDc Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQaKuuB1fWySn27iqFUl4", + "id": "pi_3P6h8tKuuB1fWySn0b4wKpwW", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQaKuuB1fWySn27iqFUl4_secret_Y5TipcsD52eWHfPD5UJtzjdWt", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989464, + "created": 1713393591, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQZKuuB1fWySnK8H5CQpG", + "payment_method": "pm_1P6h8tKuuB1fWySnVkyyCW9S", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:44 GMT + recorded_at: Wed, 17 Apr 2024 22:39:51 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQaKuuB1fWySn27iqFUl4/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8tKuuB1fWySn0b4wKpwW/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_6T95wtszit0CGU","request_duration_ms":408}}' + - '{"last_request_metrics":{"request_id":"req_ozBWc8q3xpqvDc","request_duration_ms":507}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,11 +295,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:45 GMT + - Wed, 17 Apr 2024 22:39:52 GMT Content-Type: - application/json Content-Length: - - '4780' + - '4864' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - c494f9de-dd19-4656-8566-8b6b9a1f2d58 + - 0b9dcf4b-a558-4d29-8bd2-39741508a496 Original-Request: - - req_dVjN28jJNNozsu + - req_P1pWIPxC0iMtgI + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_dVjN28jJNNozsu + - req_P1pWIPxC0iMtgI Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -337,13 +347,13 @@ http_interactions: string: | { "error": { - "charge": "ch_3OoDQaKuuB1fWySn2aI0aaL3", + "charge": "ch_3P6h8tKuuB1fWySn0h2YuoXV", "code": "card_declined", "decline_code": "generic_decline", "doc_url": "https://stripe.com/docs/error-codes/card-declined", "message": "Your card was declined.", "payment_intent": { - "id": "pi_3OoDQaKuuB1fWySn27iqFUl4", + "id": "pi_3P6h8tKuuB1fWySn0b4wKpwW", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -358,22 +368,23 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQaKuuB1fWySn27iqFUl4_secret_Y5TipcsD52eWHfPD5UJtzjdWt", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989464, + "created": 1713393591, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": { - "charge": "ch_3OoDQaKuuB1fWySn2aI0aaL3", + "charge": "ch_3P6h8tKuuB1fWySn0h2YuoXV", "code": "card_declined", "decline_code": "generic_decline", "doc_url": "https://stripe.com/docs/error-codes/card-declined", "message": "Your card was declined.", "payment_method": { - "id": "pm_1OoDQZKuuB1fWySnK8H5CQpG", + "id": "pm_1P6h8tKuuB1fWySnVkyyCW9S", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -413,7 +424,7 @@ http_interactions: }, "wallet": null }, - "created": 1708989463, + "created": 1713393591, "customer": null, "livemode": false, "metadata": { @@ -422,7 +433,7 @@ http_interactions: }, "type": "card_error" }, - "latest_charge": "ch_3OoDQaKuuB1fWySn2aI0aaL3", + "latest_charge": "ch_3P6h8tKuuB1fWySn0h2YuoXV", "livemode": false, "metadata": { }, @@ -454,8 +465,9 @@ http_interactions: "transfer_group": null }, "payment_method": { - "id": "pm_1OoDQZKuuB1fWySnK8H5CQpG", + "id": "pm_1P6h8tKuuB1fWySnVkyyCW9S", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -495,16 +507,16 @@ http_interactions: }, "wallet": null }, - "created": 1708989463, + "created": 1713393591, "customer": null, "livemode": false, "metadata": { }, "type": "card" }, - "request_log_url": "https://dashboard.stripe.com/test/logs/req_dVjN28jJNNozsu?t=1708989464", + "request_log_url": "https://dashboard.stripe.com/test/logs/req_P1pWIPxC0iMtgI?t=1713393592", "type": "card_error" } } - recorded_at: Mon, 26 Feb 2024 23:17:45 GMT + recorded_at: Wed, 17 Apr 2024 22:39:53 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Incorrect_CVC_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Incorrect_CVC_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml similarity index 79% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Incorrect_CVC_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Incorrect_CVC_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml index 7a113e3ff1..0a57cb8215 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Incorrect_CVC_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Incorrect_CVC_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4000000000000127&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_xfUXVWjlALxHQl","request_duration_ms":409}}' + - '{"last_request_metrics":{"request_id":"req_AcKGwgfHNiqkQ2","request_duration_ms":510}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:53 GMT + - Wed, 17 Apr 2024 22:40:02 GMT Content-Type: - application/json Content-Length: - - '960' + - '996' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 0fe8c20d-b24a-4fad-a4f9-f343af72c2e4 + - c138f19e-3512-4b4a-ab08-b2d672ecfc54 Original-Request: - - req_GWZZ1t7FSzsvKH + - req_AT9S1WAn7ax8yv + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_GWZZ1t7FSzsvKH + - req_AT9S1WAn7ax8yv Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQjKuuB1fWySnYSitoAtb", + "id": "pm_1P6h94KuuB1fWySnQFqcyGd2", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989473, + "created": 1713393602, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:53 GMT + recorded_at: Wed, 17 Apr 2024 22:40:02 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDQjKuuB1fWySnYSitoAtb&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h94KuuB1fWySnQFqcyGd2&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_GWZZ1t7FSzsvKH","request_duration_ms":399}}' + - '{"last_request_metrics":{"request_id":"req_AT9S1WAn7ax8yv","request_duration_ms":600}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:54 GMT + - Wed, 17 Apr 2024 22:40:03 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - d4fa6a4c-80b1-49f6-ab92-a60d869f62e7 + - d290a537-0a3c-4289-a344-9798fab37425 Original-Request: - - req_Is4KzsQaINm0Op + - req_wjgo9m5BZbNXmh + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_Is4KzsQaINm0Op + - req_wjgo9m5BZbNXmh Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQjKuuB1fWySn2JEHS3Ub", + "id": "pi_3P6h95KuuB1fWySn097LCCVO", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQjKuuB1fWySn2JEHS3Ub_secret_xtZr10uvf2sjtHpmw4DkTXgtG", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989473, + "created": 1713393603, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQjKuuB1fWySnYSitoAtb", + "payment_method": "pm_1P6h94KuuB1fWySnQFqcyGd2", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:54 GMT + recorded_at: Wed, 17 Apr 2024 22:40:03 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQjKuuB1fWySn2JEHS3Ub/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h95KuuB1fWySn097LCCVO/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_Is4KzsQaINm0Op","request_duration_ms":380}}' + - '{"last_request_metrics":{"request_id":"req_wjgo9m5BZbNXmh","request_duration_ms":509}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,11 +295,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:54 GMT + - Wed, 17 Apr 2024 22:40:04 GMT Content-Type: - application/json Content-Length: - - '4774' + - '4858' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - f1cbed8e-1d5c-47c5-90f7-3e6736da9ba0 + - 45c87915-37a5-4aec-b237-400cf3fcdb98 Original-Request: - - req_Ofadt1Vvnp0loi + - req_vnOxwSvTNRDLKP + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_Ofadt1Vvnp0loi + - req_vnOxwSvTNRDLKP Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -337,13 +347,13 @@ http_interactions: string: | { "error": { - "charge": "ch_3OoDQjKuuB1fWySn28LornTi", + "charge": "ch_3P6h95KuuB1fWySn02izQ9TQ", "code": "incorrect_cvc", "doc_url": "https://stripe.com/docs/error-codes/incorrect-cvc", "message": "Your card's security code is incorrect.", "param": "cvc", "payment_intent": { - "id": "pi_3OoDQjKuuB1fWySn2JEHS3Ub", + "id": "pi_3P6h95KuuB1fWySn097LCCVO", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -358,22 +368,23 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQjKuuB1fWySn2JEHS3Ub_secret_xtZr10uvf2sjtHpmw4DkTXgtG", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989473, + "created": 1713393603, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": { - "charge": "ch_3OoDQjKuuB1fWySn28LornTi", + "charge": "ch_3P6h95KuuB1fWySn02izQ9TQ", "code": "incorrect_cvc", "doc_url": "https://stripe.com/docs/error-codes/incorrect-cvc", "message": "Your card's security code is incorrect.", "param": "cvc", "payment_method": { - "id": "pm_1OoDQjKuuB1fWySnYSitoAtb", + "id": "pm_1P6h94KuuB1fWySnQFqcyGd2", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -413,7 +424,7 @@ http_interactions: }, "wallet": null }, - "created": 1708989473, + "created": 1713393602, "customer": null, "livemode": false, "metadata": { @@ -422,7 +433,7 @@ http_interactions: }, "type": "card_error" }, - "latest_charge": "ch_3OoDQjKuuB1fWySn28LornTi", + "latest_charge": "ch_3P6h95KuuB1fWySn02izQ9TQ", "livemode": false, "metadata": { }, @@ -454,8 +465,9 @@ http_interactions: "transfer_group": null }, "payment_method": { - "id": "pm_1OoDQjKuuB1fWySnYSitoAtb", + "id": "pm_1P6h94KuuB1fWySnQFqcyGd2", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -495,16 +507,16 @@ http_interactions: }, "wallet": null }, - "created": 1708989473, + "created": 1713393602, "customer": null, "livemode": false, "metadata": { }, "type": "card" }, - "request_log_url": "https://dashboard.stripe.com/test/logs/req_Ofadt1Vvnp0loi?t=1708989474", + "request_log_url": "https://dashboard.stripe.com/test/logs/req_vnOxwSvTNRDLKP?t=1713393603", "type": "card_error" } } - recorded_at: Mon, 26 Feb 2024 23:17:54 GMT + recorded_at: Wed, 17 Apr 2024 22:40:04 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Insufficient_funds_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Insufficient_funds_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml similarity index 79% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Insufficient_funds_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Insufficient_funds_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml index 12e80fa92b..2f4c58fce1 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Insufficient_funds_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Insufficient_funds_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4000000000009995&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_6T95wtszit0CGU","request_duration_ms":408}}' + - '{"last_request_metrics":{"request_id":"req_ozBWc8q3xpqvDc","request_duration_ms":507}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:45 GMT + - Wed, 17 Apr 2024 22:39:53 GMT Content-Type: - application/json Content-Length: - - '960' + - '996' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - aa907268-9b64-45ba-87e9-c0784e07bdee + - 811b2fb6-a22d-4e1c-b24f-99023c6c8c06 Original-Request: - - req_gEcfIDJsayXoiX + - req_X81UrQj5D2fIoG + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_gEcfIDJsayXoiX + - req_X81UrQj5D2fIoG Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQbKuuB1fWySnm1EPtrSP", + "id": "pm_1P6h8vKuuB1fWySnVKifRHk9", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989465, + "created": 1713393593, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:45 GMT + recorded_at: Wed, 17 Apr 2024 22:39:53 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDQbKuuB1fWySnm1EPtrSP&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h8vKuuB1fWySnVKifRHk9&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_gEcfIDJsayXoiX","request_duration_ms":500}}' + - '{"last_request_metrics":{"request_id":"req_X81UrQj5D2fIoG","request_duration_ms":497}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:46 GMT + - Wed, 17 Apr 2024 22:39:54 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 7352e50c-f8b6-4f3a-bf5f-c059572d86df + - 212396f7-3cd5-491b-95ba-e1dc90a8b0af Original-Request: - - req_jBN5An2SJq9AjN + - req_tdGmWRacIg71uZ + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_jBN5An2SJq9AjN + - req_tdGmWRacIg71uZ Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQcKuuB1fWySn0yuf2YzI", + "id": "pi_3P6h8vKuuB1fWySn176iLXFn", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQcKuuB1fWySn0yuf2YzI_secret_gIS8IeaqTAOU2eIEn6dz31uoq", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989466, + "created": 1713393593, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQbKuuB1fWySnm1EPtrSP", + "payment_method": "pm_1P6h8vKuuB1fWySnVKifRHk9", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:46 GMT + recorded_at: Wed, 17 Apr 2024 22:39:54 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQcKuuB1fWySn0yuf2YzI/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8vKuuB1fWySn176iLXFn/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_jBN5An2SJq9AjN","request_duration_ms":393}}' + - '{"last_request_metrics":{"request_id":"req_tdGmWRacIg71uZ","request_duration_ms":509}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,11 +295,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:47 GMT + - Wed, 17 Apr 2024 22:39:55 GMT Content-Type: - application/json Content-Length: - - '4806' + - '4890' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 44bcd896-d3cb-476c-8d50-b27b7ed2a7f5 + - 19c2ea46-8301-4ca7-a76e-91eafa74a68f Original-Request: - - req_IZmZqU96ZPqqZR + - req_Uinf6vD8KZj9v4 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_IZmZqU96ZPqqZR + - req_Uinf6vD8KZj9v4 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -337,13 +347,13 @@ http_interactions: string: | { "error": { - "charge": "ch_3OoDQcKuuB1fWySn0VAk4abK", + "charge": "ch_3P6h8vKuuB1fWySn1dijUtHM", "code": "card_declined", "decline_code": "insufficient_funds", "doc_url": "https://stripe.com/docs/error-codes/card-declined", "message": "Your card has insufficient funds.", "payment_intent": { - "id": "pi_3OoDQcKuuB1fWySn0yuf2YzI", + "id": "pi_3P6h8vKuuB1fWySn176iLXFn", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -358,22 +368,23 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQcKuuB1fWySn0yuf2YzI_secret_gIS8IeaqTAOU2eIEn6dz31uoq", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989466, + "created": 1713393593, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": { - "charge": "ch_3OoDQcKuuB1fWySn0VAk4abK", + "charge": "ch_3P6h8vKuuB1fWySn1dijUtHM", "code": "card_declined", "decline_code": "insufficient_funds", "doc_url": "https://stripe.com/docs/error-codes/card-declined", "message": "Your card has insufficient funds.", "payment_method": { - "id": "pm_1OoDQbKuuB1fWySnm1EPtrSP", + "id": "pm_1P6h8vKuuB1fWySnVKifRHk9", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -413,7 +424,7 @@ http_interactions: }, "wallet": null }, - "created": 1708989465, + "created": 1713393593, "customer": null, "livemode": false, "metadata": { @@ -422,7 +433,7 @@ http_interactions: }, "type": "card_error" }, - "latest_charge": "ch_3OoDQcKuuB1fWySn0VAk4abK", + "latest_charge": "ch_3P6h8vKuuB1fWySn1dijUtHM", "livemode": false, "metadata": { }, @@ -454,8 +465,9 @@ http_interactions: "transfer_group": null }, "payment_method": { - "id": "pm_1OoDQbKuuB1fWySnm1EPtrSP", + "id": "pm_1P6h8vKuuB1fWySnVKifRHk9", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -495,16 +507,16 @@ http_interactions: }, "wallet": null }, - "created": 1708989465, + "created": 1713393593, "customer": null, "livemode": false, "metadata": { }, "type": "card" }, - "request_log_url": "https://dashboard.stripe.com/test/logs/req_IZmZqU96ZPqqZR?t=1708989466", + "request_log_url": "https://dashboard.stripe.com/test/logs/req_Uinf6vD8KZj9v4?t=1713393594", "type": "card_error" } } - recorded_at: Mon, 26 Feb 2024 23:17:47 GMT + recorded_at: Wed, 17 Apr 2024 22:39:55 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Lost_card_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Lost_card_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml similarity index 79% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Lost_card_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Lost_card_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml index 7db3fe4dc9..0fc939c873 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Lost_card_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Lost_card_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4000000000009987&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_jBN5An2SJq9AjN","request_duration_ms":393}}' + - '{"last_request_metrics":{"request_id":"req_tdGmWRacIg71uZ","request_duration_ms":509}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:47 GMT + - Wed, 17 Apr 2024 22:39:55 GMT Content-Type: - application/json Content-Length: - - '960' + - '996' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - a56e3b14-5538-4012-9923-1d012f374f43 + - d0d41881-d7af-4ce4-a47c-4ae4b0843c6e Original-Request: - - req_g8gUfNIpAGL3cS + - req_xLfba5hGPhEt2G + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_g8gUfNIpAGL3cS + - req_xLfba5hGPhEt2G Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQdKuuB1fWySnadmRjCqa", + "id": "pm_1P6h8xKuuB1fWySnLRqxbX0I", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989467, + "created": 1713393595, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:47 GMT + recorded_at: Wed, 17 Apr 2024 22:39:55 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDQdKuuB1fWySnadmRjCqa&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h8xKuuB1fWySnLRqxbX0I&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_g8gUfNIpAGL3cS","request_duration_ms":429}}' + - '{"last_request_metrics":{"request_id":"req_xLfba5hGPhEt2G","request_duration_ms":496}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:48 GMT + - Wed, 17 Apr 2024 22:39:56 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 3f2d1c44-d8fb-4fcd-830b-2240594c1cba + - c8d47cf3-ea2b-4a50-8591-18fa853b3a59 Original-Request: - - req_7uvCBxbOWGkfAC + - req_64JFtjubv6sXiB + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_7uvCBxbOWGkfAC + - req_64JFtjubv6sXiB Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQdKuuB1fWySn1NipVu86", + "id": "pi_3P6h8xKuuB1fWySn1DJmrN9c", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQdKuuB1fWySn1NipVu86_secret_EJcdlJl7urjwpqL9LVGBIO3sx", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989467, + "created": 1713393595, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQdKuuB1fWySnadmRjCqa", + "payment_method": "pm_1P6h8xKuuB1fWySnLRqxbX0I", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:48 GMT + recorded_at: Wed, 17 Apr 2024 22:39:56 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQdKuuB1fWySn1NipVu86/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8xKuuB1fWySn1DJmrN9c/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_7uvCBxbOWGkfAC","request_duration_ms":378}}' + - '{"last_request_metrics":{"request_id":"req_64JFtjubv6sXiB","request_duration_ms":509}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,11 +295,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:49 GMT + - Wed, 17 Apr 2024 22:39:57 GMT Content-Type: - application/json Content-Length: - - '4768' + - '4852' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 67b0b222-70ac-42bd-a9d3-b647bd98bfdf + - 0a23bb08-3af7-4271-a71c-8bcfc1270f8d Original-Request: - - req_ll6n3AUvqW8zGH + - req_pHn2N3UwZjAJka + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_ll6n3AUvqW8zGH + - req_pHn2N3UwZjAJka Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -337,13 +347,13 @@ http_interactions: string: | { "error": { - "charge": "ch_3OoDQdKuuB1fWySn1hFIoLlq", + "charge": "ch_3P6h8xKuuB1fWySn1og4ys7e", "code": "card_declined", "decline_code": "lost_card", "doc_url": "https://stripe.com/docs/error-codes/card-declined", "message": "Your card was declined.", "payment_intent": { - "id": "pi_3OoDQdKuuB1fWySn1NipVu86", + "id": "pi_3P6h8xKuuB1fWySn1DJmrN9c", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -358,22 +368,23 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQdKuuB1fWySn1NipVu86_secret_EJcdlJl7urjwpqL9LVGBIO3sx", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989467, + "created": 1713393595, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": { - "charge": "ch_3OoDQdKuuB1fWySn1hFIoLlq", + "charge": "ch_3P6h8xKuuB1fWySn1og4ys7e", "code": "card_declined", "decline_code": "lost_card", "doc_url": "https://stripe.com/docs/error-codes/card-declined", "message": "Your card was declined.", "payment_method": { - "id": "pm_1OoDQdKuuB1fWySnadmRjCqa", + "id": "pm_1P6h8xKuuB1fWySnLRqxbX0I", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -413,7 +424,7 @@ http_interactions: }, "wallet": null }, - "created": 1708989467, + "created": 1713393595, "customer": null, "livemode": false, "metadata": { @@ -422,7 +433,7 @@ http_interactions: }, "type": "card_error" }, - "latest_charge": "ch_3OoDQdKuuB1fWySn1hFIoLlq", + "latest_charge": "ch_3P6h8xKuuB1fWySn1og4ys7e", "livemode": false, "metadata": { }, @@ -454,8 +465,9 @@ http_interactions: "transfer_group": null }, "payment_method": { - "id": "pm_1OoDQdKuuB1fWySnadmRjCqa", + "id": "pm_1P6h8xKuuB1fWySnLRqxbX0I", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -495,16 +507,16 @@ http_interactions: }, "wallet": null }, - "created": 1708989467, + "created": 1713393595, "customer": null, "livemode": false, "metadata": { }, "type": "card" }, - "request_log_url": "https://dashboard.stripe.com/test/logs/req_ll6n3AUvqW8zGH?t=1708989468", + "request_log_url": "https://dashboard.stripe.com/test/logs/req_pHn2N3UwZjAJka?t=1713393596", "type": "card_error" } } - recorded_at: Mon, 26 Feb 2024 23:17:49 GMT + recorded_at: Wed, 17 Apr 2024 22:39:57 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Processing_error_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Processing_error_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml similarity index 79% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Processing_error_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Processing_error_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml index 50961075ac..295baaa8f7 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Processing_error_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Processing_error_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4000000000000119&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_Is4KzsQaINm0Op","request_duration_ms":380}}' + - '{"last_request_metrics":{"request_id":"req_wjgo9m5BZbNXmh","request_duration_ms":509}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:55 GMT + - Wed, 17 Apr 2024 22:40:05 GMT Content-Type: - application/json Content-Length: - - '960' + - '996' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - c25839ef-8ce6-4f4b-99e5-9c70240ea49e + - d5fc1c0d-9ed9-4c00-acf9-f4be04c6b19a Original-Request: - - req_vBkkbzirM2WNCQ + - req_vIHentAe5XkqId + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_vBkkbzirM2WNCQ + - req_vIHentAe5XkqId Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQlKuuB1fWySnslm5VUSP", + "id": "pm_1P6h96KuuB1fWySnYl63gMcD", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989475, + "created": 1713393604, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:55 GMT + recorded_at: Wed, 17 Apr 2024 22:40:05 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDQlKuuB1fWySnslm5VUSP&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h96KuuB1fWySnYl63gMcD&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_vBkkbzirM2WNCQ","request_duration_ms":420}}' + - '{"last_request_metrics":{"request_id":"req_vIHentAe5XkqId","request_duration_ms":577}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:55 GMT + - Wed, 17 Apr 2024 22:40:05 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 676b52ee-f2e6-424e-82f1-30cf137b2708 + - c11e2fb3-ceab-4dfe-8d7a-96280372a227 Original-Request: - - req_AyeNpHCuhODsbo + - req_MTnLIBxp9QZPi2 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_AyeNpHCuhODsbo + - req_MTnLIBxp9QZPi2 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQlKuuB1fWySn0zBKCLpt", + "id": "pi_3P6h97KuuB1fWySn0bvt3XeL", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQlKuuB1fWySn0zBKCLpt_secret_LOdTi4rN8QTt5VnZnlzp1S3a5", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989475, + "created": 1713393605, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQlKuuB1fWySnslm5VUSP", + "payment_method": "pm_1P6h96KuuB1fWySnYl63gMcD", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:55 GMT + recorded_at: Wed, 17 Apr 2024 22:40:05 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQlKuuB1fWySn0zBKCLpt/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h97KuuB1fWySn0bvt3XeL/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_AyeNpHCuhODsbo","request_duration_ms":510}}' + - '{"last_request_metrics":{"request_id":"req_MTnLIBxp9QZPi2","request_duration_ms":529}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,11 +295,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:56 GMT + - Wed, 17 Apr 2024 22:40:06 GMT Content-Type: - application/json Content-Length: - - '4808' + - '4892' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 32ad4ec4-c011-4061-ad90-51b71397515e + - 483ca1ff-5a07-41ab-bebf-f2ca9dc6531e Original-Request: - - req_qSo3hj20b3L9V9 + - req_wyhh7XdnfzCAm0 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_qSo3hj20b3L9V9 + - req_wyhh7XdnfzCAm0 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -337,12 +347,12 @@ http_interactions: string: | { "error": { - "charge": "ch_3OoDQlKuuB1fWySn0KSD4Jlh", + "charge": "ch_3P6h97KuuB1fWySn07xJWGvn", "code": "processing_error", "doc_url": "https://stripe.com/docs/error-codes/processing-error", "message": "An error occurred while processing your card. Try again in a little bit.", "payment_intent": { - "id": "pi_3OoDQlKuuB1fWySn0zBKCLpt", + "id": "pi_3P6h97KuuB1fWySn0bvt3XeL", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -357,21 +367,22 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQlKuuB1fWySn0zBKCLpt_secret_LOdTi4rN8QTt5VnZnlzp1S3a5", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989475, + "created": 1713393605, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": { - "charge": "ch_3OoDQlKuuB1fWySn0KSD4Jlh", + "charge": "ch_3P6h97KuuB1fWySn07xJWGvn", "code": "processing_error", "doc_url": "https://stripe.com/docs/error-codes/processing-error", "message": "An error occurred while processing your card. Try again in a little bit.", "payment_method": { - "id": "pm_1OoDQlKuuB1fWySnslm5VUSP", + "id": "pm_1P6h96KuuB1fWySnYl63gMcD", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -411,7 +422,7 @@ http_interactions: }, "wallet": null }, - "created": 1708989475, + "created": 1713393604, "customer": null, "livemode": false, "metadata": { @@ -420,7 +431,7 @@ http_interactions: }, "type": "card_error" }, - "latest_charge": "ch_3OoDQlKuuB1fWySn0KSD4Jlh", + "latest_charge": "ch_3P6h97KuuB1fWySn07xJWGvn", "livemode": false, "metadata": { }, @@ -452,8 +463,9 @@ http_interactions: "transfer_group": null }, "payment_method": { - "id": "pm_1OoDQlKuuB1fWySnslm5VUSP", + "id": "pm_1P6h96KuuB1fWySnYl63gMcD", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -493,16 +505,16 @@ http_interactions: }, "wallet": null }, - "created": 1708989475, + "created": 1713393604, "customer": null, "livemode": false, "metadata": { }, "type": "card" }, - "request_log_url": "https://dashboard.stripe.com/test/logs/req_qSo3hj20b3L9V9?t=1708989475", + "request_log_url": "https://dashboard.stripe.com/test/logs/req_wyhh7XdnfzCAm0?t=1713393605", "type": "card_error" } } - recorded_at: Mon, 26 Feb 2024 23:17:57 GMT + recorded_at: Wed, 17 Apr 2024 22:40:06 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Stolen_card_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Stolen_card_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml similarity index 79% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Stolen_card_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Stolen_card_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml index 9355299699..160c03b9af 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Stolen_card_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_invalid/invalid_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Stolen_card_decline/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4000000000009979&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_7uvCBxbOWGkfAC","request_duration_ms":378}}' + - '{"last_request_metrics":{"request_id":"req_64JFtjubv6sXiB","request_duration_ms":509}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:49 GMT + - Wed, 17 Apr 2024 22:39:57 GMT Content-Type: - application/json Content-Length: - - '960' + - '996' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 0ee915a8-d4c8-4f4c-8eae-0166073c4f56 + - 9b80cc2a-8752-4ccc-949c-427e3892c6f8 Original-Request: - - req_27re6jomwTkQDM + - req_VroYwmmGAe7bGf + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_27re6jomwTkQDM + - req_VroYwmmGAe7bGf Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQfKuuB1fWySn1nUWNw2b", + "id": "pm_1P6h8zKuuB1fWySnyte7TuZO", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989469, + "created": 1713393597, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:49 GMT + recorded_at: Wed, 17 Apr 2024 22:39:57 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDQfKuuB1fWySn1nUWNw2b&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h8zKuuB1fWySnyte7TuZO&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_27re6jomwTkQDM","request_duration_ms":502}}' + - '{"last_request_metrics":{"request_id":"req_VroYwmmGAe7bGf","request_duration_ms":499}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:50 GMT + - Wed, 17 Apr 2024 22:39:58 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 97e20dfd-36b7-4e71-88c6-6349f684f5ef + - 005b8a2f-5672-4d21-aebe-188d3bb56506 Original-Request: - - req_it1mYKQGWiiXSo + - req_91pHPi8RnhHsyR + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_it1mYKQGWiiXSo + - req_91pHPi8RnhHsyR Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQfKuuB1fWySn1mBBlS6b", + "id": "pi_3P6h90KuuB1fWySn2SMGU8mf", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQfKuuB1fWySn1mBBlS6b_secret_GtcHWWvxC0pGOcm19CtPccbBS", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989469, + "created": 1713393598, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQfKuuB1fWySn1nUWNw2b", + "payment_method": "pm_1P6h8zKuuB1fWySnyte7TuZO", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:50 GMT + recorded_at: Wed, 17 Apr 2024 22:39:58 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQfKuuB1fWySn1mBBlS6b/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h90KuuB1fWySn2SMGU8mf/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_it1mYKQGWiiXSo","request_duration_ms":513}}' + - '{"last_request_metrics":{"request_id":"req_91pHPi8RnhHsyR","request_duration_ms":1226}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,11 +295,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:51 GMT + - Wed, 17 Apr 2024 22:39:59 GMT Content-Type: - application/json Content-Length: - - '4772' + - '4856' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - c909d43e-25e0-474f-8ba8-5337c2c34bfd + - 37315a7f-b15c-4f95-88ad-0ef2f556d2da Original-Request: - - req_TmV1jl7ePtlUSt + - req_tJpyXlIUqME2C6 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_TmV1jl7ePtlUSt + - req_tJpyXlIUqME2C6 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -337,13 +347,13 @@ http_interactions: string: | { "error": { - "charge": "ch_3OoDQfKuuB1fWySn1PRp1Tz2", + "charge": "ch_3P6h90KuuB1fWySn2uILaF5P", "code": "card_declined", "decline_code": "stolen_card", "doc_url": "https://stripe.com/docs/error-codes/card-declined", "message": "Your card was declined.", "payment_intent": { - "id": "pi_3OoDQfKuuB1fWySn1mBBlS6b", + "id": "pi_3P6h90KuuB1fWySn2SMGU8mf", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -358,22 +368,23 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQfKuuB1fWySn1mBBlS6b_secret_GtcHWWvxC0pGOcm19CtPccbBS", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989469, + "created": 1713393598, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": { - "charge": "ch_3OoDQfKuuB1fWySn1PRp1Tz2", + "charge": "ch_3P6h90KuuB1fWySn2uILaF5P", "code": "card_declined", "decline_code": "stolen_card", "doc_url": "https://stripe.com/docs/error-codes/card-declined", "message": "Your card was declined.", "payment_method": { - "id": "pm_1OoDQfKuuB1fWySn1nUWNw2b", + "id": "pm_1P6h8zKuuB1fWySnyte7TuZO", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -413,7 +424,7 @@ http_interactions: }, "wallet": null }, - "created": 1708989469, + "created": 1713393597, "customer": null, "livemode": false, "metadata": { @@ -422,7 +433,7 @@ http_interactions: }, "type": "card_error" }, - "latest_charge": "ch_3OoDQfKuuB1fWySn1PRp1Tz2", + "latest_charge": "ch_3P6h90KuuB1fWySn2uILaF5P", "livemode": false, "metadata": { }, @@ -454,8 +465,9 @@ http_interactions: "transfer_group": null }, "payment_method": { - "id": "pm_1OoDQfKuuB1fWySn1nUWNw2b", + "id": "pm_1P6h8zKuuB1fWySnyte7TuZO", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -495,16 +507,16 @@ http_interactions: }, "wallet": null }, - "created": 1708989469, + "created": 1713393597, "customer": null, "livemode": false, "metadata": { }, "type": "card" }, - "request_log_url": "https://dashboard.stripe.com/test/logs/req_TmV1jl7ePtlUSt?t=1708989470", + "request_log_url": "https://dashboard.stripe.com/test/logs/req_tJpyXlIUqME2C6?t=1713393599", "type": "card_error" } } - recorded_at: Mon, 26 Feb 2024 23:17:51 GMT + recorded_at: Wed, 17 Apr 2024 22:39:59 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_American_Express/captures_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_American_Express/captures_the_payment.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_American_Express/captures_the_payment.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_American_Express/captures_the_payment.yml index 36e48968f7..87d9f2b0f0 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_American_Express/captures_the_payment.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_American_Express/captures_the_payment.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=378282246310005&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_PnkNKBDHUl3SKo","request_duration_ms":958}}' + - '{"last_request_metrics":{"request_id":"req_8RoSQ8dLWnQaG2","request_duration_ms":946}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:56 GMT + - Wed, 17 Apr 2024 22:38:56 GMT Content-Type: - application/json Content-Length: - - '973' + - '1009' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - a63f8cfd-3ef3-4814-b635-adfce3fda5bd + - dc2bb939-488a-4e51-acd0-f41ddadbff8e Original-Request: - - req_zt1zvUTO2AwcQm + - req_yDVoUX6jGomVz3 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_zt1zvUTO2AwcQm + - req_yDVoUX6jGomVz3 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDPoKuuB1fWySnksEAt7Ps", + "id": "pm_1P6h80KuuB1fWySnKLIYVtP4", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989416, + "created": 1713393536, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:56 GMT + recorded_at: Wed, 17 Apr 2024 22:38:56 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDPoKuuB1fWySnksEAt7Ps&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h80KuuB1fWySnKLIYVtP4&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_zt1zvUTO2AwcQm","request_duration_ms":523}}' + - '{"last_request_metrics":{"request_id":"req_yDVoUX6jGomVz3","request_duration_ms":521}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:57 GMT + - Wed, 17 Apr 2024 22:38:57 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 6e083d5d-457a-4912-8296-57c673da4ccf + - d56f56a8-973f-4586-baed-3d6321ccfedd Original-Request: - - req_PqVaGs5kVh7ege + - req_7zJLlUTwf7naGK + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_PqVaGs5kVh7ege + - req_7zJLlUTwf7naGK Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPoKuuB1fWySn2dQ59nUI", + "id": "pi_3P6h81KuuB1fWySn1i3iTLoX", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPoKuuB1fWySn2dQ59nUI_secret_tEDlmysVGL4amETRITGP7g2O2", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989416, + "created": 1713393537, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPoKuuB1fWySnksEAt7Ps", + "payment_method": "pm_1P6h80KuuB1fWySnKLIYVtP4", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:57 GMT + recorded_at: Wed, 17 Apr 2024 22:38:57 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPoKuuB1fWySn2dQ59nUI/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h81KuuB1fWySn1i3iTLoX/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_PqVaGs5kVh7ege","request_duration_ms":441}}' + - '{"last_request_metrics":{"request_id":"req_7zJLlUTwf7naGK","request_duration_ms":509}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:57 GMT + - Wed, 17 Apr 2024 22:38:58 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 346ed035-f0d1-47e0-a288-069ca56b5504 + - e0e61825-c787-4fce-8f17-c83e0ef3e61c Original-Request: - - req_Vwd5lMn9g7ZEG7 + - req_79R8PUCuDi3D9P + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_Vwd5lMn9g7ZEG7 + - req_79R8PUCuDi3D9P Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPoKuuB1fWySn2dQ59nUI", + "id": "pi_3P6h81KuuB1fWySn1i3iTLoX", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPoKuuB1fWySn2dQ59nUI_secret_tEDlmysVGL4amETRITGP7g2O2", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989416, + "created": 1713393537, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPoKuuB1fWySn2BYRYmtO", + "latest_charge": "ch_3P6h81KuuB1fWySn1eMa5DyD", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPoKuuB1fWySnksEAt7Ps", + "payment_method": "pm_1P6h80KuuB1fWySnKLIYVtP4", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,29 +398,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:57 GMT + recorded_at: Wed, 17 Apr 2024 22:38:58 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPoKuuB1fWySn2dQ59nUI + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h81KuuB1fWySn1i3iTLoX body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_Vwd5lMn9g7ZEG7","request_duration_ms":887}}' + - '{"last_request_metrics":{"request_id":"req_79R8PUCuDi3D9P","request_duration_ms":993}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -423,7 +430,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:58 GMT + - Wed, 17 Apr 2024 22:38:58 GMT Content-Type: - application/json Content-Length: @@ -448,10 +455,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_GcXIzp0kd38yjk + - req_8YvzhYldSRubBW Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -462,7 +475,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPoKuuB1fWySn2dQ59nUI", + "id": "pi_3P6h81KuuB1fWySn1i3iTLoX", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -476,20 +489,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPoKuuB1fWySn2dQ59nUI_secret_tEDlmysVGL4amETRITGP7g2O2", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989416, + "created": 1713393537, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPoKuuB1fWySn2BYRYmtO", + "latest_charge": "ch_3P6h81KuuB1fWySn1eMa5DyD", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPoKuuB1fWySnksEAt7Ps", + "payment_method": "pm_1P6h80KuuB1fWySnKLIYVtP4", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -514,29 +527,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:58 GMT + recorded_at: Wed, 17 Apr 2024 22:38:58 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPoKuuB1fWySn2dQ59nUI/capture + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h81KuuB1fWySn1i3iTLoX/capture body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_GcXIzp0kd38yjk","request_duration_ms":277}}' + - '{"last_request_metrics":{"request_id":"req_8YvzhYldSRubBW","request_duration_ms":435}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -549,7 +559,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:59 GMT + - Wed, 17 Apr 2024 22:39:00 GMT Content-Type: - application/json Content-Length: @@ -574,16 +584,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - b6170c65-70e8-4045-8f8f-c9c1ab5a0b59 + - 25ffa565-65dd-44f1-b1de-5d1f834d0c07 Original-Request: - - req_xFAYQ4i3zn1b44 + - req_QHmUBQF84F7qG1 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_xFAYQ4i3zn1b44 + - req_QHmUBQF84F7qG1 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -594,7 +610,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPoKuuB1fWySn2dQ59nUI", + "id": "pi_3P6h81KuuB1fWySn1i3iTLoX", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -608,20 +624,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPoKuuB1fWySn2dQ59nUI_secret_tEDlmysVGL4amETRITGP7g2O2", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989416, + "created": 1713393537, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPoKuuB1fWySn2BYRYmtO", + "latest_charge": "ch_3P6h81KuuB1fWySn1eMa5DyD", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPoKuuB1fWySnksEAt7Ps", + "payment_method": "pm_1P6h80KuuB1fWySnKLIYVtP4", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -646,29 +662,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:59 GMT + recorded_at: Wed, 17 Apr 2024 22:39:00 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPoKuuB1fWySn2dQ59nUI + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h81KuuB1fWySn1i3iTLoX body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_xFAYQ4i3zn1b44","request_duration_ms":1053}}' + - '{"last_request_metrics":{"request_id":"req_QHmUBQF84F7qG1","request_duration_ms":1124}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -681,7 +694,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:59 GMT + - Wed, 17 Apr 2024 22:39:00 GMT Content-Type: - application/json Content-Length: @@ -706,10 +719,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_7fzqt4GnMNoHlB + - req_lW3Bslok4Lawnx Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -720,7 +739,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPoKuuB1fWySn2dQ59nUI", + "id": "pi_3P6h81KuuB1fWySn1i3iTLoX", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -734,20 +753,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPoKuuB1fWySn2dQ59nUI_secret_tEDlmysVGL4amETRITGP7g2O2", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989416, + "created": 1713393537, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPoKuuB1fWySn2BYRYmtO", + "latest_charge": "ch_3P6h81KuuB1fWySn1eMa5DyD", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPoKuuB1fWySnksEAt7Ps", + "payment_method": "pm_1P6h80KuuB1fWySnKLIYVtP4", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -772,5 +791,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:59 GMT + recorded_at: Wed, 17 Apr 2024 22:39:00 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_American_Express/returns_payment_intent_id_and_does_not_raise.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_American_Express/returns_payment_intent_id_and_does_not_raise.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_American_Express/returns_payment_intent_id_and_does_not_raise.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_American_Express/returns_payment_intent_id_and_does_not_raise.yml index e9a63dce4e..0a231d2704 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_American_Express/returns_payment_intent_id_and_does_not_raise.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_American_Express/returns_payment_intent_id_and_does_not_raise.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=378282246310005&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_EriVaYg2xAZ3G9","request_duration_ms":306}}' + - '{"last_request_metrics":{"request_id":"req_Op5E047dEuFump","request_duration_ms":405}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:54 GMT + - Wed, 17 Apr 2024 22:38:54 GMT Content-Type: - application/json Content-Length: - - '973' + - '1009' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - a1a7b2c2-f408-41ce-8503-54dae703169e + - c2c01d7e-8dba-4820-944c-529925047b7e Original-Request: - - req_q7yLdmlLyrKDoh + - req_sQ1BbnbMqtgWCv + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_q7yLdmlLyrKDoh + - req_sQ1BbnbMqtgWCv Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDPmKuuB1fWySndqg0rJhW", + "id": "pm_1P6h7yKuuB1fWySnAjXTMD0L", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989414, + "created": 1713393534, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:54 GMT + recorded_at: Wed, 17 Apr 2024 22:38:54 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDPmKuuB1fWySndqg0rJhW&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h7yKuuB1fWySnAjXTMD0L&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_q7yLdmlLyrKDoh","request_duration_ms":500}}' + - '{"last_request_metrics":{"request_id":"req_sQ1BbnbMqtgWCv","request_duration_ms":496}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:55 GMT + - Wed, 17 Apr 2024 22:38:55 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 403e7e93-6528-4bc2-b86b-08b9903ebd38 + - 9386dac8-1c19-4906-83cf-f2af342a6229 Original-Request: - - req_kYnRBdJGTt3o9r + - req_mXHokzUAHJQ1zS + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_kYnRBdJGTt3o9r + - req_mXHokzUAHJQ1zS Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPmKuuB1fWySn1pw0b7lT", + "id": "pi_3P6h7zKuuB1fWySn1IOJf23O", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPmKuuB1fWySn1pw0b7lT_secret_bK42ozNfTrhP7zdC7HSvGpnle", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989414, + "created": 1713393535, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPmKuuB1fWySndqg0rJhW", + "payment_method": "pm_1P6h7yKuuB1fWySnAjXTMD0L", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:55 GMT + recorded_at: Wed, 17 Apr 2024 22:38:55 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPmKuuB1fWySn1pw0b7lT/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7zKuuB1fWySn1IOJf23O/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_kYnRBdJGTt3o9r","request_duration_ms":371}}' + - '{"last_request_metrics":{"request_id":"req_mXHokzUAHJQ1zS","request_duration_ms":508}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:55 GMT + - Wed, 17 Apr 2024 22:38:56 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - fe1143e6-a57d-4489-9340-c803cea254cd + - 0e55b45a-9dfe-478d-8533-891777278c6d Original-Request: - - req_PnkNKBDHUl3SKo + - req_8RoSQ8dLWnQaG2 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_PnkNKBDHUl3SKo + - req_8RoSQ8dLWnQaG2 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPmKuuB1fWySn1pw0b7lT", + "id": "pi_3P6h7zKuuB1fWySn1IOJf23O", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPmKuuB1fWySn1pw0b7lT_secret_bK42ozNfTrhP7zdC7HSvGpnle", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989414, + "created": 1713393535, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPmKuuB1fWySn11jcty9b", + "latest_charge": "ch_3P6h7zKuuB1fWySn12dvB53S", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPmKuuB1fWySndqg0rJhW", + "payment_method": "pm_1P6h7yKuuB1fWySnAjXTMD0L", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,5 +398,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:55 GMT + recorded_at: Wed, 17 Apr 2024 22:38:56 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_BCcard_and_DinaCard/captures_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_BCcard_and_DinaCard/captures_the_payment.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_BCcard_and_DinaCard/captures_the_payment.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_BCcard_and_DinaCard/captures_the_payment.yml index d097b11621..ace626cb3a 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_BCcard_and_DinaCard/captures_the_payment.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_BCcard_and_DinaCard/captures_the_payment.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=6555900000604105&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_tZeFcpRVsSW3K0","request_duration_ms":984}}' + - '{"last_request_metrics":{"request_id":"req_3z0b70bAwXWXdV","request_duration_ms":1021}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:23 GMT + - Wed, 17 Apr 2024 22:39:29 GMT Content-Type: - application/json Content-Length: - - '972' + - '1008' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - '018bcb08-4576-4a14-8f46-43ab03a0574e' + - 85034cd4-c0be-46d4-9682-7dd3ebcf5da9 Original-Request: - - req_wXVrVcdxQhMIL0 + - req_belJapNFhTfYji + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_wXVrVcdxQhMIL0 + - req_belJapNFhTfYji Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQFKuuB1fWySnnKvU24OA", + "id": "pm_1P6h8XKuuB1fWySnVdMtfDOI", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989443, + "created": 1713393569, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:24 GMT + recorded_at: Wed, 17 Apr 2024 22:39:29 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDQFKuuB1fWySnnKvU24OA&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h8XKuuB1fWySnVdMtfDOI&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_wXVrVcdxQhMIL0","request_duration_ms":518}}' + - '{"last_request_metrics":{"request_id":"req_belJapNFhTfYji","request_duration_ms":455}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:24 GMT + - Wed, 17 Apr 2024 22:39:30 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - dfee5031-64c4-4e99-8ce6-0b220b9030da + - c33adf33-7e60-4ee6-b785-38eb34dcfe33 Original-Request: - - req_zxV4cyZ2mrREVu + - req_H8BuN9wUGP5BSM + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_zxV4cyZ2mrREVu + - req_H8BuN9wUGP5BSM Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQGKuuB1fWySn0oKQVAGA", + "id": "pi_3P6h8XKuuB1fWySn2MhbFPiK", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQGKuuB1fWySn0oKQVAGA_secret_Hs94QwnnRR8MutBBkxEN1l39j", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989444, + "created": 1713393569, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQFKuuB1fWySnnKvU24OA", + "payment_method": "pm_1P6h8XKuuB1fWySnVdMtfDOI", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:24 GMT + recorded_at: Wed, 17 Apr 2024 22:39:30 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQGKuuB1fWySn0oKQVAGA/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8XKuuB1fWySn2MhbFPiK/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_zxV4cyZ2mrREVu","request_duration_ms":409}}' + - '{"last_request_metrics":{"request_id":"req_H8BuN9wUGP5BSM","request_duration_ms":537}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:25 GMT + - Wed, 17 Apr 2024 22:39:31 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - bd1defd3-6015-4970-baff-e3988c547e68 + - 607660cd-97a2-4ec4-a5be-b9813e87360f Original-Request: - - req_ABH2XiOcmoluSl + - req_VfWUNSJ16yKaDM + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_ABH2XiOcmoluSl + - req_VfWUNSJ16yKaDM Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQGKuuB1fWySn0oKQVAGA", + "id": "pi_3P6h8XKuuB1fWySn2MhbFPiK", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQGKuuB1fWySn0oKQVAGA_secret_Hs94QwnnRR8MutBBkxEN1l39j", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989444, + "created": 1713393569, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQGKuuB1fWySn0Qnwq89D", + "latest_charge": "ch_3P6h8XKuuB1fWySn27vTFz5x", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQFKuuB1fWySnnKvU24OA", + "payment_method": "pm_1P6h8XKuuB1fWySnVdMtfDOI", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,29 +398,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:25 GMT + recorded_at: Wed, 17 Apr 2024 22:39:31 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQGKuuB1fWySn0oKQVAGA + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8XKuuB1fWySn2MhbFPiK body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_ABH2XiOcmoluSl","request_duration_ms":1023}}' + - '{"last_request_metrics":{"request_id":"req_VfWUNSJ16yKaDM","request_duration_ms":996}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -423,7 +430,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:25 GMT + - Wed, 17 Apr 2024 22:39:31 GMT Content-Type: - application/json Content-Length: @@ -448,10 +455,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_OC8C8bWF8YJIRP + - req_V3NhiQRMAVdhG5 Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -462,7 +475,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQGKuuB1fWySn0oKQVAGA", + "id": "pi_3P6h8XKuuB1fWySn2MhbFPiK", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -476,20 +489,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQGKuuB1fWySn0oKQVAGA_secret_Hs94QwnnRR8MutBBkxEN1l39j", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989444, + "created": 1713393569, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQGKuuB1fWySn0Qnwq89D", + "latest_charge": "ch_3P6h8XKuuB1fWySn27vTFz5x", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQFKuuB1fWySnnKvU24OA", + "payment_method": "pm_1P6h8XKuuB1fWySnVdMtfDOI", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -514,29 +527,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:25 GMT + recorded_at: Wed, 17 Apr 2024 22:39:31 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQGKuuB1fWySn0oKQVAGA/capture + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8XKuuB1fWySn2MhbFPiK/capture body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_OC8C8bWF8YJIRP","request_duration_ms":327}}' + - '{"last_request_metrics":{"request_id":"req_V3NhiQRMAVdhG5","request_duration_ms":407}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -549,7 +559,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:26 GMT + - Wed, 17 Apr 2024 22:39:32 GMT Content-Type: - application/json Content-Length: @@ -574,16 +584,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - a21ac787-8a48-46ad-891c-5d42fb6d0d30 + - 9ed1472d-bee6-44be-84b5-3295c458d1e4 Original-Request: - - req_NTYOlUxG12Sv13 + - req_Zm7KQZK83zAent + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_NTYOlUxG12Sv13 + - req_Zm7KQZK83zAent Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -594,7 +610,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQGKuuB1fWySn0oKQVAGA", + "id": "pi_3P6h8XKuuB1fWySn2MhbFPiK", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -608,20 +624,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQGKuuB1fWySn0oKQVAGA_secret_Hs94QwnnRR8MutBBkxEN1l39j", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989444, + "created": 1713393569, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQGKuuB1fWySn0Qnwq89D", + "latest_charge": "ch_3P6h8XKuuB1fWySn27vTFz5x", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQFKuuB1fWySnnKvU24OA", + "payment_method": "pm_1P6h8XKuuB1fWySnVdMtfDOI", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -646,29 +662,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:26 GMT + recorded_at: Wed, 17 Apr 2024 22:39:32 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQGKuuB1fWySn0oKQVAGA + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8XKuuB1fWySn2MhbFPiK body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_NTYOlUxG12Sv13","request_duration_ms":1103}}' + - '{"last_request_metrics":{"request_id":"req_Zm7KQZK83zAent","request_duration_ms":1124}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -681,7 +694,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:27 GMT + - Wed, 17 Apr 2024 22:39:32 GMT Content-Type: - application/json Content-Length: @@ -706,10 +719,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_5BWpnRRrXNvrhp + - req_hfwFTTxVfnyp1F Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -720,7 +739,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQGKuuB1fWySn0oKQVAGA", + "id": "pi_3P6h8XKuuB1fWySn2MhbFPiK", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -734,20 +753,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQGKuuB1fWySn0oKQVAGA_secret_Hs94QwnnRR8MutBBkxEN1l39j", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989444, + "created": 1713393569, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQGKuuB1fWySn0Qnwq89D", + "latest_charge": "ch_3P6h8XKuuB1fWySn27vTFz5x", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQFKuuB1fWySnnKvU24OA", + "payment_method": "pm_1P6h8XKuuB1fWySnVdMtfDOI", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -772,5 +791,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:27 GMT + recorded_at: Wed, 17 Apr 2024 22:39:33 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_BCcard_and_DinaCard/returns_payment_intent_id_and_does_not_raise.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_BCcard_and_DinaCard/returns_payment_intent_id_and_does_not_raise.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_BCcard_and_DinaCard/returns_payment_intent_id_and_does_not_raise.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_BCcard_and_DinaCard/returns_payment_intent_id_and_does_not_raise.yml index eca5cbade7..154c7ef553 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_BCcard_and_DinaCard/returns_payment_intent_id_and_does_not_raise.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_BCcard_and_DinaCard/returns_payment_intent_id_and_does_not_raise.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=6555900000604105&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_rJcAvoXoMBji1r","request_duration_ms":292}}' + - '{"last_request_metrics":{"request_id":"req_I3pl4WWcmSdR3t","request_duration_ms":323}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:22 GMT + - Wed, 17 Apr 2024 22:39:27 GMT Content-Type: - application/json Content-Length: - - '972' + - '1008' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - fd625c95-6881-4919-974d-cd410507c9fd + - 7e7c53f3-778d-4cf6-99b8-e9d2e323847c Original-Request: - - req_28sCyzMkY9unKl + - req_R5sPMLGXRV4s9f + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_28sCyzMkY9unKl + - req_R5sPMLGXRV4s9f Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQDKuuB1fWySnjT3Z0QJ8", + "id": "pm_1P6h8VKuuB1fWySnG6WGYjOq", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989441, + "created": 1713393567, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:22 GMT + recorded_at: Wed, 17 Apr 2024 22:39:27 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDQDKuuB1fWySnjT3Z0QJ8&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h8VKuuB1fWySnG6WGYjOq&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_28sCyzMkY9unKl","request_duration_ms":385}}' + - '{"last_request_metrics":{"request_id":"req_R5sPMLGXRV4s9f","request_duration_ms":476}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:22 GMT + - Wed, 17 Apr 2024 22:39:27 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 96c5af48-a78b-4825-8b5c-b9f12e00ac63 + - 9f4c16b6-e857-4835-a8c0-a898a480bc8d Original-Request: - - req_Or6kc44x4oSa6m + - req_oiMNzBLhwBnOq5 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_Or6kc44x4oSa6m + - req_oiMNzBLhwBnOq5 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQEKuuB1fWySn1R0L1HVI", + "id": "pi_3P6h8VKuuB1fWySn20Fo9znJ", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQEKuuB1fWySn1R0L1HVI_secret_Wo9j4JvtbYFRhhafurS1X4hm4", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989442, + "created": 1713393567, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQDKuuB1fWySnjT3Z0QJ8", + "payment_method": "pm_1P6h8VKuuB1fWySnG6WGYjOq", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:22 GMT + recorded_at: Wed, 17 Apr 2024 22:39:27 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQEKuuB1fWySn1R0L1HVI/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8VKuuB1fWySn20Fo9znJ/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_Or6kc44x4oSa6m","request_duration_ms":365}}' + - '{"last_request_metrics":{"request_id":"req_oiMNzBLhwBnOq5","request_duration_ms":509}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:23 GMT + - Wed, 17 Apr 2024 22:39:28 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - a7c055a8-f12a-44b8-883f-6b9435623067 + - f5c42d6a-7ba8-484a-9729-b77ccd7e9702 Original-Request: - - req_tZeFcpRVsSW3K0 + - req_3z0b70bAwXWXdV + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_tZeFcpRVsSW3K0 + - req_3z0b70bAwXWXdV Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQEKuuB1fWySn1R0L1HVI", + "id": "pi_3P6h8VKuuB1fWySn20Fo9znJ", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQEKuuB1fWySn1R0L1HVI_secret_Wo9j4JvtbYFRhhafurS1X4hm4", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989442, + "created": 1713393567, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQEKuuB1fWySn19jAzVQt", + "latest_charge": "ch_3P6h8VKuuB1fWySn27KfJTAK", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQDKuuB1fWySnjT3Z0QJ8", + "payment_method": "pm_1P6h8VKuuB1fWySnG6WGYjOq", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,5 +398,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:23 GMT + recorded_at: Wed, 17 Apr 2024 22:39:28 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club/captures_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club/captures_the_payment.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club/captures_the_payment.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club/captures_the_payment.yml index 5c8875b47d..fad9014f66 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club/captures_the_payment.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club/captures_the_payment.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=3056930009020004&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_DNM7HvVYElnouo","request_duration_ms":920}}' + - '{"last_request_metrics":{"request_id":"req_eMip2uJLGOAsUL","request_duration_ms":1021}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:13 GMT + - Wed, 17 Apr 2024 22:39:17 GMT Content-Type: - application/json Content-Length: - - '972' + - '1008' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 0de022eb-04e6-4f92-a43e-2320bede7c2a + - 1a4570da-468a-4b3d-89fc-5e09e5f2139f Original-Request: - - req_cu0PVMGkMKr7L9 + - req_MJFLj7xyGzTDVH + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_cu0PVMGkMKr7L9 + - req_MJFLj7xyGzTDVH Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQ4KuuB1fWySnwcBU1joN", + "id": "pm_1P6h8LKuuB1fWySnLJ1Se1NW", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989432, + "created": 1713393557, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:13 GMT + recorded_at: Wed, 17 Apr 2024 22:39:17 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDQ4KuuB1fWySnwcBU1joN&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h8LKuuB1fWySnLJ1Se1NW&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_cu0PVMGkMKr7L9","request_duration_ms":520}}' + - '{"last_request_metrics":{"request_id":"req_MJFLj7xyGzTDVH","request_duration_ms":470}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:13 GMT + - Wed, 17 Apr 2024 22:39:17 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 3356da51-cfc8-496f-8cdc-fb1ce85b43f6 + - '091a9024-bc8e-4ae1-974b-ea8c9444cb5c' Original-Request: - - req_8YtnZbyG8a1i9x + - req_fnovB9YHqPYxKh + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_8YtnZbyG8a1i9x + - req_fnovB9YHqPYxKh Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQ5KuuB1fWySn0uPfrMDN", + "id": "pi_3P6h8LKuuB1fWySn2zowFGx3", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQ5KuuB1fWySn0uPfrMDN_secret_QtTk5xnpOXq92fCY0sHmyme0T", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989433, + "created": 1713393557, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQ4KuuB1fWySnwcBU1joN", + "payment_method": "pm_1P6h8LKuuB1fWySnLJ1Se1NW", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:13 GMT + recorded_at: Wed, 17 Apr 2024 22:39:17 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQ5KuuB1fWySn0uPfrMDN/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8LKuuB1fWySn2zowFGx3/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_8YtnZbyG8a1i9x","request_duration_ms":407}}' + - '{"last_request_metrics":{"request_id":"req_fnovB9YHqPYxKh","request_duration_ms":509}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:14 GMT + - Wed, 17 Apr 2024 22:39:18 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 5ab906a5-1bd2-4ae4-868e-dbdb654d5930 + - 474e1a09-5f2b-45b0-b6ef-04074541ad2c Original-Request: - - req_esjokrc0x0UEge + - req_C7H2INDfTs3Tjy + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_esjokrc0x0UEge + - req_C7H2INDfTs3Tjy Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQ5KuuB1fWySn0uPfrMDN", + "id": "pi_3P6h8LKuuB1fWySn2zowFGx3", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQ5KuuB1fWySn0uPfrMDN_secret_QtTk5xnpOXq92fCY0sHmyme0T", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989433, + "created": 1713393557, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQ5KuuB1fWySn0vu8YiM8", + "latest_charge": "ch_3P6h8LKuuB1fWySn2JuiHUdy", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQ4KuuB1fWySnwcBU1joN", + "payment_method": "pm_1P6h8LKuuB1fWySnLJ1Se1NW", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,29 +398,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:14 GMT + recorded_at: Wed, 17 Apr 2024 22:39:18 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQ5KuuB1fWySn0uPfrMDN + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8LKuuB1fWySn2zowFGx3 body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_esjokrc0x0UEge","request_duration_ms":920}}' + - '{"last_request_metrics":{"request_id":"req_C7H2INDfTs3Tjy","request_duration_ms":1021}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -423,7 +430,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:14 GMT + - Wed, 17 Apr 2024 22:39:19 GMT Content-Type: - application/json Content-Length: @@ -448,10 +455,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_etCPYC83Jy1D6n + - req_DOVGWJrVI35T4X Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -462,7 +475,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQ5KuuB1fWySn0uPfrMDN", + "id": "pi_3P6h8LKuuB1fWySn2zowFGx3", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -476,20 +489,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQ5KuuB1fWySn0uPfrMDN_secret_QtTk5xnpOXq92fCY0sHmyme0T", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989433, + "created": 1713393557, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQ5KuuB1fWySn0vu8YiM8", + "latest_charge": "ch_3P6h8LKuuB1fWySn2JuiHUdy", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQ4KuuB1fWySnwcBU1joN", + "payment_method": "pm_1P6h8LKuuB1fWySnLJ1Se1NW", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -514,29 +527,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:14 GMT + recorded_at: Wed, 17 Apr 2024 22:39:19 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQ5KuuB1fWySn0uPfrMDN/capture + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8LKuuB1fWySn2zowFGx3/capture body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_etCPYC83Jy1D6n","request_duration_ms":301}}' + - '{"last_request_metrics":{"request_id":"req_DOVGWJrVI35T4X","request_duration_ms":407}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -549,7 +559,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:15 GMT + - Wed, 17 Apr 2024 22:39:20 GMT Content-Type: - application/json Content-Length: @@ -574,16 +584,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - f49dd782-39e1-4367-ad0f-4c61bda709be + - d900647d-2aec-4e64-98d1-f15c83461c8f Original-Request: - - req_ebD02K4d9zzZc0 + - req_PsYDkuQdjXeUiU + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_ebD02K4d9zzZc0 + - req_PsYDkuQdjXeUiU Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -594,7 +610,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQ5KuuB1fWySn0uPfrMDN", + "id": "pi_3P6h8LKuuB1fWySn2zowFGx3", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -608,20 +624,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQ5KuuB1fWySn0uPfrMDN_secret_QtTk5xnpOXq92fCY0sHmyme0T", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989433, + "created": 1713393557, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQ5KuuB1fWySn0vu8YiM8", + "latest_charge": "ch_3P6h8LKuuB1fWySn2JuiHUdy", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQ4KuuB1fWySnwcBU1joN", + "payment_method": "pm_1P6h8LKuuB1fWySnLJ1Se1NW", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -646,29 +662,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:15 GMT + recorded_at: Wed, 17 Apr 2024 22:39:20 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQ5KuuB1fWySn0uPfrMDN + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8LKuuB1fWySn2zowFGx3 body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_ebD02K4d9zzZc0","request_duration_ms":1119}}' + - '{"last_request_metrics":{"request_id":"req_PsYDkuQdjXeUiU","request_duration_ms":1129}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -681,7 +694,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:16 GMT + - Wed, 17 Apr 2024 22:39:20 GMT Content-Type: - application/json Content-Length: @@ -706,10 +719,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_lsVhEGvNG5gz6c + - req_O9M1jcSqndJOJC Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -720,7 +739,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQ5KuuB1fWySn0uPfrMDN", + "id": "pi_3P6h8LKuuB1fWySn2zowFGx3", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -734,20 +753,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQ5KuuB1fWySn0uPfrMDN_secret_QtTk5xnpOXq92fCY0sHmyme0T", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989433, + "created": 1713393557, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQ5KuuB1fWySn0vu8YiM8", + "latest_charge": "ch_3P6h8LKuuB1fWySn2JuiHUdy", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQ4KuuB1fWySnwcBU1joN", + "payment_method": "pm_1P6h8LKuuB1fWySnLJ1Se1NW", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -772,5 +791,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:16 GMT + recorded_at: Wed, 17 Apr 2024 22:39:20 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club/returns_payment_intent_id_and_does_not_raise.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club/returns_payment_intent_id_and_does_not_raise.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club/returns_payment_intent_id_and_does_not_raise.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club/returns_payment_intent_id_and_does_not_raise.yml index 22b17d7b39..8781fce420 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club/returns_payment_intent_id_and_does_not_raise.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club/returns_payment_intent_id_and_does_not_raise.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=3056930009020004&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_MGegivwuYXdKzb","request_duration_ms":282}}' + - '{"last_request_metrics":{"request_id":"req_51gEEe58VXMvAb","request_duration_ms":464}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:11 GMT + - Wed, 17 Apr 2024 22:39:15 GMT Content-Type: - application/json Content-Length: - - '972' + - '1008' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 66322438-493c-4c38-b6df-f3f0515fa586 + - 3d62fb8d-e2d2-4a85-9cbf-db3f4eefc828 Original-Request: - - req_ymA6NEUj3csFmt + - req_8nJ9m62uUKZ1BT + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_ymA6NEUj3csFmt + - req_8nJ9m62uUKZ1BT Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQ2KuuB1fWySnpPX2X2d8", + "id": "pm_1P6h8IKuuB1fWySnR0Y3X7ef", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989431, + "created": 1713393554, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:11 GMT + recorded_at: Wed, 17 Apr 2024 22:39:15 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDQ2KuuB1fWySnpPX2X2d8&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h8IKuuB1fWySnR0Y3X7ef&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_ymA6NEUj3csFmt","request_duration_ms":444}}' + - '{"last_request_metrics":{"request_id":"req_8nJ9m62uUKZ1BT","request_duration_ms":572}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:11 GMT + - Wed, 17 Apr 2024 22:39:15 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 3b9a38f6-4eec-4a1b-971e-24397fe243df + - 91901a1a-fd2b-4876-b05c-bf94c201b9f6 Original-Request: - - req_UFXyGArg2qD6Na + - req_vinBkTBwWki9qy + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_UFXyGArg2qD6Na + - req_vinBkTBwWki9qy Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQ3KuuB1fWySn1vXhjEm2", + "id": "pi_3P6h8JKuuB1fWySn2yadc0B1", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQ3KuuB1fWySn1vXhjEm2_secret_BoexzKyTKuQWNyHY2b9vBbRJU", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989431, + "created": 1713393555, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQ2KuuB1fWySnpPX2X2d8", + "payment_method": "pm_1P6h8IKuuB1fWySnR0Y3X7ef", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:11 GMT + recorded_at: Wed, 17 Apr 2024 22:39:15 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQ3KuuB1fWySn1vXhjEm2/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8JKuuB1fWySn2yadc0B1/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_UFXyGArg2qD6Na","request_duration_ms":407}}' + - '{"last_request_metrics":{"request_id":"req_vinBkTBwWki9qy","request_duration_ms":509}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:12 GMT + - Wed, 17 Apr 2024 22:39:16 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 10b98ab8-d072-4923-a330-51f4c892eb4d + - e2fe3772-c299-4588-81a1-bdad8e9b314b Original-Request: - - req_DNM7HvVYElnouo + - req_eMip2uJLGOAsUL + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_DNM7HvVYElnouo + - req_eMip2uJLGOAsUL Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQ3KuuB1fWySn1vXhjEm2", + "id": "pi_3P6h8JKuuB1fWySn2yadc0B1", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQ3KuuB1fWySn1vXhjEm2_secret_BoexzKyTKuQWNyHY2b9vBbRJU", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989431, + "created": 1713393555, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQ3KuuB1fWySn1CVsc0Hx", + "latest_charge": "ch_3P6h8JKuuB1fWySn26uIchSq", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQ2KuuB1fWySnpPX2X2d8", + "payment_method": "pm_1P6h8IKuuB1fWySnR0Y3X7ef", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,5 +398,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:12 GMT + recorded_at: Wed, 17 Apr 2024 22:39:16 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club_14-digit_card_/captures_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club_14-digit_card_/captures_the_payment.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club_14-digit_card_/captures_the_payment.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club_14-digit_card_/captures_the_payment.yml index 98a9009dd7..ed30b7c4f3 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club_14-digit_card_/captures_the_payment.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club_14-digit_card_/captures_the_payment.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=36227206271667&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_O6BIGGHZYqE7Ft","request_duration_ms":920}}' + - '{"last_request_metrics":{"request_id":"req_0ok5x8RVmzx0fI","request_duration_ms":1022}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:18 GMT + - Wed, 17 Apr 2024 22:39:23 GMT Content-Type: - application/json Content-Length: - - '972' + - '1008' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - ac54b77d-9551-480d-9fdc-2d7bb7703e26 + - bdd25ab2-01bf-4d8a-b996-790be486e8f5 Original-Request: - - req_CLlBZLTzvEjdZT + - req_aW2iJeMUdsXpdu + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_CLlBZLTzvEjdZT + - req_aW2iJeMUdsXpdu Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQAKuuB1fWySncyLcqw3f", + "id": "pm_1P6h8RKuuB1fWySnfA4I9N8P", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989438, + "created": 1713393563, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:18 GMT + recorded_at: Wed, 17 Apr 2024 22:39:23 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDQAKuuB1fWySncyLcqw3f&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h8RKuuB1fWySnfA4I9N8P&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_CLlBZLTzvEjdZT","request_duration_ms":464}}' + - '{"last_request_metrics":{"request_id":"req_aW2iJeMUdsXpdu","request_duration_ms":476}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:18 GMT + - Wed, 17 Apr 2024 22:39:23 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 91585d37-4069-4132-b394-65ff3ef803d9 + - f38730a5-9b88-41bb-af95-f3f0d1b6db51 Original-Request: - - req_3sZzL6b5kfneu7 + - req_EKgkqCB3ZJn6mK + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_3sZzL6b5kfneu7 + - req_EKgkqCB3ZJn6mK Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQAKuuB1fWySn1ur6NCq4", + "id": "pi_3P6h8RKuuB1fWySn2f9Q1nED", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQAKuuB1fWySn1ur6NCq4_secret_QRERdwW3G3XOTTEvxDLIZLP8K", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989438, + "created": 1713393563, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQAKuuB1fWySncyLcqw3f", + "payment_method": "pm_1P6h8RKuuB1fWySnfA4I9N8P", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:19 GMT + recorded_at: Wed, 17 Apr 2024 22:39:24 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQAKuuB1fWySn1ur6NCq4/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8RKuuB1fWySn2f9Q1nED/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_3sZzL6b5kfneu7","request_duration_ms":463}}' + - '{"last_request_metrics":{"request_id":"req_EKgkqCB3ZJn6mK","request_duration_ms":509}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:19 GMT + - Wed, 17 Apr 2024 22:39:24 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - eff659cf-2371-42a6-8209-1dc93cbf3c7c + - 11732f20-6777-4a68-b1a7-99963f769446 Original-Request: - - req_jRGg9gwLRx0tB5 + - req_lvzjZr0RkFNeES + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_jRGg9gwLRx0tB5 + - req_lvzjZr0RkFNeES Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQAKuuB1fWySn1ur6NCq4", + "id": "pi_3P6h8RKuuB1fWySn2f9Q1nED", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQAKuuB1fWySn1ur6NCq4_secret_QRERdwW3G3XOTTEvxDLIZLP8K", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989438, + "created": 1713393563, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQAKuuB1fWySn1ZiPgFzu", + "latest_charge": "ch_3P6h8RKuuB1fWySn2G5g1Oav", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQAKuuB1fWySncyLcqw3f", + "payment_method": "pm_1P6h8RKuuB1fWySnfA4I9N8P", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,29 +398,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:19 GMT + recorded_at: Wed, 17 Apr 2024 22:39:25 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQAKuuB1fWySn1ur6NCq4 + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8RKuuB1fWySn2f9Q1nED body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_jRGg9gwLRx0tB5","request_duration_ms":920}}' + - '{"last_request_metrics":{"request_id":"req_lvzjZr0RkFNeES","request_duration_ms":1022}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -423,7 +430,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:20 GMT + - Wed, 17 Apr 2024 22:39:25 GMT Content-Type: - application/json Content-Length: @@ -448,10 +455,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_1LKIgtLR6yNvjt + - req_mZY27L2xmuWtnA Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -462,7 +475,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQAKuuB1fWySn1ur6NCq4", + "id": "pi_3P6h8RKuuB1fWySn2f9Q1nED", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -476,20 +489,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQAKuuB1fWySn1ur6NCq4_secret_QRERdwW3G3XOTTEvxDLIZLP8K", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989438, + "created": 1713393563, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQAKuuB1fWySn1ZiPgFzu", + "latest_charge": "ch_3P6h8RKuuB1fWySn2G5g1Oav", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQAKuuB1fWySncyLcqw3f", + "payment_method": "pm_1P6h8RKuuB1fWySnfA4I9N8P", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -514,29 +527,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:20 GMT + recorded_at: Wed, 17 Apr 2024 22:39:25 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQAKuuB1fWySn1ur6NCq4/capture + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8RKuuB1fWySn2f9Q1nED/capture body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_1LKIgtLR6yNvjt","request_duration_ms":407}}' + - '{"last_request_metrics":{"request_id":"req_mZY27L2xmuWtnA","request_duration_ms":407}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -549,7 +559,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:21 GMT + - Wed, 17 Apr 2024 22:39:26 GMT Content-Type: - application/json Content-Length: @@ -574,16 +584,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 78073d50-6efc-4f36-a54e-4052751db78e + - e01d3351-bd95-4c93-82f2-f68eb2c70b77 Original-Request: - - req_JmKJPrj31DE3MG + - req_eZOI1S6A1Np124 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_JmKJPrj31DE3MG + - req_eZOI1S6A1Np124 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -594,7 +610,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQAKuuB1fWySn1ur6NCq4", + "id": "pi_3P6h8RKuuB1fWySn2f9Q1nED", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -608,20 +624,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQAKuuB1fWySn1ur6NCq4_secret_QRERdwW3G3XOTTEvxDLIZLP8K", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989438, + "created": 1713393563, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQAKuuB1fWySn1ZiPgFzu", + "latest_charge": "ch_3P6h8RKuuB1fWySn2G5g1Oav", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQAKuuB1fWySncyLcqw3f", + "payment_method": "pm_1P6h8RKuuB1fWySnfA4I9N8P", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -646,29 +662,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:21 GMT + recorded_at: Wed, 17 Apr 2024 22:39:26 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQAKuuB1fWySn1ur6NCq4 + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8RKuuB1fWySn2f9Q1nED body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_JmKJPrj31DE3MG","request_duration_ms":1031}}' + - '{"last_request_metrics":{"request_id":"req_eZOI1S6A1Np124","request_duration_ms":1125}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -681,7 +694,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:21 GMT + - Wed, 17 Apr 2024 22:39:26 GMT Content-Type: - application/json Content-Length: @@ -706,10 +719,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_rJcAvoXoMBji1r + - req_I3pl4WWcmSdR3t Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -720,7 +739,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQAKuuB1fWySn1ur6NCq4", + "id": "pi_3P6h8RKuuB1fWySn2f9Q1nED", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -734,20 +753,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQAKuuB1fWySn1ur6NCq4_secret_QRERdwW3G3XOTTEvxDLIZLP8K", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989438, + "created": 1713393563, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQAKuuB1fWySn1ZiPgFzu", + "latest_charge": "ch_3P6h8RKuuB1fWySn2G5g1Oav", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQAKuuB1fWySncyLcqw3f", + "payment_method": "pm_1P6h8RKuuB1fWySnfA4I9N8P", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -772,5 +791,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:21 GMT + recorded_at: Wed, 17 Apr 2024 22:39:26 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club_14-digit_card_/returns_payment_intent_id_and_does_not_raise.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club_14-digit_card_/returns_payment_intent_id_and_does_not_raise.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club_14-digit_card_/returns_payment_intent_id_and_does_not_raise.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club_14-digit_card_/returns_payment_intent_id_and_does_not_raise.yml index e3bd23185d..41d07ffa7f 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club_14-digit_card_/returns_payment_intent_id_and_does_not_raise.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Diners_Club_14-digit_card_/returns_payment_intent_id_and_does_not_raise.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=36227206271667&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_lsVhEGvNG5gz6c","request_duration_ms":279}}' + - '{"last_request_metrics":{"request_id":"req_O9M1jcSqndJOJC","request_duration_ms":401}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:16 GMT + - Wed, 17 Apr 2024 22:39:21 GMT Content-Type: - application/json Content-Length: - - '972' + - '1008' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - cf9df56b-f5ca-46f7-925e-39832ae36aaf + - d26715a9-307d-47f4-a2cf-bf33c3162e70 Original-Request: - - req_oiahTGP8BeNYx7 + - req_XdePxbRUWKTvjI + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_oiahTGP8BeNYx7 + - req_XdePxbRUWKTvjI Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQ8KuuB1fWySnhipbXUfG", + "id": "pm_1P6h8PKuuB1fWySnIah9Di2G", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989436, + "created": 1713393561, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:16 GMT + recorded_at: Wed, 17 Apr 2024 22:39:21 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDQ8KuuB1fWySnhipbXUfG&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h8PKuuB1fWySnIah9Di2G&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_oiahTGP8BeNYx7","request_duration_ms":425}}' + - '{"last_request_metrics":{"request_id":"req_XdePxbRUWKTvjI","request_duration_ms":494}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:17 GMT + - Wed, 17 Apr 2024 22:39:21 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 6c28ceea-67f2-4e61-9590-792a87ec71cd + - a5265d51-79c9-42f7-b184-6dbe3bd95491 Original-Request: - - req_sHZxuaWZuTjbWw + - req_s14CejPPZfzuMk + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_sHZxuaWZuTjbWw + - req_s14CejPPZfzuMk Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQ8KuuB1fWySn19PL84t8", + "id": "pi_3P6h8PKuuB1fWySn1OZkfwQc", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQ8KuuB1fWySn19PL84t8_secret_y0lyon2EbBvoMjncnmsRdEedp", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989436, + "created": 1713393561, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQ8KuuB1fWySnhipbXUfG", + "payment_method": "pm_1P6h8PKuuB1fWySnIah9Di2G", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:17 GMT + recorded_at: Wed, 17 Apr 2024 22:39:21 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQ8KuuB1fWySn19PL84t8/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8PKuuB1fWySn1OZkfwQc/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_sHZxuaWZuTjbWw","request_duration_ms":407}}' + - '{"last_request_metrics":{"request_id":"req_s14CejPPZfzuMk","request_duration_ms":509}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:17 GMT + - Wed, 17 Apr 2024 22:39:22 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 139141d9-2da1-4d7e-b155-a0d2a4209723 + - eab99991-a8d9-4da4-862a-53dba0b7e794 Original-Request: - - req_O6BIGGHZYqE7Ft + - req_0ok5x8RVmzx0fI + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_O6BIGGHZYqE7Ft + - req_0ok5x8RVmzx0fI Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQ8KuuB1fWySn19PL84t8", + "id": "pi_3P6h8PKuuB1fWySn1OZkfwQc", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQ8KuuB1fWySn19PL84t8_secret_y0lyon2EbBvoMjncnmsRdEedp", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989436, + "created": 1713393561, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQ8KuuB1fWySn1MwfMHxJ", + "latest_charge": "ch_3P6h8PKuuB1fWySn1mhyBhEE", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQ8KuuB1fWySnhipbXUfG", + "payment_method": "pm_1P6h8PKuuB1fWySnIah9Di2G", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,5 +398,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:18 GMT + recorded_at: Wed, 17 Apr 2024 22:39:22 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover/captures_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover/captures_the_payment.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover/captures_the_payment.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover/captures_the_payment.yml index 4db06a4044..04091ae801 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover/captures_the_payment.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover/captures_the_payment.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=6011111111111117&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_mbOvR5aapJ3NaO","request_duration_ms":953}}' + - '{"last_request_metrics":{"request_id":"req_Jro1T0jxbpxK3y","request_duration_ms":1021}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:01 GMT + - Wed, 17 Apr 2024 22:39:03 GMT Content-Type: - application/json Content-Length: - - '972' + - '1008' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 633653b4-d4f2-4969-8f61-1cf1a4287b40 + - fddb89f6-f813-470a-9e0a-0f81b7f597c9 Original-Request: - - req_PrGZETRXV8WTp1 + - req_DSWHOaVc1vEG2s + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_PrGZETRXV8WTp1 + - req_DSWHOaVc1vEG2s Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDPtKuuB1fWySndDlDBRsD", + "id": "pm_1P6h87KuuB1fWySn9X4uRzJb", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989421, + "created": 1713393543, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:02 GMT + recorded_at: Wed, 17 Apr 2024 22:39:03 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDPtKuuB1fWySndDlDBRsD&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h87KuuB1fWySn9X4uRzJb&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_PrGZETRXV8WTp1","request_duration_ms":403}}' + - '{"last_request_metrics":{"request_id":"req_DSWHOaVc1vEG2s","request_duration_ms":568}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:02 GMT + - Wed, 17 Apr 2024 22:39:04 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - abba7407-2300-4dcb-b0cd-ed8a70921fe9 + - fb05d59c-5b57-4ff2-9698-8b86e8804653 Original-Request: - - req_Ng7M8XbwdcLcUQ + - req_j8c27KKn1Qvu5O + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_Ng7M8XbwdcLcUQ + - req_j8c27KKn1Qvu5O Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPuKuuB1fWySn0cM1j98P", + "id": "pi_3P6h87KuuB1fWySn2axL111t", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPuKuuB1fWySn0cM1j98P_secret_eU0pTFza6fNDZbAvBLHUAP5Ba", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989422, + "created": 1713393543, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPtKuuB1fWySndDlDBRsD", + "payment_method": "pm_1P6h87KuuB1fWySn9X4uRzJb", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:02 GMT + recorded_at: Wed, 17 Apr 2024 22:39:04 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPuKuuB1fWySn0cM1j98P/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h87KuuB1fWySn2axL111t/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_Ng7M8XbwdcLcUQ","request_duration_ms":426}}' + - '{"last_request_metrics":{"request_id":"req_j8c27KKn1Qvu5O","request_duration_ms":509}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:03 GMT + - Wed, 17 Apr 2024 22:39:05 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - eafcafe1-3702-4569-8fdd-96f99627c2be + - 6de1b6ae-ab05-4390-9a15-b24623b2d1ab Original-Request: - - req_Spk8SQxuKT48oA + - req_qoa8w5ai6YeE1N + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_Spk8SQxuKT48oA + - req_qoa8w5ai6YeE1N Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPuKuuB1fWySn0cM1j98P", + "id": "pi_3P6h87KuuB1fWySn2axL111t", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPuKuuB1fWySn0cM1j98P_secret_eU0pTFza6fNDZbAvBLHUAP5Ba", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989422, + "created": 1713393543, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPuKuuB1fWySn0UIAWPl3", + "latest_charge": "ch_3P6h87KuuB1fWySn2262lqw1", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPtKuuB1fWySndDlDBRsD", + "payment_method": "pm_1P6h87KuuB1fWySn9X4uRzJb", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,29 +398,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:03 GMT + recorded_at: Wed, 17 Apr 2024 22:39:05 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPuKuuB1fWySn0cM1j98P + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h87KuuB1fWySn2axL111t body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_Spk8SQxuKT48oA","request_duration_ms":1010}}' + - '{"last_request_metrics":{"request_id":"req_qoa8w5ai6YeE1N","request_duration_ms":1021}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -423,7 +430,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:03 GMT + - Wed, 17 Apr 2024 22:39:05 GMT Content-Type: - application/json Content-Length: @@ -448,10 +455,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_VUhTIWfwzrIFyB + - req_qNYhyui7rxxXIa Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -462,7 +475,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPuKuuB1fWySn0cM1j98P", + "id": "pi_3P6h87KuuB1fWySn2axL111t", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -476,20 +489,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPuKuuB1fWySn0cM1j98P_secret_eU0pTFza6fNDZbAvBLHUAP5Ba", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989422, + "created": 1713393543, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPuKuuB1fWySn0UIAWPl3", + "latest_charge": "ch_3P6h87KuuB1fWySn2262lqw1", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPtKuuB1fWySndDlDBRsD", + "payment_method": "pm_1P6h87KuuB1fWySn9X4uRzJb", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -514,29 +527,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:03 GMT + recorded_at: Wed, 17 Apr 2024 22:39:05 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPuKuuB1fWySn0cM1j98P/capture + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h87KuuB1fWySn2axL111t/capture body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_VUhTIWfwzrIFyB","request_duration_ms":285}}' + - '{"last_request_metrics":{"request_id":"req_qNYhyui7rxxXIa","request_duration_ms":407}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -549,7 +559,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:04 GMT + - Wed, 17 Apr 2024 22:39:06 GMT Content-Type: - application/json Content-Length: @@ -574,16 +584,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - efc84f40-7361-4b70-9af9-4fe690d85c7c + - 9d88bb19-5593-4165-ab78-67d0c09ab47a Original-Request: - - req_tMRzvBSlH9iCaQ + - req_RqO941hfsyaP41 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_tMRzvBSlH9iCaQ + - req_RqO941hfsyaP41 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -594,7 +610,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPuKuuB1fWySn0cM1j98P", + "id": "pi_3P6h87KuuB1fWySn2axL111t", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -608,20 +624,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPuKuuB1fWySn0cM1j98P_secret_eU0pTFza6fNDZbAvBLHUAP5Ba", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989422, + "created": 1713393543, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPuKuuB1fWySn0UIAWPl3", + "latest_charge": "ch_3P6h87KuuB1fWySn2262lqw1", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPtKuuB1fWySndDlDBRsD", + "payment_method": "pm_1P6h87KuuB1fWySn9X4uRzJb", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -646,29 +662,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:04 GMT + recorded_at: Wed, 17 Apr 2024 22:39:06 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPuKuuB1fWySn0cM1j98P + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h87KuuB1fWySn2axL111t body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_tMRzvBSlH9iCaQ","request_duration_ms":1056}}' + - '{"last_request_metrics":{"request_id":"req_RqO941hfsyaP41","request_duration_ms":1021}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -681,7 +694,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:05 GMT + - Wed, 17 Apr 2024 22:39:07 GMT Content-Type: - application/json Content-Length: @@ -706,10 +719,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_rU4ebyaM4vlnhO + - req_Ig3AJuIzfGoNOE Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -720,7 +739,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPuKuuB1fWySn0cM1j98P", + "id": "pi_3P6h87KuuB1fWySn2axL111t", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -734,20 +753,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPuKuuB1fWySn0cM1j98P_secret_eU0pTFza6fNDZbAvBLHUAP5Ba", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989422, + "created": 1713393543, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPuKuuB1fWySn0UIAWPl3", + "latest_charge": "ch_3P6h87KuuB1fWySn2262lqw1", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPtKuuB1fWySndDlDBRsD", + "payment_method": "pm_1P6h87KuuB1fWySn9X4uRzJb", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -772,5 +791,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:05 GMT + recorded_at: Wed, 17 Apr 2024 22:39:07 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover/returns_payment_intent_id_and_does_not_raise.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover/returns_payment_intent_id_and_does_not_raise.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover/returns_payment_intent_id_and_does_not_raise.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover/returns_payment_intent_id_and_does_not_raise.yml index d1c5dc38f6..b3ec3daf51 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover/returns_payment_intent_id_and_does_not_raise.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover/returns_payment_intent_id_and_does_not_raise.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=6011111111111117&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_7fzqt4GnMNoHlB","request_duration_ms":0}}' + - '{"last_request_metrics":{"request_id":"req_lW3Bslok4Lawnx","request_duration_ms":0}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:00 GMT + - Wed, 17 Apr 2024 22:39:01 GMT Content-Type: - application/json Content-Length: - - '972' + - '1008' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - eac5de8d-3466-45b7-91d5-3cce04e18853 + - e67d2503-043f-45aa-bc19-c5cbf2448460 Original-Request: - - req_Q8d6qd9eS8JzzS + - req_1C24OBfM43wStd + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_Q8d6qd9eS8JzzS + - req_1C24OBfM43wStd Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDPrKuuB1fWySn9uKX6THn", + "id": "pm_1P6h85KuuB1fWySnyP9ccuXz", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989420, + "created": 1713393541, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:00 GMT + recorded_at: Wed, 17 Apr 2024 22:39:01 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDPrKuuB1fWySn9uKX6THn&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h85KuuB1fWySnyP9ccuXz&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_Q8d6qd9eS8JzzS","request_duration_ms":483}}' + - '{"last_request_metrics":{"request_id":"req_1C24OBfM43wStd","request_duration_ms":724}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:00 GMT + - Wed, 17 Apr 2024 22:39:01 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 70237fb8-ba22-4728-944f-ac09cf4c7c02 + - 1750454d-cbef-4b4b-9948-a0a8d667c377 Original-Request: - - req_Six1hPDufOMeOo + - req_K1co9pzQLmxWV0 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_Six1hPDufOMeOo + - req_K1co9pzQLmxWV0 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPsKuuB1fWySn1u1kWlgx", + "id": "pi_3P6h85KuuB1fWySn0Vn41J29", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPsKuuB1fWySn1u1kWlgx_secret_aI9howHMxkGDjou2oA0BSs41T", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989420, + "created": 1713393541, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPrKuuB1fWySn9uKX6THn", + "payment_method": "pm_1P6h85KuuB1fWySnyP9ccuXz", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:00 GMT + recorded_at: Wed, 17 Apr 2024 22:39:01 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPsKuuB1fWySn1u1kWlgx/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h85KuuB1fWySn0Vn41J29/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_Six1hPDufOMeOo","request_duration_ms":365}}' + - '{"last_request_metrics":{"request_id":"req_K1co9pzQLmxWV0","request_duration_ms":509}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:01 GMT + - Wed, 17 Apr 2024 22:39:02 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - ad97066b-b375-4f07-8807-8cd2e36cb902 + - 69edc941-3f42-413c-b67b-34babe4bef61 Original-Request: - - req_mbOvR5aapJ3NaO + - req_Jro1T0jxbpxK3y + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_mbOvR5aapJ3NaO + - req_Jro1T0jxbpxK3y Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPsKuuB1fWySn1u1kWlgx", + "id": "pi_3P6h85KuuB1fWySn0Vn41J29", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPsKuuB1fWySn1u1kWlgx_secret_aI9howHMxkGDjou2oA0BSs41T", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989420, + "created": 1713393541, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPsKuuB1fWySn1TBrVmW4", + "latest_charge": "ch_3P6h85KuuB1fWySn07C9hnvW", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPrKuuB1fWySn9uKX6THn", + "payment_method": "pm_1P6h85KuuB1fWySnyP9ccuXz", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,5 +398,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:01 GMT + recorded_at: Wed, 17 Apr 2024 22:39:02 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover_debit_/captures_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover_debit_/captures_the_payment.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover_debit_/captures_the_payment.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover_debit_/captures_the_payment.yml index bf7c05e570..8d8991e463 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover_debit_/captures_the_payment.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover_debit_/captures_the_payment.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=6011981111111113&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_Dgw7KZdptTpjUJ","request_duration_ms":1023}}' + - '{"last_request_metrics":{"request_id":"req_wY4B9jGNDMtMfn","request_duration_ms":1025}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:07 GMT + - Wed, 17 Apr 2024 22:39:10 GMT Content-Type: - application/json Content-Length: - - '971' + - '1007' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - b1fbde25-2de2-4a61-ac8a-0f301834b64f + - 2241cd18-8e05-445c-974e-8415a457fa84 Original-Request: - - req_pfcwyTzmeuRe1K + - req_4IP4EqUc5hGbSe + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_pfcwyTzmeuRe1K + - req_4IP4EqUc5hGbSe Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDPzKuuB1fWySnTHfcHvmJ", + "id": "pm_1P6h8EKuuB1fWySnyWld9oNi", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989427, + "created": 1713393550, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:07 GMT + recorded_at: Wed, 17 Apr 2024 22:39:10 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDPzKuuB1fWySnTHfcHvmJ&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h8EKuuB1fWySnyWld9oNi&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_pfcwyTzmeuRe1K","request_duration_ms":524}}' + - '{"last_request_metrics":{"request_id":"req_4IP4EqUc5hGbSe","request_duration_ms":475}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:08 GMT + - Wed, 17 Apr 2024 22:39:11 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - ad695fb6-2111-4f90-ac8e-ce23b6e4345f + - 4f2f7788-7139-4924-b357-4daa3a479fa8 Original-Request: - - req_FvwAZlAKZCfj8W + - req_pv5d4X4q5cn45x + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_FvwAZlAKZCfj8W + - req_pv5d4X4q5cn45x Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPzKuuB1fWySn2CAHvA4g", + "id": "pi_3P6h8EKuuB1fWySn2pZzJXzz", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPzKuuB1fWySn2CAHvA4g_secret_0iLFI6356UJlYn0cyjwX1dZv5", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989427, + "created": 1713393550, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPzKuuB1fWySnTHfcHvmJ", + "payment_method": "pm_1P6h8EKuuB1fWySnyWld9oNi", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:08 GMT + recorded_at: Wed, 17 Apr 2024 22:39:11 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPzKuuB1fWySn2CAHvA4g/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8EKuuB1fWySn2pZzJXzz/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_FvwAZlAKZCfj8W","request_duration_ms":408}}' + - '{"last_request_metrics":{"request_id":"req_pv5d4X4q5cn45x","request_duration_ms":578}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:09 GMT + - Wed, 17 Apr 2024 22:39:12 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 0e4cf2e9-42ee-42ce-822c-5a863ecb687f + - fee95263-7a25-4762-8fe4-86e1a87bbfe9 Original-Request: - - req_4BfQTarnpwMaLW + - req_YP4sNK7buFgJiP + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_4BfQTarnpwMaLW + - req_YP4sNK7buFgJiP Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPzKuuB1fWySn2CAHvA4g", + "id": "pi_3P6h8EKuuB1fWySn2pZzJXzz", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPzKuuB1fWySn2CAHvA4g_secret_0iLFI6356UJlYn0cyjwX1dZv5", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989427, + "created": 1713393550, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPzKuuB1fWySn2deELRUy", + "latest_charge": "ch_3P6h8EKuuB1fWySn24dbBR1i", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPzKuuB1fWySnTHfcHvmJ", + "payment_method": "pm_1P6h8EKuuB1fWySnyWld9oNi", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,29 +398,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:09 GMT + recorded_at: Wed, 17 Apr 2024 22:39:12 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPzKuuB1fWySn2CAHvA4g + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8EKuuB1fWySn2pZzJXzz body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_4BfQTarnpwMaLW","request_duration_ms":1025}}' + - '{"last_request_metrics":{"request_id":"req_YP4sNK7buFgJiP","request_duration_ms":1226}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -423,7 +430,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:09 GMT + - Wed, 17 Apr 2024 22:39:12 GMT Content-Type: - application/json Content-Length: @@ -448,10 +455,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_wvJ3XApBvm5fzF + - req_tM97ZW0ucJ8jxO Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -462,7 +475,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPzKuuB1fWySn2CAHvA4g", + "id": "pi_3P6h8EKuuB1fWySn2pZzJXzz", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -476,20 +489,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPzKuuB1fWySn2CAHvA4g_secret_0iLFI6356UJlYn0cyjwX1dZv5", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989427, + "created": 1713393550, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPzKuuB1fWySn2deELRUy", + "latest_charge": "ch_3P6h8EKuuB1fWySn24dbBR1i", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPzKuuB1fWySnTHfcHvmJ", + "payment_method": "pm_1P6h8EKuuB1fWySnyWld9oNi", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -514,29 +527,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:09 GMT + recorded_at: Wed, 17 Apr 2024 22:39:12 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPzKuuB1fWySn2CAHvA4g/capture + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8EKuuB1fWySn2pZzJXzz/capture body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_wvJ3XApBvm5fzF","request_duration_ms":291}}' + - '{"last_request_metrics":{"request_id":"req_tM97ZW0ucJ8jxO","request_duration_ms":407}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -549,7 +559,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:10 GMT + - Wed, 17 Apr 2024 22:39:14 GMT Content-Type: - application/json Content-Length: @@ -574,16 +584,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - f2263d53-c5f9-43fe-9f6f-8b718e51ceba + - a04cd255-ba11-4624-a52a-555c3b4fc020 Original-Request: - - req_D3bWNr9qdG54k9 + - req_Sy7n2RgT7nbSAm + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_D3bWNr9qdG54k9 + - req_Sy7n2RgT7nbSAm Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -594,7 +610,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPzKuuB1fWySn2CAHvA4g", + "id": "pi_3P6h8EKuuB1fWySn2pZzJXzz", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -608,20 +624,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPzKuuB1fWySn2CAHvA4g_secret_0iLFI6356UJlYn0cyjwX1dZv5", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989427, + "created": 1713393550, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPzKuuB1fWySn2deELRUy", + "latest_charge": "ch_3P6h8EKuuB1fWySn24dbBR1i", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPzKuuB1fWySnTHfcHvmJ", + "payment_method": "pm_1P6h8EKuuB1fWySnyWld9oNi", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -646,29 +662,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:10 GMT + recorded_at: Wed, 17 Apr 2024 22:39:14 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPzKuuB1fWySn2CAHvA4g + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8EKuuB1fWySn2pZzJXzz body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_D3bWNr9qdG54k9","request_duration_ms":1011}}' + - '{"last_request_metrics":{"request_id":"req_Sy7n2RgT7nbSAm","request_duration_ms":1168}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -681,7 +694,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:10 GMT + - Wed, 17 Apr 2024 22:39:14 GMT Content-Type: - application/json Content-Length: @@ -706,10 +719,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_MGegivwuYXdKzb + - req_51gEEe58VXMvAb Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -720,7 +739,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPzKuuB1fWySn2CAHvA4g", + "id": "pi_3P6h8EKuuB1fWySn2pZzJXzz", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -734,20 +753,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPzKuuB1fWySn2CAHvA4g_secret_0iLFI6356UJlYn0cyjwX1dZv5", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989427, + "created": 1713393550, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPzKuuB1fWySn2deELRUy", + "latest_charge": "ch_3P6h8EKuuB1fWySn24dbBR1i", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPzKuuB1fWySnTHfcHvmJ", + "payment_method": "pm_1P6h8EKuuB1fWySnyWld9oNi", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -772,5 +791,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:10 GMT + recorded_at: Wed, 17 Apr 2024 22:39:14 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover_debit_/returns_payment_intent_id_and_does_not_raise.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover_debit_/returns_payment_intent_id_and_does_not_raise.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover_debit_/returns_payment_intent_id_and_does_not_raise.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover_debit_/returns_payment_intent_id_and_does_not_raise.yml index cd225b039c..19a441486e 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover_debit_/returns_payment_intent_id_and_does_not_raise.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Discover_debit_/returns_payment_intent_id_and_does_not_raise.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=6011981111111113&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_rU4ebyaM4vlnhO","request_duration_ms":0}}' + - '{"last_request_metrics":{"request_id":"req_Ig3AJuIzfGoNOE","request_duration_ms":0}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:05 GMT + - Wed, 17 Apr 2024 22:39:08 GMT Content-Type: - application/json Content-Length: - - '971' + - '1007' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 60398349-56b5-47ac-b3c1-0495887e6f7d + - a3d1e9b9-1762-4194-aa0f-bcfa32002963 Original-Request: - - req_aeYcJCL07KO2Z4 + - req_JiR92vYhr5TM50 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_aeYcJCL07KO2Z4 + - req_JiR92vYhr5TM50 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDPxKuuB1fWySnMdSvjUFQ", + "id": "pm_1P6h8CKuuB1fWySnn2XdeHK9", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989425, + "created": 1713393548, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:05 GMT + recorded_at: Wed, 17 Apr 2024 22:39:08 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDPxKuuB1fWySnMdSvjUFQ&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h8CKuuB1fWySnn2XdeHK9&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_aeYcJCL07KO2Z4","request_duration_ms":503}}' + - '{"last_request_metrics":{"request_id":"req_JiR92vYhr5TM50","request_duration_ms":649}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:06 GMT + - Wed, 17 Apr 2024 22:39:08 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 991c3917-b4d0-4aa2-8f30-928b079274fc + - 9853ac76-700d-4823-90b5-5d52fc9d8635 Original-Request: - - req_uHU2k4sGsnTykx + - req_8jGk89mm1ODvyk + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_uHU2k4sGsnTykx + - req_8jGk89mm1ODvyk Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPxKuuB1fWySn17TANAg8", + "id": "pi_3P6h8CKuuB1fWySn10MMn2hm", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPxKuuB1fWySn17TANAg8_secret_ClkXoWFaSlTAmCXxXDY27wZDa", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989425, + "created": 1713393548, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPxKuuB1fWySnMdSvjUFQ", + "payment_method": "pm_1P6h8CKuuB1fWySnn2XdeHK9", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:06 GMT + recorded_at: Wed, 17 Apr 2024 22:39:09 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPxKuuB1fWySn17TANAg8/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8CKuuB1fWySn10MMn2hm/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_uHU2k4sGsnTykx","request_duration_ms":408}}' + - '{"last_request_metrics":{"request_id":"req_8jGk89mm1ODvyk","request_duration_ms":511}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:07 GMT + - Wed, 17 Apr 2024 22:39:10 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 4bd749cb-f3b2-458b-a904-9451e2d111a8 + - 6a66637e-54e0-4fc5-ac45-3720f80d9700 Original-Request: - - req_Dgw7KZdptTpjUJ + - req_wY4B9jGNDMtMfn + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_Dgw7KZdptTpjUJ + - req_wY4B9jGNDMtMfn Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPxKuuB1fWySn17TANAg8", + "id": "pi_3P6h8CKuuB1fWySn10MMn2hm", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPxKuuB1fWySn17TANAg8_secret_ClkXoWFaSlTAmCXxXDY27wZDa", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989425, + "created": 1713393548, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPxKuuB1fWySn1eYBY05z", + "latest_charge": "ch_3P6h8CKuuB1fWySn129qcNTE", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPxKuuB1fWySnMdSvjUFQ", + "payment_method": "pm_1P6h8CKuuB1fWySnn2XdeHK9", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,5 +398,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:07 GMT + recorded_at: Wed, 17 Apr 2024 22:39:10 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_JCB/captures_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_JCB/captures_the_payment.yml similarity index 73% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_JCB/captures_the_payment.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_JCB/captures_the_payment.yml index c804150343..2796157516 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_JCB/captures_the_payment.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_JCB/captures_the_payment.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=3566002020360505&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_TgxoSsKhk0j8XZ","request_duration_ms":1021}}' + - '{"last_request_metrics":{"request_id":"req_XU3WFVYNTliEXC","request_duration_ms":1021}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:29 GMT + - Wed, 17 Apr 2024 22:39:35 GMT Content-Type: - application/json Content-Length: - - '957' + - '993' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 85419c9e-2c59-438b-a0ad-28fb5f3a39f4 + - 357da29a-e2b7-43cc-bd9e-161b9d520bdc Original-Request: - - req_Re9kYebH2Ay4EZ + - req_7UNFeEXr46vI6L + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_Re9kYebH2Ay4EZ + - req_7UNFeEXr46vI6L Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQLKuuB1fWySnq95c9ISp", + "id": "pm_1P6h8dKuuB1fWySnhCOEVBGj", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989449, + "created": 1713393575, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:29 GMT + recorded_at: Wed, 17 Apr 2024 22:39:35 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDQLKuuB1fWySnq95c9ISp&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h8dKuuB1fWySnhCOEVBGj&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_Re9kYebH2Ay4EZ","request_duration_ms":523}}' + - '{"last_request_metrics":{"request_id":"req_7UNFeEXr46vI6L","request_duration_ms":548}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:30 GMT + - Wed, 17 Apr 2024 22:39:36 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 4ae18d41-7768-4104-b3d9-9cb75d76fb5b + - 4bdc362a-568f-46e0-8bf5-ead8998c4194 Original-Request: - - req_C179piDaUIQwUC + - req_rRa1jvM4JlQWMg + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_C179piDaUIQwUC + - req_rRa1jvM4JlQWMg Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQLKuuB1fWySn0ikwHg6w", + "id": "pi_3P6h8eKuuB1fWySn1b9CxAKe", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQLKuuB1fWySn0ikwHg6w_secret_0S6XsD081s7dQwsvMqud0POS3", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989449, + "created": 1713393576, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQLKuuB1fWySnq95c9ISp", + "payment_method": "pm_1P6h8dKuuB1fWySnhCOEVBGj", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:30 GMT + recorded_at: Wed, 17 Apr 2024 22:39:36 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQLKuuB1fWySn0ikwHg6w/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8eKuuB1fWySn1b9CxAKe/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_C179piDaUIQwUC","request_duration_ms":406}}' + - '{"last_request_metrics":{"request_id":"req_rRa1jvM4JlQWMg","request_duration_ms":510}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:31 GMT + - Wed, 17 Apr 2024 22:39:37 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - '0960e613-a983-4540-bf98-8c4582171048' + - a9d0ea38-5bed-4c67-a252-966681874216 Original-Request: - - req_UtT10wfogPGKi3 + - req_ENWSMHqZcGMWpK + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_UtT10wfogPGKi3 + - req_ENWSMHqZcGMWpK Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQLKuuB1fWySn0ikwHg6w", + "id": "pi_3P6h8eKuuB1fWySn1b9CxAKe", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQLKuuB1fWySn0ikwHg6w_secret_0S6XsD081s7dQwsvMqud0POS3", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989449, + "created": 1713393576, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQLKuuB1fWySn0MsSe4xK", + "latest_charge": "ch_3P6h8eKuuB1fWySn1YNttyDS", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQLKuuB1fWySnq95c9ISp", + "payment_method": "pm_1P6h8dKuuB1fWySnhCOEVBGj", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,29 +398,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:31 GMT + recorded_at: Wed, 17 Apr 2024 22:39:37 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQLKuuB1fWySn0ikwHg6w + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8eKuuB1fWySn1b9CxAKe body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_UtT10wfogPGKi3","request_duration_ms":1023}}' + - '{"last_request_metrics":{"request_id":"req_ENWSMHqZcGMWpK","request_duration_ms":1021}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -423,7 +430,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:31 GMT + - Wed, 17 Apr 2024 22:39:37 GMT Content-Type: - application/json Content-Length: @@ -448,10 +455,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_JLip9zNe4oXUxk + - req_gZ7FYVaBhGNqpm Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -462,7 +475,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQLKuuB1fWySn0ikwHg6w", + "id": "pi_3P6h8eKuuB1fWySn1b9CxAKe", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -476,20 +489,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQLKuuB1fWySn0ikwHg6w_secret_0S6XsD081s7dQwsvMqud0POS3", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989449, + "created": 1713393576, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQLKuuB1fWySn0MsSe4xK", + "latest_charge": "ch_3P6h8eKuuB1fWySn1YNttyDS", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQLKuuB1fWySnq95c9ISp", + "payment_method": "pm_1P6h8dKuuB1fWySnhCOEVBGj", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -514,29 +527,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:31 GMT + recorded_at: Wed, 17 Apr 2024 22:39:37 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQLKuuB1fWySn0ikwHg6w/capture + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8eKuuB1fWySn1b9CxAKe/capture body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_JLip9zNe4oXUxk","request_duration_ms":305}}' + - '{"last_request_metrics":{"request_id":"req_gZ7FYVaBhGNqpm","request_duration_ms":406}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -549,7 +559,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:32 GMT + - Wed, 17 Apr 2024 22:39:38 GMT Content-Type: - application/json Content-Length: @@ -574,16 +584,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 643c6452-e82c-4035-bbd5-2fd3d9eadaf6 + - 285699b9-4dbc-4957-9c63-1e566b6cc8ee Original-Request: - - req_9EC6lC8JfTm8eU + - req_x019kO3n2Z4x3w + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_9EC6lC8JfTm8eU + - req_x019kO3n2Z4x3w Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -594,7 +610,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQLKuuB1fWySn0ikwHg6w", + "id": "pi_3P6h8eKuuB1fWySn1b9CxAKe", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -608,20 +624,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQLKuuB1fWySn0ikwHg6w_secret_0S6XsD081s7dQwsvMqud0POS3", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989449, + "created": 1713393576, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQLKuuB1fWySn0MsSe4xK", + "latest_charge": "ch_3P6h8eKuuB1fWySn1YNttyDS", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQLKuuB1fWySnq95c9ISp", + "payment_method": "pm_1P6h8dKuuB1fWySnhCOEVBGj", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -646,29 +662,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:32 GMT + recorded_at: Wed, 17 Apr 2024 22:39:38 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQLKuuB1fWySn0ikwHg6w + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8eKuuB1fWySn1b9CxAKe body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_9EC6lC8JfTm8eU","request_duration_ms":1024}}' + - '{"last_request_metrics":{"request_id":"req_x019kO3n2Z4x3w","request_duration_ms":1021}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -681,7 +694,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:32 GMT + - Wed, 17 Apr 2024 22:39:39 GMT Content-Type: - application/json Content-Length: @@ -706,10 +719,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_GHcBxE2m3E4MHF + - req_e3is6LFByX27Sh Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -720,7 +739,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQLKuuB1fWySn0ikwHg6w", + "id": "pi_3P6h8eKuuB1fWySn1b9CxAKe", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -734,20 +753,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQLKuuB1fWySn0ikwHg6w_secret_0S6XsD081s7dQwsvMqud0POS3", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989449, + "created": 1713393576, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQLKuuB1fWySn0MsSe4xK", + "latest_charge": "ch_3P6h8eKuuB1fWySn1YNttyDS", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQLKuuB1fWySnq95c9ISp", + "payment_method": "pm_1P6h8dKuuB1fWySnhCOEVBGj", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -772,5 +791,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:32 GMT + recorded_at: Wed, 17 Apr 2024 22:39:39 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_JCB/returns_payment_intent_id_and_does_not_raise.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_JCB/returns_payment_intent_id_and_does_not_raise.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_JCB/returns_payment_intent_id_and_does_not_raise.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_JCB/returns_payment_intent_id_and_does_not_raise.yml index 2850c5dbb3..a8f2b95f22 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_JCB/returns_payment_intent_id_and_does_not_raise.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_JCB/returns_payment_intent_id_and_does_not_raise.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=3566002020360505&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_5BWpnRRrXNvrhp","request_duration_ms":306}}' + - '{"last_request_metrics":{"request_id":"req_hfwFTTxVfnyp1F","request_duration_ms":407}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:27 GMT + - Wed, 17 Apr 2024 22:39:33 GMT Content-Type: - application/json Content-Length: - - '957' + - '993' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 309eb341-1f8a-4791-8a5a-d6230c885b6a + - ec6ae87e-5372-4823-a3c1-048be735cbe9 Original-Request: - - req_w0mXmfVOsadqem + - req_o3NQREyRyHqUeQ + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_w0mXmfVOsadqem + - req_o3NQREyRyHqUeQ Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQJKuuB1fWySnuEJwCxRa", + "id": "pm_1P6h8bKuuB1fWySnV3EVs9rr", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989447, + "created": 1713393573, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:27 GMT + recorded_at: Wed, 17 Apr 2024 22:39:33 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDQJKuuB1fWySnuEJwCxRa&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h8bKuuB1fWySnV3EVs9rr&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_w0mXmfVOsadqem","request_duration_ms":486}}' + - '{"last_request_metrics":{"request_id":"req_o3NQREyRyHqUeQ","request_duration_ms":470}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:28 GMT + - Wed, 17 Apr 2024 22:39:33 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 065f6dd4-d011-40f2-9fd0-e1e527ee4c3b + - 7d15d187-e69f-4492-a8e7-5ab0af825e8f Original-Request: - - req_p8wvfOpGftglMi + - req_5XJ8dCbnt9VCWt + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_p8wvfOpGftglMi + - req_5XJ8dCbnt9VCWt Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQJKuuB1fWySn1Ke8NKzQ", + "id": "pi_3P6h8bKuuB1fWySn2iWXlsFV", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQJKuuB1fWySn1Ke8NKzQ_secret_h5G0x5ZcTb6rizHpE9OJl1mPa", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989447, + "created": 1713393573, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQJKuuB1fWySnuEJwCxRa", + "payment_method": "pm_1P6h8bKuuB1fWySnV3EVs9rr", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:28 GMT + recorded_at: Wed, 17 Apr 2024 22:39:34 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQJKuuB1fWySn1Ke8NKzQ/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8bKuuB1fWySn2iWXlsFV/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_p8wvfOpGftglMi","request_duration_ms":409}}' + - '{"last_request_metrics":{"request_id":"req_5XJ8dCbnt9VCWt","request_duration_ms":510}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:29 GMT + - Wed, 17 Apr 2024 22:39:34 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - '06301090-4e21-4107-9b23-f163db3a22e3' + - b3de6aaa-c28c-4574-bed6-bf885213bcc1 Original-Request: - - req_TgxoSsKhk0j8XZ + - req_XU3WFVYNTliEXC + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_TgxoSsKhk0j8XZ + - req_XU3WFVYNTliEXC Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQJKuuB1fWySn1Ke8NKzQ", + "id": "pi_3P6h8bKuuB1fWySn2iWXlsFV", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQJKuuB1fWySn1Ke8NKzQ_secret_h5G0x5ZcTb6rizHpE9OJl1mPa", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989447, + "created": 1713393573, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQJKuuB1fWySn1Qlbllmz", + "latest_charge": "ch_3P6h8bKuuB1fWySn2ZYaHWqC", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQJKuuB1fWySnuEJwCxRa", + "payment_method": "pm_1P6h8bKuuB1fWySnV3EVs9rr", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,5 +398,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:29 GMT + recorded_at: Wed, 17 Apr 2024 22:39:35 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard/captures_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard/captures_the_payment.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard/captures_the_payment.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard/captures_the_payment.yml index a7c7b5b583..f815907d41 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard/captures_the_payment.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard/captures_the_payment.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=5555555555554444&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_ZR1qeYu35Pioas","request_duration_ms":953}}' + - '{"last_request_metrics":{"request_id":"req_g8fpJ3tSDgxYPQ","request_duration_ms":1020}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:34 GMT + - Wed, 17 Apr 2024 22:38:31 GMT Content-Type: - application/json Content-Length: - - '978' + - '1014' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 441efbcb-9e30-4b22-b4a7-bc6b372a735b + - e21b93d0-027e-44c7-98c8-ea1baa84af7f Original-Request: - - req_TwftiiSeqelHPk + - req_OzvqmGMnvaWaBl + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_TwftiiSeqelHPk + - req_OzvqmGMnvaWaBl Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDPSKuuB1fWySnnAd1efXp", + "id": "pm_1P6h7bKuuB1fWySnmKTufvU0", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989394, + "created": 1713393511, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:34 GMT + recorded_at: Wed, 17 Apr 2024 22:38:32 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDPSKuuB1fWySnnAd1efXp&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h7bKuuB1fWySnmKTufvU0&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_TwftiiSeqelHPk","request_duration_ms":414}}' + - '{"last_request_metrics":{"request_id":"req_OzvqmGMnvaWaBl","request_duration_ms":560}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:35 GMT + - Wed, 17 Apr 2024 22:38:32 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - f8d7f953-f874-410e-9374-c83270d599f0 + - 4a1f364f-085d-4591-8d13-696b5b052464 Original-Request: - - req_96GXGlQgYfW0oP + - req_5I1uIn6AbfwyeA + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_96GXGlQgYfW0oP + - req_5I1uIn6AbfwyeA Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPSKuuB1fWySn2TFqlhcl", + "id": "pi_3P6h7cKuuB1fWySn2TjKl4Mh", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPSKuuB1fWySn2TFqlhcl_secret_UXZBDVcnOp2wDzeGq0uWJgLTu", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989394, + "created": 1713393512, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPSKuuB1fWySnnAd1efXp", + "payment_method": "pm_1P6h7bKuuB1fWySnmKTufvU0", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:35 GMT + recorded_at: Wed, 17 Apr 2024 22:38:32 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPSKuuB1fWySn2TFqlhcl/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7cKuuB1fWySn2TjKl4Mh/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_96GXGlQgYfW0oP","request_duration_ms":511}}' + - '{"last_request_metrics":{"request_id":"req_5I1uIn6AbfwyeA","request_duration_ms":508}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:36 GMT + - Wed, 17 Apr 2024 22:38:33 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 613a013a-838b-476e-9bb1-02b38ba2ea07 + - 6711bdc3-7014-4a10-92c5-4e6297b59d90 Original-Request: - - req_TYuG86cR6Zuvt9 + - req_qGBXUK9Cyg5bMl + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_TYuG86cR6Zuvt9 + - req_qGBXUK9Cyg5bMl Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPSKuuB1fWySn2TFqlhcl", + "id": "pi_3P6h7cKuuB1fWySn2TjKl4Mh", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPSKuuB1fWySn2TFqlhcl_secret_UXZBDVcnOp2wDzeGq0uWJgLTu", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989394, + "created": 1713393512, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPSKuuB1fWySn2Dn9p3oI", + "latest_charge": "ch_3P6h7cKuuB1fWySn2UMZdoWi", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPSKuuB1fWySnnAd1efXp", + "payment_method": "pm_1P6h7bKuuB1fWySnmKTufvU0", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,29 +398,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:36 GMT + recorded_at: Wed, 17 Apr 2024 22:38:33 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPSKuuB1fWySn2TFqlhcl + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7cKuuB1fWySn2TjKl4Mh body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_TYuG86cR6Zuvt9","request_duration_ms":974}}' + - '{"last_request_metrics":{"request_id":"req_qGBXUK9Cyg5bMl","request_duration_ms":1021}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -423,7 +430,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:36 GMT + - Wed, 17 Apr 2024 22:38:33 GMT Content-Type: - application/json Content-Length: @@ -448,10 +455,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_aPTnk76uEBlzSy + - req_c0GSQTvUz0RucZ Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -462,7 +475,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPSKuuB1fWySn2TFqlhcl", + "id": "pi_3P6h7cKuuB1fWySn2TjKl4Mh", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -476,20 +489,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPSKuuB1fWySn2TFqlhcl_secret_UXZBDVcnOp2wDzeGq0uWJgLTu", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989394, + "created": 1713393512, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPSKuuB1fWySn2Dn9p3oI", + "latest_charge": "ch_3P6h7cKuuB1fWySn2UMZdoWi", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPSKuuB1fWySnnAd1efXp", + "payment_method": "pm_1P6h7bKuuB1fWySnmKTufvU0", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -514,29 +527,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:36 GMT + recorded_at: Wed, 17 Apr 2024 22:38:33 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPSKuuB1fWySn2TFqlhcl/capture + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7cKuuB1fWySn2TjKl4Mh/capture body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_aPTnk76uEBlzSy","request_duration_ms":353}}' + - '{"last_request_metrics":{"request_id":"req_c0GSQTvUz0RucZ","request_duration_ms":406}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -549,7 +559,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:37 GMT + - Wed, 17 Apr 2024 22:38:34 GMT Content-Type: - application/json Content-Length: @@ -574,16 +584,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 399ce62d-83bf-462c-a3f2-5de89de625c8 + - 199b836c-b997-4ce4-a40d-41f209ab3e9b Original-Request: - - req_4kp28HDHoweJG2 + - req_qxbgYtm9mjH1jt + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_4kp28HDHoweJG2 + - req_qxbgYtm9mjH1jt Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -594,7 +610,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPSKuuB1fWySn2TFqlhcl", + "id": "pi_3P6h7cKuuB1fWySn2TjKl4Mh", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -608,20 +624,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPSKuuB1fWySn2TFqlhcl_secret_UXZBDVcnOp2wDzeGq0uWJgLTu", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989394, + "created": 1713393512, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPSKuuB1fWySn2Dn9p3oI", + "latest_charge": "ch_3P6h7cKuuB1fWySn2UMZdoWi", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPSKuuB1fWySnnAd1efXp", + "payment_method": "pm_1P6h7bKuuB1fWySnmKTufvU0", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -646,29 +662,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:37 GMT + recorded_at: Wed, 17 Apr 2024 22:38:35 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPSKuuB1fWySn2TFqlhcl + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7cKuuB1fWySn2TjKl4Mh body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_4kp28HDHoweJG2","request_duration_ms":924}}' + - '{"last_request_metrics":{"request_id":"req_qxbgYtm9mjH1jt","request_duration_ms":1056}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -681,7 +694,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:37 GMT + - Wed, 17 Apr 2024 22:38:35 GMT Content-Type: - application/json Content-Length: @@ -706,10 +719,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_n1gIzWXoO43DjT + - req_1TBVTn0lfprC7a Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -720,7 +739,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPSKuuB1fWySn2TFqlhcl", + "id": "pi_3P6h7cKuuB1fWySn2TjKl4Mh", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -734,20 +753,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPSKuuB1fWySn2TFqlhcl_secret_UXZBDVcnOp2wDzeGq0uWJgLTu", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989394, + "created": 1713393512, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPSKuuB1fWySn2Dn9p3oI", + "latest_charge": "ch_3P6h7cKuuB1fWySn2UMZdoWi", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPSKuuB1fWySnnAd1efXp", + "payment_method": "pm_1P6h7bKuuB1fWySnmKTufvU0", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -772,5 +791,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:37 GMT + recorded_at: Wed, 17 Apr 2024 22:38:35 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard/returns_payment_intent_id_and_does_not_raise.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard/returns_payment_intent_id_and_does_not_raise.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard/returns_payment_intent_id_and_does_not_raise.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard/returns_payment_intent_id_and_does_not_raise.yml index ecbf3f94ac..956a3491aa 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard/returns_payment_intent_id_and_does_not_raise.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard/returns_payment_intent_id_and_does_not_raise.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=5555555555554444&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_vVwW7XX2KXhG23","request_duration_ms":293}}' + - '{"last_request_metrics":{"request_id":"req_VCkHzjjHMXrfND","request_duration_ms":405}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:32 GMT + - Wed, 17 Apr 2024 22:38:29 GMT Content-Type: - application/json Content-Length: - - '978' + - '1014' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 5eacb4c2-dcc6-4737-95e2-44cfd0d07780 + - 637171ff-19eb-48b9-8401-d23a8f9e5214 Original-Request: - - req_YdVSrmIrUdY8LF + - req_McZwC6YjxsbAEP + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_YdVSrmIrUdY8LF + - req_McZwC6YjxsbAEP Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDPQKuuB1fWySnucccmTkw", + "id": "pm_1P6h7ZKuuB1fWySnxHBASqdf", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989392, + "created": 1713393509, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:32 GMT + recorded_at: Wed, 17 Apr 2024 22:38:29 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDPQKuuB1fWySnucccmTkw&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h7ZKuuB1fWySnxHBASqdf&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_YdVSrmIrUdY8LF","request_duration_ms":512}}' + - '{"last_request_metrics":{"request_id":"req_McZwC6YjxsbAEP","request_duration_ms":493}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:33 GMT + - Wed, 17 Apr 2024 22:38:30 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 56e21cbe-c4ed-42cb-a092-b2ae410d4974 + - 5a404a67-bdd7-4648-bbf3-e6fa3647c924 Original-Request: - - req_58XC4oGyyBKRcS + - req_NgaDMPUptcH1lw + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_58XC4oGyyBKRcS + - req_NgaDMPUptcH1lw Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPQKuuB1fWySn0Z7Cq1qg", + "id": "pi_3P6h7ZKuuB1fWySn0Epjo3Ys", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPQKuuB1fWySn0Z7Cq1qg_secret_1d0x7y8wSWEUkajUqBmbH5sOW", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989392, + "created": 1713393509, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPQKuuB1fWySnucccmTkw", + "payment_method": "pm_1P6h7ZKuuB1fWySnxHBASqdf", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:33 GMT + recorded_at: Wed, 17 Apr 2024 22:38:30 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPQKuuB1fWySn0Z7Cq1qg/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7ZKuuB1fWySn0Epjo3Ys/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_58XC4oGyyBKRcS","request_duration_ms":511}}' + - '{"last_request_metrics":{"request_id":"req_NgaDMPUptcH1lw","request_duration_ms":509}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:34 GMT + - Wed, 17 Apr 2024 22:38:31 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 27399a72-c310-4702-9af4-965296cbb2bc + - ddbf9dc3-4691-49dd-82d6-15ce020d7ac7 Original-Request: - - req_ZR1qeYu35Pioas + - req_g8fpJ3tSDgxYPQ + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_ZR1qeYu35Pioas + - req_g8fpJ3tSDgxYPQ Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPQKuuB1fWySn0Z7Cq1qg", + "id": "pi_3P6h7ZKuuB1fWySn0Epjo3Ys", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPQKuuB1fWySn0Z7Cq1qg_secret_1d0x7y8wSWEUkajUqBmbH5sOW", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989392, + "created": 1713393509, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPQKuuB1fWySn075ty1st", + "latest_charge": "ch_3P6h7ZKuuB1fWySn09Ti3WUV", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPQKuuB1fWySnucccmTkw", + "payment_method": "pm_1P6h7ZKuuB1fWySnxHBASqdf", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,5 +398,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:34 GMT + recorded_at: Wed, 17 Apr 2024 22:38:31 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_2-series_/captures_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_2-series_/captures_the_payment.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_2-series_/captures_the_payment.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_2-series_/captures_the_payment.yml index 2c1b1eb27c..90cd0b7c64 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_2-series_/captures_the_payment.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_2-series_/captures_the_payment.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=2223003122003222&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_BzM8ei0yJTrz5h","request_duration_ms":1023}}' + - '{"last_request_metrics":{"request_id":"req_Baoct8gPfc5IXe","request_duration_ms":1124}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:40 GMT + - Wed, 17 Apr 2024 22:38:38 GMT Content-Type: - application/json Content-Length: - - '978' + - '1014' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 15c7c64e-a78d-4dc6-880d-6a1f95c71f17 + - 155ba9ef-7af4-4b55-a1b0-b28a42a43a4a Original-Request: - - req_i4CcsJFbYdhbjH + - req_aitA9tdDrHSICN + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_i4CcsJFbYdhbjH + - req_aitA9tdDrHSICN Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDPXKuuB1fWySnSAbfNAEV", + "id": "pm_1P6h7iKuuB1fWySnJyTtWbWH", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989399, + "created": 1713393518, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:40 GMT + recorded_at: Wed, 17 Apr 2024 22:38:38 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDPXKuuB1fWySnSAbfNAEV&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h7iKuuB1fWySnJyTtWbWH&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_i4CcsJFbYdhbjH","request_duration_ms":512}}' + - '{"last_request_metrics":{"request_id":"req_aitA9tdDrHSICN","request_duration_ms":460}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:40 GMT + - Wed, 17 Apr 2024 22:38:38 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 37f85ced-6546-45a5-bc51-fccffc54b519 + - 5984f7d2-a8b3-4223-86db-64603fb29ca5 Original-Request: - - req_pizLvA1Cfs8LZl + - req_AYqcfGX1gF01Lp + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_pizLvA1Cfs8LZl + - req_AYqcfGX1gF01Lp Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPYKuuB1fWySn2D2q8fH9", + "id": "pi_3P6h7iKuuB1fWySn085HPtaw", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPYKuuB1fWySn2D2q8fH9_secret_P6wvnVFLinAHRn6PohjMG99BJ", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989400, + "created": 1713393518, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPXKuuB1fWySnSAbfNAEV", + "payment_method": "pm_1P6h7iKuuB1fWySnJyTtWbWH", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:40 GMT + recorded_at: Wed, 17 Apr 2024 22:38:39 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPYKuuB1fWySn2D2q8fH9/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7iKuuB1fWySn085HPtaw/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_pizLvA1Cfs8LZl","request_duration_ms":408}}' + - '{"last_request_metrics":{"request_id":"req_AYqcfGX1gF01Lp","request_duration_ms":508}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:41 GMT + - Wed, 17 Apr 2024 22:38:40 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 2a5e70ce-d411-4476-a09e-5526ac3cb7d6 + - c4e41b64-9dbb-4b18-9126-05c223d27f1b Original-Request: - - req_jsNbIkmubWFGA5 + - req_tN8OhC5SoBlYkK + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_jsNbIkmubWFGA5 + - req_tN8OhC5SoBlYkK Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPYKuuB1fWySn2D2q8fH9", + "id": "pi_3P6h7iKuuB1fWySn085HPtaw", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPYKuuB1fWySn2D2q8fH9_secret_P6wvnVFLinAHRn6PohjMG99BJ", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989400, + "created": 1713393518, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPYKuuB1fWySn2xUqwOYn", + "latest_charge": "ch_3P6h7iKuuB1fWySn0z4PW3rG", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPXKuuB1fWySnSAbfNAEV", + "payment_method": "pm_1P6h7iKuuB1fWySnJyTtWbWH", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,29 +398,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:41 GMT + recorded_at: Wed, 17 Apr 2024 22:38:40 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPYKuuB1fWySn2D2q8fH9 + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7iKuuB1fWySn085HPtaw body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_jsNbIkmubWFGA5","request_duration_ms":818}}' + - '{"last_request_metrics":{"request_id":"req_tN8OhC5SoBlYkK","request_duration_ms":996}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -423,7 +430,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:41 GMT + - Wed, 17 Apr 2024 22:38:40 GMT Content-Type: - application/json Content-Length: @@ -448,10 +455,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_sGkOJJ0js6QRKj + - req_hYHnMmN9ZeEqzM Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -462,7 +475,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPYKuuB1fWySn2D2q8fH9", + "id": "pi_3P6h7iKuuB1fWySn085HPtaw", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -476,20 +489,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPYKuuB1fWySn2D2q8fH9_secret_P6wvnVFLinAHRn6PohjMG99BJ", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989400, + "created": 1713393518, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPYKuuB1fWySn2xUqwOYn", + "latest_charge": "ch_3P6h7iKuuB1fWySn0z4PW3rG", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPXKuuB1fWySnSAbfNAEV", + "payment_method": "pm_1P6h7iKuuB1fWySnJyTtWbWH", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -514,29 +527,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:41 GMT + recorded_at: Wed, 17 Apr 2024 22:38:40 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPYKuuB1fWySn2D2q8fH9/capture + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7iKuuB1fWySn085HPtaw/capture body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_sGkOJJ0js6QRKj","request_duration_ms":408}}' + - '{"last_request_metrics":{"request_id":"req_hYHnMmN9ZeEqzM","request_duration_ms":433}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -549,7 +559,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:42 GMT + - Wed, 17 Apr 2024 22:38:41 GMT Content-Type: - application/json Content-Length: @@ -574,16 +584,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 41c3f090-66a2-43c1-8a95-9a63cb7a4dfd + - fae3960c-ce41-4337-ba82-f2c6b537376d Original-Request: - - req_Xroi1sMBBFrLwT + - req_fjJzgMgYlPR4DL + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_Xroi1sMBBFrLwT + - req_fjJzgMgYlPR4DL Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -594,7 +610,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPYKuuB1fWySn2D2q8fH9", + "id": "pi_3P6h7iKuuB1fWySn085HPtaw", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -608,20 +624,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPYKuuB1fWySn2D2q8fH9_secret_P6wvnVFLinAHRn6PohjMG99BJ", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989400, + "created": 1713393518, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPYKuuB1fWySn2xUqwOYn", + "latest_charge": "ch_3P6h7iKuuB1fWySn0z4PW3rG", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPXKuuB1fWySnSAbfNAEV", + "payment_method": "pm_1P6h7iKuuB1fWySnJyTtWbWH", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -646,29 +662,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:42 GMT + recorded_at: Wed, 17 Apr 2024 22:38:41 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPYKuuB1fWySn2D2q8fH9 + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7iKuuB1fWySn085HPtaw body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_Xroi1sMBBFrLwT","request_duration_ms":1022}}' + - '{"last_request_metrics":{"request_id":"req_fjJzgMgYlPR4DL","request_duration_ms":1022}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -681,7 +694,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:43 GMT + - Wed, 17 Apr 2024 22:38:41 GMT Content-Type: - application/json Content-Length: @@ -706,10 +719,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_oONEtOz4iEp6nq + - req_0gpLm2PRfuTefq Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -720,7 +739,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPYKuuB1fWySn2D2q8fH9", + "id": "pi_3P6h7iKuuB1fWySn085HPtaw", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -734,20 +753,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPYKuuB1fWySn2D2q8fH9_secret_P6wvnVFLinAHRn6PohjMG99BJ", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989400, + "created": 1713393518, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPYKuuB1fWySn2xUqwOYn", + "latest_charge": "ch_3P6h7iKuuB1fWySn0z4PW3rG", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPXKuuB1fWySnSAbfNAEV", + "payment_method": "pm_1P6h7iKuuB1fWySnJyTtWbWH", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -772,5 +791,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:43 GMT + recorded_at: Wed, 17 Apr 2024 22:38:41 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_2-series_/returns_payment_intent_id_and_does_not_raise.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_2-series_/returns_payment_intent_id_and_does_not_raise.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_2-series_/returns_payment_intent_id_and_does_not_raise.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_2-series_/returns_payment_intent_id_and_does_not_raise.yml index c80a27d548..5f0eba6cd9 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_2-series_/returns_payment_intent_id_and_does_not_raise.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_2-series_/returns_payment_intent_id_and_does_not_raise.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=2223003122003222&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_n1gIzWXoO43DjT","request_duration_ms":283}}' + - '{"last_request_metrics":{"request_id":"req_1TBVTn0lfprC7a","request_duration_ms":372}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:38 GMT + - Wed, 17 Apr 2024 22:38:35 GMT Content-Type: - application/json Content-Length: - - '978' + - '1014' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 304a8506-d0c2-453f-937e-2ca516088bd2 + - 58b3dc0d-d859-4aec-ad64-81fd829057f5 Original-Request: - - req_uGjd8T6lXh9u0j + - req_TVHZ0jBYHD52eU + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_uGjd8T6lXh9u0j + - req_TVHZ0jBYHD52eU Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDPVKuuB1fWySnKFX5meGy", + "id": "pm_1P6h7fKuuB1fWySnznMVKuJP", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989398, + "created": 1713393515, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:38 GMT + recorded_at: Wed, 17 Apr 2024 22:38:35 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDPVKuuB1fWySnKFX5meGy&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h7fKuuB1fWySnznMVKuJP&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_uGjd8T6lXh9u0j","request_duration_ms":388}}' + - '{"last_request_metrics":{"request_id":"req_TVHZ0jBYHD52eU","request_duration_ms":573}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:38 GMT + - Wed, 17 Apr 2024 22:38:36 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - fcba5caf-0498-4adc-a488-f9c0c6f43f89 + - 88b2ff41-8267-4e23-976e-14bef7f4dec3 Original-Request: - - req_aFlAGw0G16YlPI + - req_9lxpOGazNVrrTb + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_aFlAGw0G16YlPI + - req_9lxpOGazNVrrTb Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPWKuuB1fWySn0MqV0k6j", + "id": "pi_3P6h7gKuuB1fWySn1X1xIIbG", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPWKuuB1fWySn0MqV0k6j_secret_RriGL4qnVDaNlu9iOiGVQNluf", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989398, + "created": 1713393516, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPVKuuB1fWySnKFX5meGy", + "payment_method": "pm_1P6h7fKuuB1fWySnznMVKuJP", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:38 GMT + recorded_at: Wed, 17 Apr 2024 22:38:36 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPWKuuB1fWySn0MqV0k6j/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7gKuuB1fWySn1X1xIIbG/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_aFlAGw0G16YlPI","request_duration_ms":437}}' + - '{"last_request_metrics":{"request_id":"req_9lxpOGazNVrrTb","request_duration_ms":815}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:39 GMT + - Wed, 17 Apr 2024 22:38:37 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 82364cf8-345f-4eb2-990c-a41bf6b0f8f2 + - a577ba88-3c2d-4ba6-8a69-812963a05746 Original-Request: - - req_BzM8ei0yJTrz5h + - req_Baoct8gPfc5IXe + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_BzM8ei0yJTrz5h + - req_Baoct8gPfc5IXe Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPWKuuB1fWySn0MqV0k6j", + "id": "pi_3P6h7gKuuB1fWySn1X1xIIbG", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPWKuuB1fWySn0MqV0k6j_secret_RriGL4qnVDaNlu9iOiGVQNluf", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989398, + "created": 1713393516, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPWKuuB1fWySn0Z1ehcXe", + "latest_charge": "ch_3P6h7gKuuB1fWySn1yt01OWS", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPVKuuB1fWySnKFX5meGy", + "payment_method": "pm_1P6h7fKuuB1fWySnznMVKuJP", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,5 +398,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:39 GMT + recorded_at: Wed, 17 Apr 2024 22:38:37 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_debit_/captures_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_debit_/captures_the_payment.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_debit_/captures_the_payment.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_debit_/captures_the_payment.yml index 0907afedad..41427c758b 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_debit_/captures_the_payment.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_debit_/captures_the_payment.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=5200828282828210&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_pQyoKr6Sl5jbvT","request_duration_ms":1023}}' + - '{"last_request_metrics":{"request_id":"req_u0ATTx9OcSqYEk","request_duration_ms":1023}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:45 GMT + - Wed, 17 Apr 2024 22:38:44 GMT Content-Type: - application/json Content-Length: - - '977' + - '1013' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 3e2f9bcf-7883-43c9-878d-1ae925aba257 + - ea370f42-3dc3-4315-af92-6232ea741f11 Original-Request: - - req_8wmcFrEvGGiqxV + - req_z2IxgLmQP4XsOi + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_8wmcFrEvGGiqxV + - req_z2IxgLmQP4XsOi Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDPdKuuB1fWySnjADDDGAC", + "id": "pm_1P6h7oKuuB1fWySnyFTNOWm1", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989405, + "created": 1713393524, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:45 GMT + recorded_at: Wed, 17 Apr 2024 22:38:44 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDPdKuuB1fWySnjADDDGAC&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h7oKuuB1fWySnyFTNOWm1&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_8wmcFrEvGGiqxV","request_duration_ms":519}}' + - '{"last_request_metrics":{"request_id":"req_z2IxgLmQP4XsOi","request_duration_ms":509}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:46 GMT + - Wed, 17 Apr 2024 22:38:45 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - b980c1bc-c31c-486f-9b66-de6760da5e43 + - c43a598b-483e-40fb-9c30-350c1995da11 Original-Request: - - req_o8c7cn3GPA2U22 + - req_KaAaukm0qPOKiL + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_o8c7cn3GPA2U22 + - req_KaAaukm0qPOKiL Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPdKuuB1fWySn1ZJUGJCE", + "id": "pi_3P6h7oKuuB1fWySn1is54UOr", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPdKuuB1fWySn1ZJUGJCE_secret_quydSXPeZY3G6plw8pI1KFSLX", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989405, + "created": 1713393524, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPdKuuB1fWySnjADDDGAC", + "payment_method": "pm_1P6h7oKuuB1fWySnyFTNOWm1", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:46 GMT + recorded_at: Wed, 17 Apr 2024 22:38:45 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPdKuuB1fWySn1ZJUGJCE/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7oKuuB1fWySn1is54UOr/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_o8c7cn3GPA2U22","request_duration_ms":406}}' + - '{"last_request_metrics":{"request_id":"req_KaAaukm0qPOKiL","request_duration_ms":508}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:47 GMT + - Wed, 17 Apr 2024 22:38:46 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 54fdaedd-7cab-4562-aaf2-62d5adfd7413 + - 20e1d8fd-31b7-4db5-b920-727c6ec8e1a5 Original-Request: - - req_MVjUWNNpvkTqQM + - req_4fRJWIkacIhtYr + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_MVjUWNNpvkTqQM + - req_4fRJWIkacIhtYr Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPdKuuB1fWySn1ZJUGJCE", + "id": "pi_3P6h7oKuuB1fWySn1is54UOr", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPdKuuB1fWySn1ZJUGJCE_secret_quydSXPeZY3G6plw8pI1KFSLX", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989405, + "created": 1713393524, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPdKuuB1fWySn1lxmi6kd", + "latest_charge": "ch_3P6h7oKuuB1fWySn1Lmj8fEo", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPdKuuB1fWySnjADDDGAC", + "payment_method": "pm_1P6h7oKuuB1fWySnyFTNOWm1", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,29 +398,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:47 GMT + recorded_at: Wed, 17 Apr 2024 22:38:46 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPdKuuB1fWySn1ZJUGJCE + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7oKuuB1fWySn1is54UOr body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_MVjUWNNpvkTqQM","request_duration_ms":1054}}' + - '{"last_request_metrics":{"request_id":"req_4fRJWIkacIhtYr","request_duration_ms":1023}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -423,7 +430,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:47 GMT + - Wed, 17 Apr 2024 22:38:46 GMT Content-Type: - application/json Content-Length: @@ -448,10 +455,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_y1orjyGC5nZQLL + - req_lRsRRyRRsiSjey Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -462,7 +475,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPdKuuB1fWySn1ZJUGJCE", + "id": "pi_3P6h7oKuuB1fWySn1is54UOr", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -476,20 +489,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPdKuuB1fWySn1ZJUGJCE_secret_quydSXPeZY3G6plw8pI1KFSLX", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989405, + "created": 1713393524, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPdKuuB1fWySn1lxmi6kd", + "latest_charge": "ch_3P6h7oKuuB1fWySn1Lmj8fEo", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPdKuuB1fWySnjADDDGAC", + "payment_method": "pm_1P6h7oKuuB1fWySnyFTNOWm1", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -514,29 +527,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:47 GMT + recorded_at: Wed, 17 Apr 2024 22:38:46 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPdKuuB1fWySn1ZJUGJCE/capture + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7oKuuB1fWySn1is54UOr/capture body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_y1orjyGC5nZQLL","request_duration_ms":378}}' + - '{"last_request_metrics":{"request_id":"req_lRsRRyRRsiSjey","request_duration_ms":408}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -549,7 +559,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:48 GMT + - Wed, 17 Apr 2024 22:38:47 GMT Content-Type: - application/json Content-Length: @@ -574,16 +584,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 23dd61ea-6d1a-438a-992c-fda73bc85cb9 + - 15695f82-de91-43c9-9f1b-3f2df3c316e3 Original-Request: - - req_abK08zuQAQDoos + - req_xMpudJ6IknmEGY + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_abK08zuQAQDoos + - req_xMpudJ6IknmEGY Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -594,7 +610,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPdKuuB1fWySn1ZJUGJCE", + "id": "pi_3P6h7oKuuB1fWySn1is54UOr", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -608,20 +624,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPdKuuB1fWySn1ZJUGJCE_secret_quydSXPeZY3G6plw8pI1KFSLX", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989405, + "created": 1713393524, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPdKuuB1fWySn1lxmi6kd", + "latest_charge": "ch_3P6h7oKuuB1fWySn1Lmj8fEo", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPdKuuB1fWySnjADDDGAC", + "payment_method": "pm_1P6h7oKuuB1fWySnyFTNOWm1", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -646,29 +662,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:48 GMT + recorded_at: Wed, 17 Apr 2024 22:38:47 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPdKuuB1fWySn1ZJUGJCE + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7oKuuB1fWySn1is54UOr body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_abK08zuQAQDoos","request_duration_ms":1024}}' + - '{"last_request_metrics":{"request_id":"req_xMpudJ6IknmEGY","request_duration_ms":1125}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -681,7 +694,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:48 GMT + - Wed, 17 Apr 2024 22:38:48 GMT Content-Type: - application/json Content-Length: @@ -706,10 +719,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_b6xyXuz2ZK9VRi + - req_v6DoSIIwC27Nmc Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -720,7 +739,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPdKuuB1fWySn1ZJUGJCE", + "id": "pi_3P6h7oKuuB1fWySn1is54UOr", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -734,20 +753,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPdKuuB1fWySn1ZJUGJCE_secret_quydSXPeZY3G6plw8pI1KFSLX", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989405, + "created": 1713393524, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPdKuuB1fWySn1lxmi6kd", + "latest_charge": "ch_3P6h7oKuuB1fWySn1Lmj8fEo", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPdKuuB1fWySnjADDDGAC", + "payment_method": "pm_1P6h7oKuuB1fWySnyFTNOWm1", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -772,5 +791,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:48 GMT + recorded_at: Wed, 17 Apr 2024 22:38:48 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_debit_/returns_payment_intent_id_and_does_not_raise.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_debit_/returns_payment_intent_id_and_does_not_raise.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_debit_/returns_payment_intent_id_and_does_not_raise.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_debit_/returns_payment_intent_id_and_does_not_raise.yml index 6e123b7db5..ce059551c7 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_debit_/returns_payment_intent_id_and_does_not_raise.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_debit_/returns_payment_intent_id_and_does_not_raise.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=5200828282828210&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_oONEtOz4iEp6nq","request_duration_ms":306}}' + - '{"last_request_metrics":{"request_id":"req_0gpLm2PRfuTefq","request_duration_ms":408}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:43 GMT + - Wed, 17 Apr 2024 22:38:42 GMT Content-Type: - application/json Content-Length: - - '977' + - '1013' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - cd3f305d-fd9c-4c85-b82f-5a16b6ce941e + - e64e2cc4-76f2-4cd4-9918-a015bd58e3a9 Original-Request: - - req_S4OB1hM5IqHVeG + - req_Ol9XydrU5YLSvA + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_S4OB1hM5IqHVeG + - req_Ol9XydrU5YLSvA Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDPbKuuB1fWySnWPBYcl8R", + "id": "pm_1P6h7mKuuB1fWySndBLUaRTW", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989403, + "created": 1713393522, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:43 GMT + recorded_at: Wed, 17 Apr 2024 22:38:42 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDPbKuuB1fWySnWPBYcl8R&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h7mKuuB1fWySndBLUaRTW&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_S4OB1hM5IqHVeG","request_duration_ms":500}}' + - '{"last_request_metrics":{"request_id":"req_Ol9XydrU5YLSvA","request_duration_ms":491}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:44 GMT + - Wed, 17 Apr 2024 22:38:42 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 72ee4397-d437-4cfd-8c5a-5fd26760afa3 + - a4e96058-ee65-4eb9-a91c-13b93abb4871 Original-Request: - - req_3SQfb8rCSkxLiE + - req_za8Lt2fdNu3nL4 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_3SQfb8rCSkxLiE + - req_za8Lt2fdNu3nL4 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPbKuuB1fWySn2Qp5A2pZ", + "id": "pi_3P6h7mKuuB1fWySn0LrIvmS2", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPbKuuB1fWySn2Qp5A2pZ_secret_FGAEfpVDMFUmqKVVjavs5GeYj", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989403, + "created": 1713393522, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPbKuuB1fWySnWPBYcl8R", + "payment_method": "pm_1P6h7mKuuB1fWySndBLUaRTW", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:44 GMT + recorded_at: Wed, 17 Apr 2024 22:38:42 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPbKuuB1fWySn2Qp5A2pZ/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7mKuuB1fWySn0LrIvmS2/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_3SQfb8rCSkxLiE","request_duration_ms":407}}' + - '{"last_request_metrics":{"request_id":"req_za8Lt2fdNu3nL4","request_duration_ms":507}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:45 GMT + - Wed, 17 Apr 2024 22:38:43 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - dc473352-cabc-48b8-bddf-b1e8d574ec72 + - bf9ffa33-9c08-43b9-ac00-94b218b14498 Original-Request: - - req_pQyoKr6Sl5jbvT + - req_u0ATTx9OcSqYEk + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_pQyoKr6Sl5jbvT + - req_u0ATTx9OcSqYEk Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPbKuuB1fWySn2Qp5A2pZ", + "id": "pi_3P6h7mKuuB1fWySn0LrIvmS2", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPbKuuB1fWySn2Qp5A2pZ_secret_FGAEfpVDMFUmqKVVjavs5GeYj", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989403, + "created": 1713393522, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPbKuuB1fWySn2m7f4dA0", + "latest_charge": "ch_3P6h7mKuuB1fWySn0hGVmP6d", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPbKuuB1fWySnWPBYcl8R", + "payment_method": "pm_1P6h7mKuuB1fWySndBLUaRTW", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,5 +398,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:45 GMT + recorded_at: Wed, 17 Apr 2024 22:38:43 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_prepaid_/captures_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_prepaid_/captures_the_payment.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_prepaid_/captures_the_payment.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_prepaid_/captures_the_payment.yml index 7155c33406..e4ef2a590f 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_prepaid_/captures_the_payment.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_prepaid_/captures_the_payment.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=5105105105105100&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_RGtuoeBObjywXw","request_duration_ms":915}}' + - '{"last_request_metrics":{"request_id":"req_HOGc3LwxQ8bbGA","request_duration_ms":1148}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:51 GMT + - Wed, 17 Apr 2024 22:38:50 GMT Content-Type: - application/json Content-Length: - - '979' + - '1015' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 99e49ab9-d058-4701-990d-28eeef72deb6 + - 1fe1438c-841f-4f5e-a299-2fabc1d46ecf Original-Request: - - req_bA8DYVK0Igdfqu + - req_1vVVBpVly5LReT + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_bA8DYVK0Igdfqu + - req_1vVVBpVly5LReT Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDPiKuuB1fWySn09aaTtym", + "id": "pm_1P6h7uKuuB1fWySnWpeF7LMi", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989411, + "created": 1713393530, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:51 GMT + recorded_at: Wed, 17 Apr 2024 22:38:51 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDPiKuuB1fWySn09aaTtym&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h7uKuuB1fWySnWpeF7LMi&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_bA8DYVK0Igdfqu","request_duration_ms":425}}' + - '{"last_request_metrics":{"request_id":"req_1vVVBpVly5LReT","request_duration_ms":550}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:51 GMT + - Wed, 17 Apr 2024 22:38:51 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 675f2046-5a0d-43ab-8b4e-512225012f72 + - 94e711e6-c607-4fc1-9392-21269895f6be Original-Request: - - req_1paLdH5NFgkBCV + - req_TpAtg2osej6eim + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_1paLdH5NFgkBCV + - req_TpAtg2osej6eim Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPjKuuB1fWySn0YzflOmY", + "id": "pi_3P6h7vKuuB1fWySn18JZEKhK", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPjKuuB1fWySn0YzflOmY_secret_xRDKXXqUMQGEp140IeBBcuOSI", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989411, + "created": 1713393531, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPiKuuB1fWySn09aaTtym", + "payment_method": "pm_1P6h7uKuuB1fWySnWpeF7LMi", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:51 GMT + recorded_at: Wed, 17 Apr 2024 22:38:51 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPjKuuB1fWySn0YzflOmY/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7vKuuB1fWySn18JZEKhK/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_1paLdH5NFgkBCV","request_duration_ms":408}}' + - '{"last_request_metrics":{"request_id":"req_TpAtg2osej6eim","request_duration_ms":508}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:52 GMT + - Wed, 17 Apr 2024 22:38:52 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - b62a0dd2-8757-4eb2-92df-408216e983a1 + - e452b479-3f40-4c93-a412-0030ea9331a4 Original-Request: - - req_LEDnV0isajkGjj + - req_9qMGS66xdSElVa + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_LEDnV0isajkGjj + - req_9qMGS66xdSElVa Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPjKuuB1fWySn0YzflOmY", + "id": "pi_3P6h7vKuuB1fWySn18JZEKhK", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPjKuuB1fWySn0YzflOmY_secret_xRDKXXqUMQGEp140IeBBcuOSI", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989411, + "created": 1713393531, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPjKuuB1fWySn0zzkbKw5", + "latest_charge": "ch_3P6h7vKuuB1fWySn17xjSwFI", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPiKuuB1fWySn09aaTtym", + "payment_method": "pm_1P6h7uKuuB1fWySnWpeF7LMi", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,29 +398,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:52 GMT + recorded_at: Wed, 17 Apr 2024 22:38:52 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPjKuuB1fWySn0YzflOmY + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7vKuuB1fWySn18JZEKhK body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_LEDnV0isajkGjj","request_duration_ms":922}}' + - '{"last_request_metrics":{"request_id":"req_9qMGS66xdSElVa","request_duration_ms":922}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -423,7 +430,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:52 GMT + - Wed, 17 Apr 2024 22:38:52 GMT Content-Type: - application/json Content-Length: @@ -448,10 +455,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_wmGEmSsqvfEMAh + - req_SiW8OzK5f1KQ8y Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -462,7 +475,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPjKuuB1fWySn0YzflOmY", + "id": "pi_3P6h7vKuuB1fWySn18JZEKhK", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -476,20 +489,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPjKuuB1fWySn0YzflOmY_secret_xRDKXXqUMQGEp140IeBBcuOSI", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989411, + "created": 1713393531, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPjKuuB1fWySn0zzkbKw5", + "latest_charge": "ch_3P6h7vKuuB1fWySn17xjSwFI", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPiKuuB1fWySn09aaTtym", + "payment_method": "pm_1P6h7uKuuB1fWySnWpeF7LMi", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -514,29 +527,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:52 GMT + recorded_at: Wed, 17 Apr 2024 22:38:52 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPjKuuB1fWySn0YzflOmY/capture + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7vKuuB1fWySn18JZEKhK/capture body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_wmGEmSsqvfEMAh","request_duration_ms":272}}' + - '{"last_request_metrics":{"request_id":"req_SiW8OzK5f1KQ8y","request_duration_ms":407}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -549,7 +559,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:53 GMT + - Wed, 17 Apr 2024 22:38:53 GMT Content-Type: - application/json Content-Length: @@ -574,16 +584,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 91309133-1662-4a33-8620-d64fc0b54352 + - 6f7efa79-439f-4d6c-9dce-28aa175753a2 Original-Request: - - req_9YxhO7PIcIX0EC + - req_inyBfL3HezoHfX + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_9YxhO7PIcIX0EC + - req_inyBfL3HezoHfX Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -594,7 +610,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPjKuuB1fWySn0YzflOmY", + "id": "pi_3P6h7vKuuB1fWySn18JZEKhK", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -608,20 +624,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPjKuuB1fWySn0YzflOmY_secret_xRDKXXqUMQGEp140IeBBcuOSI", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989411, + "created": 1713393531, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPjKuuB1fWySn0zzkbKw5", + "latest_charge": "ch_3P6h7vKuuB1fWySn17xjSwFI", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPiKuuB1fWySn09aaTtym", + "payment_method": "pm_1P6h7uKuuB1fWySnWpeF7LMi", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -646,29 +662,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:53 GMT + recorded_at: Wed, 17 Apr 2024 22:38:53 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPjKuuB1fWySn0YzflOmY + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7vKuuB1fWySn18JZEKhK body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_9YxhO7PIcIX0EC","request_duration_ms":1055}}' + - '{"last_request_metrics":{"request_id":"req_inyBfL3HezoHfX","request_duration_ms":1022}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -681,7 +694,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:54 GMT + - Wed, 17 Apr 2024 22:38:54 GMT Content-Type: - application/json Content-Length: @@ -706,10 +719,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_EriVaYg2xAZ3G9 + - req_Op5E047dEuFump Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -720,7 +739,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPjKuuB1fWySn0YzflOmY", + "id": "pi_3P6h7vKuuB1fWySn18JZEKhK", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -734,20 +753,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPjKuuB1fWySn0YzflOmY_secret_xRDKXXqUMQGEp140IeBBcuOSI", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989411, + "created": 1713393531, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPjKuuB1fWySn0zzkbKw5", + "latest_charge": "ch_3P6h7vKuuB1fWySn17xjSwFI", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPiKuuB1fWySn09aaTtym", + "payment_method": "pm_1P6h7uKuuB1fWySnWpeF7LMi", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -772,5 +791,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:54 GMT + recorded_at: Wed, 17 Apr 2024 22:38:54 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_prepaid_/returns_payment_intent_id_and_does_not_raise.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_prepaid_/returns_payment_intent_id_and_does_not_raise.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_prepaid_/returns_payment_intent_id_and_does_not_raise.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_prepaid_/returns_payment_intent_id_and_does_not_raise.yml index 524cc9b8f2..9eecdc19bd 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_prepaid_/returns_payment_intent_id_and_does_not_raise.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Mastercard_prepaid_/returns_payment_intent_id_and_does_not_raise.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=5105105105105100&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_b6xyXuz2ZK9VRi","request_duration_ms":303}}' + - '{"last_request_metrics":{"request_id":"req_v6DoSIIwC27Nmc","request_duration_ms":353}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:49 GMT + - Wed, 17 Apr 2024 22:38:48 GMT Content-Type: - application/json Content-Length: - - '979' + - '1015' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 4a6d7836-436e-4d97-a1f1-34683242f037 + - 9c7f88f2-e81c-413f-bce1-341de7cf7292 Original-Request: - - req_TOcSJ9TZsvAkYT + - req_UdvCKCkgZIuBiZ + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_TOcSJ9TZsvAkYT + - req_UdvCKCkgZIuBiZ Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDPhKuuB1fWySnAhX5quN2", + "id": "pm_1P6h7sKuuB1fWySnWFyGsEIQ", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989409, + "created": 1713393528, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:49 GMT + recorded_at: Wed, 17 Apr 2024 22:38:48 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDPhKuuB1fWySnAhX5quN2&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h7sKuuB1fWySnWFyGsEIQ&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_TOcSJ9TZsvAkYT","request_duration_ms":430}}' + - '{"last_request_metrics":{"request_id":"req_UdvCKCkgZIuBiZ","request_duration_ms":551}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:49 GMT + - Wed, 17 Apr 2024 22:38:49 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - d409b3ac-9a97-452a-9e9a-906d8b7de764 + - 1fcf81b3-f980-4602-9b72-85370ab4d77a Original-Request: - - req_RHgISugnn7KHNC + - req_vtUgVf43aiVJ8f + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_RHgISugnn7KHNC + - req_vtUgVf43aiVJ8f Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPhKuuB1fWySn2PSVEvef", + "id": "pi_3P6h7sKuuB1fWySn0BTYrhF6", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPhKuuB1fWySn2PSVEvef_secret_w8FV1bmg0bwvcYnBOm4btcdHU", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989409, + "created": 1713393528, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPhKuuB1fWySnAhX5quN2", + "payment_method": "pm_1P6h7sKuuB1fWySnWFyGsEIQ", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:49 GMT + recorded_at: Wed, 17 Apr 2024 22:38:49 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPhKuuB1fWySn2PSVEvef/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7sKuuB1fWySn0BTYrhF6/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_RHgISugnn7KHNC","request_duration_ms":382}}' + - '{"last_request_metrics":{"request_id":"req_vtUgVf43aiVJ8f","request_duration_ms":512}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:50 GMT + - Wed, 17 Apr 2024 22:38:50 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 483ccfdb-5177-4d9d-9430-d993d0a536a1 + - b8ea7e88-797c-4cdb-aa85-3b48de057a7e Original-Request: - - req_RGtuoeBObjywXw + - req_HOGc3LwxQ8bbGA + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_RGtuoeBObjywXw + - req_HOGc3LwxQ8bbGA Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPhKuuB1fWySn2PSVEvef", + "id": "pi_3P6h7sKuuB1fWySn0BTYrhF6", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPhKuuB1fWySn2PSVEvef_secret_w8FV1bmg0bwvcYnBOm4btcdHU", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989409, + "created": 1713393528, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPhKuuB1fWySn2hmSe1a2", + "latest_charge": "ch_3P6h7sKuuB1fWySn0vJDrxH0", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPhKuuB1fWySnAhX5quN2", + "payment_method": "pm_1P6h7sKuuB1fWySnWFyGsEIQ", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,5 +398,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:50 GMT + recorded_at: Wed, 17 Apr 2024 22:38:50 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay/captures_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay/captures_the_payment.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay/captures_the_payment.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay/captures_the_payment.yml index 1af07e1a43..dbb80c2b06 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay/captures_the_payment.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay/captures_the_payment.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=6200000000000005&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_ZAU0CuJ5mJL0Pj","request_duration_ms":900}}' + - '{"last_request_metrics":{"request_id":"req_JvAWETBQMvlvuD","request_duration_ms":908}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:35 GMT + - Wed, 17 Apr 2024 22:39:41 GMT Content-Type: - application/json Content-Length: - - '973' + - '1009' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - c2103a30-6836-43b4-98a1-7d65cd0606fd + - a1bbde01-ca0d-4c26-93cd-1e4f1954f573 Original-Request: - - req_HvH87iIkUZP3e4 + - req_WbHGXVY9PjhJVD + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_HvH87iIkUZP3e4 + - req_WbHGXVY9PjhJVD Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQQKuuB1fWySn4oaD0esu", + "id": "pm_1P6h8jKuuB1fWySn9AdWGLTZ", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989454, + "created": 1713393581, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:35 GMT + recorded_at: Wed, 17 Apr 2024 22:39:41 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDQQKuuB1fWySn4oaD0esu&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h8jKuuB1fWySn9AdWGLTZ&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_HvH87iIkUZP3e4","request_duration_ms":445}}' + - '{"last_request_metrics":{"request_id":"req_WbHGXVY9PjhJVD","request_duration_ms":471}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:35 GMT + - Wed, 17 Apr 2024 22:39:42 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - c8769968-ba63-4c3d-9d41-e726d7a56eec + - 944e09dd-006c-422b-b5bb-eb6c77469cdd Original-Request: - - req_am8z9EZq9rv2e8 + - req_kSQNmUwiVuPkG4 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_am8z9EZq9rv2e8 + - req_kSQNmUwiVuPkG4 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQRKuuB1fWySn2wmf5ki5", + "id": "pi_3P6h8jKuuB1fWySn250YdCNa", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQRKuuB1fWySn2wmf5ki5_secret_tJqf1vGvoQFusKtRMx4dg148J", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989455, + "created": 1713393581, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQQKuuB1fWySn4oaD0esu", + "payment_method": "pm_1P6h8jKuuB1fWySn9AdWGLTZ", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:35 GMT + recorded_at: Wed, 17 Apr 2024 22:39:42 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQRKuuB1fWySn2wmf5ki5/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8jKuuB1fWySn250YdCNa/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_am8z9EZq9rv2e8","request_duration_ms":386}}' + - '{"last_request_metrics":{"request_id":"req_kSQNmUwiVuPkG4","request_duration_ms":512}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:36 GMT + - Wed, 17 Apr 2024 22:39:43 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 66e9fe73-bc6a-4bf0-be50-eb016a8beb7e + - 7bef0dec-19ab-4366-9d74-eb26636d7431 Original-Request: - - req_0vzRq6N7iR0nsR + - req_GIYOLCt5eqstCR + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_0vzRq6N7iR0nsR + - req_GIYOLCt5eqstCR Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQRKuuB1fWySn2wmf5ki5", + "id": "pi_3P6h8jKuuB1fWySn250YdCNa", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQRKuuB1fWySn2wmf5ki5_secret_tJqf1vGvoQFusKtRMx4dg148J", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989455, + "created": 1713393581, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQRKuuB1fWySn2hpzelst", + "latest_charge": "ch_3P6h8jKuuB1fWySn2qTroa6X", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQQKuuB1fWySn4oaD0esu", + "payment_method": "pm_1P6h8jKuuB1fWySn9AdWGLTZ", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,29 +398,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:36 GMT + recorded_at: Wed, 17 Apr 2024 22:39:43 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQRKuuB1fWySn2wmf5ki5 + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8jKuuB1fWySn250YdCNa body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_0vzRq6N7iR0nsR","request_duration_ms":877}}' + - '{"last_request_metrics":{"request_id":"req_GIYOLCt5eqstCR","request_duration_ms":918}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -423,7 +430,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:36 GMT + - Wed, 17 Apr 2024 22:39:43 GMT Content-Type: - application/json Content-Length: @@ -448,10 +455,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_TU4wX9fUZfM6Ns + - req_R7dwVAyi9FFDep Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -462,7 +475,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQRKuuB1fWySn2wmf5ki5", + "id": "pi_3P6h8jKuuB1fWySn250YdCNa", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -476,20 +489,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQRKuuB1fWySn2wmf5ki5_secret_tJqf1vGvoQFusKtRMx4dg148J", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989455, + "created": 1713393581, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQRKuuB1fWySn2hpzelst", + "latest_charge": "ch_3P6h8jKuuB1fWySn2qTroa6X", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQQKuuB1fWySn4oaD0esu", + "payment_method": "pm_1P6h8jKuuB1fWySn9AdWGLTZ", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -514,29 +527,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:36 GMT + recorded_at: Wed, 17 Apr 2024 22:39:43 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQRKuuB1fWySn2wmf5ki5/capture + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8jKuuB1fWySn250YdCNa/capture body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_TU4wX9fUZfM6Ns","request_duration_ms":296}}' + - '{"last_request_metrics":{"request_id":"req_R7dwVAyi9FFDep","request_duration_ms":406}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -549,7 +559,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:37 GMT + - Wed, 17 Apr 2024 22:39:44 GMT Content-Type: - application/json Content-Length: @@ -574,16 +584,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - f1ff2e5a-2742-4e41-80b2-7b9dc0786a32 + - 2b32b0fd-f726-4792-9a3c-55a372de1cf8 Original-Request: - - req_042wA8pQjEbC3W + - req_y6Fs9bKxfUuhaR + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_042wA8pQjEbC3W + - req_y6Fs9bKxfUuhaR Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -594,7 +610,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQRKuuB1fWySn2wmf5ki5", + "id": "pi_3P6h8jKuuB1fWySn250YdCNa", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -608,20 +624,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQRKuuB1fWySn2wmf5ki5_secret_tJqf1vGvoQFusKtRMx4dg148J", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989455, + "created": 1713393581, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQRKuuB1fWySn2hpzelst", + "latest_charge": "ch_3P6h8jKuuB1fWySn2qTroa6X", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQQKuuB1fWySn4oaD0esu", + "payment_method": "pm_1P6h8jKuuB1fWySn9AdWGLTZ", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -646,29 +662,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:37 GMT + recorded_at: Wed, 17 Apr 2024 22:39:44 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQRKuuB1fWySn2wmf5ki5 + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8jKuuB1fWySn250YdCNa body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_042wA8pQjEbC3W","request_duration_ms":997}}' + - '{"last_request_metrics":{"request_id":"req_y6Fs9bKxfUuhaR","request_duration_ms":1127}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -681,7 +694,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:37 GMT + - Wed, 17 Apr 2024 22:39:44 GMT Content-Type: - application/json Content-Length: @@ -706,10 +719,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_T7OixUoyNJo1Fj + - req_orhSEXIZyv0Rt7 Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -720,7 +739,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQRKuuB1fWySn2wmf5ki5", + "id": "pi_3P6h8jKuuB1fWySn250YdCNa", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -734,20 +753,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQRKuuB1fWySn2wmf5ki5_secret_tJqf1vGvoQFusKtRMx4dg148J", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989455, + "created": 1713393581, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQRKuuB1fWySn2hpzelst", + "latest_charge": "ch_3P6h8jKuuB1fWySn2qTroa6X", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQQKuuB1fWySn4oaD0esu", + "payment_method": "pm_1P6h8jKuuB1fWySn9AdWGLTZ", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -772,5 +791,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:37 GMT + recorded_at: Wed, 17 Apr 2024 22:39:45 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay/returns_payment_intent_id_and_does_not_raise.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay/returns_payment_intent_id_and_does_not_raise.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay/returns_payment_intent_id_and_does_not_raise.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay/returns_payment_intent_id_and_does_not_raise.yml index 86fbc890f0..08838a6fd3 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay/returns_payment_intent_id_and_does_not_raise.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay/returns_payment_intent_id_and_does_not_raise.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=6200000000000005&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_GHcBxE2m3E4MHF","request_duration_ms":304}}' + - '{"last_request_metrics":{"request_id":"req_e3is6LFByX27Sh","request_duration_ms":407}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:33 GMT + - Wed, 17 Apr 2024 22:39:39 GMT Content-Type: - application/json Content-Length: - - '973' + - '1009' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 758b2fb2-4084-4c8f-a65e-f9b44b75c7c5 + - 237c6bea-9582-4bb5-a913-6ba1de54b654 Original-Request: - - req_kujYBrSzdfiGGl + - req_tWpGVf0e6fNmZ5 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_kujYBrSzdfiGGl + - req_tWpGVf0e6fNmZ5 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQPKuuB1fWySnrDjU5QTD", + "id": "pm_1P6h8hKuuB1fWySnpRASYAEC", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989453, + "created": 1713393579, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:33 GMT + recorded_at: Wed, 17 Apr 2024 22:39:39 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDQPKuuB1fWySnrDjU5QTD&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h8hKuuB1fWySnpRASYAEC&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_kujYBrSzdfiGGl","request_duration_ms":397}}' + - '{"last_request_metrics":{"request_id":"req_tWpGVf0e6fNmZ5","request_duration_ms":492}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:33 GMT + - Wed, 17 Apr 2024 22:39:40 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 19cd878f-70b5-45fb-9f2d-c0a0b233e409 + - c7e3db0b-4311-4082-8945-e83d7b4d10bd Original-Request: - - req_08dBEKAQnWUNKO + - req_8x2G5HfJxK0KO5 + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_08dBEKAQnWUNKO + - req_8x2G5HfJxK0KO5 Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQPKuuB1fWySn278fckET", + "id": "pi_3P6h8hKuuB1fWySn2vEX8YKz", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQPKuuB1fWySn278fckET_secret_lgQmou7fOjQx6P5FdGSeYFKeW", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989453, + "created": 1713393579, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQPKuuB1fWySnrDjU5QTD", + "payment_method": "pm_1P6h8hKuuB1fWySnpRASYAEC", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:33 GMT + recorded_at: Wed, 17 Apr 2024 22:39:40 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQPKuuB1fWySn278fckET/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8hKuuB1fWySn2vEX8YKz/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_08dBEKAQnWUNKO","request_duration_ms":394}}' + - '{"last_request_metrics":{"request_id":"req_8x2G5HfJxK0KO5","request_duration_ms":417}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:34 GMT + - Wed, 17 Apr 2024 22:39:41 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 85b87685-1a28-432a-9d41-c6fc495448dd + - 2d04eaf5-4e5b-400b-81fd-5bc46e1c6c7e Original-Request: - - req_ZAU0CuJ5mJL0Pj + - req_JvAWETBQMvlvuD + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_ZAU0CuJ5mJL0Pj + - req_JvAWETBQMvlvuD Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQPKuuB1fWySn278fckET", + "id": "pi_3P6h8hKuuB1fWySn2vEX8YKz", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQPKuuB1fWySn278fckET_secret_lgQmou7fOjQx6P5FdGSeYFKeW", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989453, + "created": 1713393579, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQPKuuB1fWySn2jQ1vSy4", + "latest_charge": "ch_3P6h8hKuuB1fWySn2fdTCbTk", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQPKuuB1fWySnrDjU5QTD", + "payment_method": "pm_1P6h8hKuuB1fWySnpRASYAEC", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,5 +398,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:34 GMT + recorded_at: Wed, 17 Apr 2024 22:39:41 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay_19-digit_card_/captures_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay_19-digit_card_/captures_the_payment.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay_19-digit_card_/captures_the_payment.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay_19-digit_card_/captures_the_payment.yml index f678c47500..cb383e17ac 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay_19-digit_card_/captures_the_payment.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay_19-digit_card_/captures_the_payment.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=6205500000000000004&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_pCSOXuHEJ1Lty3","request_duration_ms":945}}' + - '{"last_request_metrics":{"request_id":"req_5M6BDrkfp88ITK","request_duration_ms":1021}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:40 GMT + - Wed, 17 Apr 2024 22:39:47 GMT Content-Type: - application/json Content-Length: - - '972' + - '1008' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 2c8c4027-04bd-4b1d-8272-a502ef2f9764 + - b8f13c2d-6b72-4bf4-9d1e-6f438a65694d Original-Request: - - req_H6m1HTr3RpQpX3 + - req_6KKK2rncrBEXzj + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_H6m1HTr3RpQpX3 + - req_6KKK2rncrBEXzj Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQWKuuB1fWySnqXb3uTnf", + "id": "pm_1P6h8pKuuB1fWySnMcLJE9qc", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989460, + "created": 1713393587, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:40 GMT + recorded_at: Wed, 17 Apr 2024 22:39:47 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDQWKuuB1fWySnqXb3uTnf&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h8pKuuB1fWySnMcLJE9qc&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_H6m1HTr3RpQpX3","request_duration_ms":477}}' + - '{"last_request_metrics":{"request_id":"req_6KKK2rncrBEXzj","request_duration_ms":477}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:40 GMT + - Wed, 17 Apr 2024 22:39:48 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - ed4c8bd8-aff5-4399-8f41-29f25b5a4351 + - 86675ad2-e66f-4fb8-a0ca-2cad53fcd12f Original-Request: - - req_Qk9UiuqGQDYo79 + - req_LTpYcCoJAvnCaa + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_Qk9UiuqGQDYo79 + - req_LTpYcCoJAvnCaa Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQWKuuB1fWySn1LGKgZyG", + "id": "pi_3P6h8pKuuB1fWySn0p9t3Nhi", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQWKuuB1fWySn1LGKgZyG_secret_7EKpqFMSaVDJjcR2HWmDPMXnz", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989460, + "created": 1713393587, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQWKuuB1fWySnqXb3uTnf", + "payment_method": "pm_1P6h8pKuuB1fWySnMcLJE9qc", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:40 GMT + recorded_at: Wed, 17 Apr 2024 22:39:48 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQWKuuB1fWySn1LGKgZyG/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8pKuuB1fWySn0p9t3Nhi/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_Qk9UiuqGQDYo79","request_duration_ms":429}}' + - '{"last_request_metrics":{"request_id":"req_LTpYcCoJAvnCaa","request_duration_ms":511}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:41 GMT + - Wed, 17 Apr 2024 22:39:49 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 16f09801-90a4-4d77-9705-37b483db2319 + - ec353a06-e37e-4ea6-b2a9-5e54bd365115 Original-Request: - - req_jtVlaOmZT3yE6a + - req_DJRhc7k9YcN7Gv + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_jtVlaOmZT3yE6a + - req_DJRhc7k9YcN7Gv Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQWKuuB1fWySn1LGKgZyG", + "id": "pi_3P6h8pKuuB1fWySn0p9t3Nhi", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQWKuuB1fWySn1LGKgZyG_secret_7EKpqFMSaVDJjcR2HWmDPMXnz", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989460, + "created": 1713393587, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQWKuuB1fWySn1jAllVER", + "latest_charge": "ch_3P6h8pKuuB1fWySn0cAJ3Nx0", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQWKuuB1fWySnqXb3uTnf", + "payment_method": "pm_1P6h8pKuuB1fWySnMcLJE9qc", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,29 +398,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:41 GMT + recorded_at: Wed, 17 Apr 2024 22:39:49 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQWKuuB1fWySn1LGKgZyG + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8pKuuB1fWySn0p9t3Nhi body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_jtVlaOmZT3yE6a","request_duration_ms":999}}' + - '{"last_request_metrics":{"request_id":"req_DJRhc7k9YcN7Gv","request_duration_ms":966}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -423,7 +430,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:42 GMT + - Wed, 17 Apr 2024 22:39:49 GMT Content-Type: - application/json Content-Length: @@ -448,10 +455,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_UYJaWKezFwM6eE + - req_es3p52W7zr7ZNm Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -462,7 +475,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQWKuuB1fWySn1LGKgZyG", + "id": "pi_3P6h8pKuuB1fWySn0p9t3Nhi", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -476,20 +489,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQWKuuB1fWySn1LGKgZyG_secret_7EKpqFMSaVDJjcR2HWmDPMXnz", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989460, + "created": 1713393587, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQWKuuB1fWySn1jAllVER", + "latest_charge": "ch_3P6h8pKuuB1fWySn0cAJ3Nx0", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQWKuuB1fWySnqXb3uTnf", + "payment_method": "pm_1P6h8pKuuB1fWySnMcLJE9qc", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -514,29 +527,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:42 GMT + recorded_at: Wed, 17 Apr 2024 22:39:49 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQWKuuB1fWySn1LGKgZyG/capture + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8pKuuB1fWySn0p9t3Nhi/capture body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_UYJaWKezFwM6eE","request_duration_ms":408}}' + - '{"last_request_metrics":{"request_id":"req_es3p52W7zr7ZNm","request_duration_ms":364}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -549,7 +559,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:43 GMT + - Wed, 17 Apr 2024 22:39:50 GMT Content-Type: - application/json Content-Length: @@ -574,16 +584,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 5bf33690-0599-4d6f-8401-741fda2bfeaf + - 165ad06c-1c87-478e-be81-8de26316faea Original-Request: - - req_ITZE8iK2P101LR + - req_taD54UO4v1MIBe + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_ITZE8iK2P101LR + - req_taD54UO4v1MIBe Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -594,7 +610,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQWKuuB1fWySn1LGKgZyG", + "id": "pi_3P6h8pKuuB1fWySn0p9t3Nhi", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -608,20 +624,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQWKuuB1fWySn1LGKgZyG_secret_7EKpqFMSaVDJjcR2HWmDPMXnz", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989460, + "created": 1713393587, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQWKuuB1fWySn1jAllVER", + "latest_charge": "ch_3P6h8pKuuB1fWySn0cAJ3Nx0", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQWKuuB1fWySnqXb3uTnf", + "payment_method": "pm_1P6h8pKuuB1fWySnMcLJE9qc", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -646,29 +662,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:43 GMT + recorded_at: Wed, 17 Apr 2024 22:39:50 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQWKuuB1fWySn1LGKgZyG + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8pKuuB1fWySn0p9t3Nhi body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_ITZE8iK2P101LR","request_duration_ms":978}}' + - '{"last_request_metrics":{"request_id":"req_taD54UO4v1MIBe","request_duration_ms":1021}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -681,7 +694,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:43 GMT + - Wed, 17 Apr 2024 22:39:50 GMT Content-Type: - application/json Content-Length: @@ -706,10 +719,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_NgVZAfvQo7sWeS + - req_zvf4CAVwSgnYlD Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -720,7 +739,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQWKuuB1fWySn1LGKgZyG", + "id": "pi_3P6h8pKuuB1fWySn0p9t3Nhi", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -734,20 +753,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQWKuuB1fWySn1LGKgZyG_secret_7EKpqFMSaVDJjcR2HWmDPMXnz", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989460, + "created": 1713393587, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQWKuuB1fWySn1jAllVER", + "latest_charge": "ch_3P6h8pKuuB1fWySn0cAJ3Nx0", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQWKuuB1fWySnqXb3uTnf", + "payment_method": "pm_1P6h8pKuuB1fWySnMcLJE9qc", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -772,5 +791,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:43 GMT + recorded_at: Wed, 17 Apr 2024 22:39:50 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay_19-digit_card_/returns_payment_intent_id_and_does_not_raise.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay_19-digit_card_/returns_payment_intent_id_and_does_not_raise.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay_19-digit_card_/returns_payment_intent_id_and_does_not_raise.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay_19-digit_card_/returns_payment_intent_id_and_does_not_raise.yml index dd5c912788..47a2a5b85c 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay_19-digit_card_/returns_payment_intent_id_and_does_not_raise.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_UnionPay_19-digit_card_/returns_payment_intent_id_and_does_not_raise.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=6205500000000000004&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_T7OixUoyNJo1Fj","request_duration_ms":307}}' + - '{"last_request_metrics":{"request_id":"req_orhSEXIZyv0Rt7","request_duration_ms":405}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:38 GMT + - Wed, 17 Apr 2024 22:39:45 GMT Content-Type: - application/json Content-Length: - - '972' + - '1008' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 12e0defd-4d7b-448b-a603-d40a899d6e06 + - ad63d10c-cb0a-4eb7-8845-89cffbb4a46c Original-Request: - - req_PzaQaKS08wTEdd + - req_5scTfSWgF8tVBm + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_PzaQaKS08wTEdd + - req_5scTfSWgF8tVBm Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQUKuuB1fWySnW8iGf3QG", + "id": "pm_1P6h8nKuuB1fWySn8lYg1dY8", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989458, + "created": 1713393585, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:38 GMT + recorded_at: Wed, 17 Apr 2024 22:39:45 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDQUKuuB1fWySnW8iGf3QG&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h8nKuuB1fWySn8lYg1dY8&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_PzaQaKS08wTEdd","request_duration_ms":468}}' + - '{"last_request_metrics":{"request_id":"req_5scTfSWgF8tVBm","request_duration_ms":496}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:38 GMT + - Wed, 17 Apr 2024 22:39:45 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - fddc7108-5766-4974-9ea6-93817017fd97 + - 92c73f49-fb31-44e6-aa4e-6da9225452ac Original-Request: - - req_qmbM8OIPFrLjLM + - req_U0ctc0agMjXrZh + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_qmbM8OIPFrLjLM + - req_U0ctc0agMjXrZh Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQUKuuB1fWySn1uMwZTvo", + "id": "pi_3P6h8nKuuB1fWySn2N7eDEQt", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQUKuuB1fWySn1uMwZTvo_secret_yK9N6hEeCCCkQ4mMOyQZFDHtA", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989458, + "created": 1713393585, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQUKuuB1fWySnW8iGf3QG", + "payment_method": "pm_1P6h8nKuuB1fWySn8lYg1dY8", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:38 GMT + recorded_at: Wed, 17 Apr 2024 22:39:46 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDQUKuuB1fWySn1uMwZTvo/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h8nKuuB1fWySn2N7eDEQt/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_qmbM8OIPFrLjLM","request_duration_ms":357}}' + - '{"last_request_metrics":{"request_id":"req_U0ctc0agMjXrZh","request_duration_ms":510}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:39 GMT + - Wed, 17 Apr 2024 22:39:46 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - d50d4d86-bfc2-4cf2-b9a1-aa3c32045ef9 + - b3a27f7f-5c71-42c5-b19d-11fd62e44765 Original-Request: - - req_pCSOXuHEJ1Lty3 + - req_5M6BDrkfp88ITK + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_pCSOXuHEJ1Lty3 + - req_5M6BDrkfp88ITK Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDQUKuuB1fWySn1uMwZTvo", + "id": "pi_3P6h8nKuuB1fWySn2N7eDEQt", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDQUKuuB1fWySn1uMwZTvo_secret_yK9N6hEeCCCkQ4mMOyQZFDHtA", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989458, + "created": 1713393585, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDQUKuuB1fWySn1aJEy8pP", + "latest_charge": "ch_3P6h8nKuuB1fWySn2N5ABsKa", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDQUKuuB1fWySnW8iGf3QG", + "payment_method": "pm_1P6h8nKuuB1fWySn8lYg1dY8", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,5 +398,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:17:39 GMT + recorded_at: Wed, 17 Apr 2024 22:39:47 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa/captures_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa/captures_the_payment.yml similarity index 73% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa/captures_the_payment.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa/captures_the_payment.yml index c7430d8bca..58a5662db9 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa/captures_the_payment.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa/captures_the_payment.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4242424242424242&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_SQJ9H6cTSPmrzQ","request_duration_ms":1023}}' + - '{"last_request_metrics":{"request_id":"req_GinJvOrjI3jPoK","request_duration_ms":1124}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:23 GMT + - Wed, 17 Apr 2024 22:38:19 GMT Content-Type: - application/json Content-Length: - - '960' + - '996' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - beda89da-19fa-4d20-9bc9-6d34e6fb0669 + - 64910d91-161c-4a0a-a7b1-027463f9f932 Original-Request: - - req_bMlF5LNTOKbc56 + - req_EfwFVjR7SzuG4N + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_bMlF5LNTOKbc56 + - req_EfwFVjR7SzuG4N Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDPGKuuB1fWySnN30FF12U", + "id": "pm_1P6h7PKuuB1fWySnpJPlGzBx", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989383, + "created": 1713393499, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:23 GMT + recorded_at: Wed, 17 Apr 2024 22:38:19 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDPGKuuB1fWySnN30FF12U&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h7PKuuB1fWySnpJPlGzBx&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_bMlF5LNTOKbc56","request_duration_ms":476}}' + - '{"last_request_metrics":{"request_id":"req_EfwFVjR7SzuG4N","request_duration_ms":470}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:23 GMT + - Wed, 17 Apr 2024 22:38:19 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 803d0b3c-5078-4cb1-bf48-328f21ae5151 + - c28f48c9-e737-4e5f-a96b-4162ca0d54e5 Original-Request: - - req_1FCkK4hbN2hqIj + - req_okNPf46lsUW0NZ + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_1FCkK4hbN2hqIj + - req_okNPf46lsUW0NZ Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPHKuuB1fWySn1Zu2T6gc", + "id": "pi_3P6h7PKuuB1fWySn2KfYVSKl", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPHKuuB1fWySn1Zu2T6gc_secret_cVXjO5jtxG8407ljJZqLFUKPn", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989383, + "created": 1713393499, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPGKuuB1fWySnN30FF12U", + "payment_method": "pm_1P6h7PKuuB1fWySnpJPlGzBx", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:23 GMT + recorded_at: Wed, 17 Apr 2024 22:38:19 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPHKuuB1fWySn1Zu2T6gc/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7PKuuB1fWySn2KfYVSKl/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_1FCkK4hbN2hqIj","request_duration_ms":415}}' + - '{"last_request_metrics":{"request_id":"req_okNPf46lsUW0NZ","request_duration_ms":583}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:24 GMT + - Wed, 17 Apr 2024 22:38:21 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - f2c68315-909a-43e4-a55f-7c23d9d31174 + - 60f1d6ad-7f81-4d2a-9ef1-41f19f44e4cc Original-Request: - - req_lmhTXauBlZ2mrN + - req_4sYqtfUeHgBS1h + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_lmhTXauBlZ2mrN + - req_4sYqtfUeHgBS1h Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPHKuuB1fWySn1Zu2T6gc", + "id": "pi_3P6h7PKuuB1fWySn2KfYVSKl", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPHKuuB1fWySn1Zu2T6gc_secret_cVXjO5jtxG8407ljJZqLFUKPn", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989383, + "created": 1713393499, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPHKuuB1fWySn1GhIMqVV", + "latest_charge": "ch_3P6h7PKuuB1fWySn2L8Ip9bg", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPGKuuB1fWySnN30FF12U", + "payment_method": "pm_1P6h7PKuuB1fWySnpJPlGzBx", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,29 +398,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:24 GMT + recorded_at: Wed, 17 Apr 2024 22:38:21 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPHKuuB1fWySn1Zu2T6gc + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7PKuuB1fWySn2KfYVSKl body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_lmhTXauBlZ2mrN","request_duration_ms":1023}}' + - '{"last_request_metrics":{"request_id":"req_4sYqtfUeHgBS1h","request_duration_ms":1052}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -423,7 +430,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:25 GMT + - Wed, 17 Apr 2024 22:38:21 GMT Content-Type: - application/json Content-Length: @@ -448,10 +455,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_wBdW7CRHWtYn1f + - req_InA4UXgP7ovZil Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -462,7 +475,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPHKuuB1fWySn1Zu2T6gc", + "id": "pi_3P6h7PKuuB1fWySn2KfYVSKl", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -476,20 +489,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPHKuuB1fWySn1Zu2T6gc_secret_cVXjO5jtxG8407ljJZqLFUKPn", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989383, + "created": 1713393499, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPHKuuB1fWySn1GhIMqVV", + "latest_charge": "ch_3P6h7PKuuB1fWySn2L8Ip9bg", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPGKuuB1fWySnN30FF12U", + "payment_method": "pm_1P6h7PKuuB1fWySnpJPlGzBx", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -514,29 +527,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:25 GMT + recorded_at: Wed, 17 Apr 2024 22:38:21 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPHKuuB1fWySn1Zu2T6gc/capture + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7PKuuB1fWySn2KfYVSKl/capture body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_wBdW7CRHWtYn1f","request_duration_ms":305}}' + - '{"last_request_metrics":{"request_id":"req_InA4UXgP7ovZil","request_duration_ms":408}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -549,7 +559,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:26 GMT + - Wed, 17 Apr 2024 22:38:22 GMT Content-Type: - application/json Content-Length: @@ -574,16 +584,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - b76cc47c-5fec-47aa-bfb4-aa8d5a8e0d53 + - 211c48d0-f153-469b-a5f7-bc0ec77f4820 Original-Request: - - req_xqJ94httHFVMJm + - req_3pEsevymAurQCW + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_xqJ94httHFVMJm + - req_3pEsevymAurQCW Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -594,7 +610,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPHKuuB1fWySn1Zu2T6gc", + "id": "pi_3P6h7PKuuB1fWySn2KfYVSKl", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -608,20 +624,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPHKuuB1fWySn1Zu2T6gc_secret_cVXjO5jtxG8407ljJZqLFUKPn", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989383, + "created": 1713393499, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPHKuuB1fWySn1GhIMqVV", + "latest_charge": "ch_3P6h7PKuuB1fWySn2L8Ip9bg", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPGKuuB1fWySnN30FF12U", + "payment_method": "pm_1P6h7PKuuB1fWySnpJPlGzBx", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -646,29 +662,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:26 GMT + recorded_at: Wed, 17 Apr 2024 22:38:22 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPHKuuB1fWySn1Zu2T6gc + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7PKuuB1fWySn2KfYVSKl body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_xqJ94httHFVMJm","request_duration_ms":1023}}' + - '{"last_request_metrics":{"request_id":"req_3pEsevymAurQCW","request_duration_ms":1126}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -681,7 +694,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:26 GMT + - Wed, 17 Apr 2024 22:38:22 GMT Content-Type: - application/json Content-Length: @@ -706,10 +719,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_cR0qyGrivZ1YV5 + - req_tfIcynbnVwUvuZ Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -720,7 +739,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPHKuuB1fWySn1Zu2T6gc", + "id": "pi_3P6h7PKuuB1fWySn2KfYVSKl", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -734,20 +753,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPHKuuB1fWySn1Zu2T6gc_secret_cVXjO5jtxG8407ljJZqLFUKPn", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989383, + "created": 1713393499, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPHKuuB1fWySn1GhIMqVV", + "latest_charge": "ch_3P6h7PKuuB1fWySn2L8Ip9bg", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPGKuuB1fWySnN30FF12U", + "payment_method": "pm_1P6h7PKuuB1fWySnpJPlGzBx", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -772,5 +791,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:26 GMT + recorded_at: Wed, 17 Apr 2024 22:38:22 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa/returns_payment_intent_id_and_does_not_raise.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa/returns_payment_intent_id_and_does_not_raise.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa/returns_payment_intent_id_and_does_not_raise.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa/returns_payment_intent_id_and_does_not_raise.yml index eaf182420a..324b84463d 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa/returns_payment_intent_id_and_does_not_raise.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa/returns_payment_intent_id_and_does_not_raise.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4242424242424242&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_8AzdCIco8PUIix","request_duration_ms":505}}' + - '{"last_request_metrics":{"request_id":"req_6erFBt8I8770U0","request_duration_ms":1019}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:21 GMT + - Wed, 17 Apr 2024 22:38:16 GMT Content-Type: - application/json Content-Length: - - '960' + - '996' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - ded0e4fb-a6fd-4a25-a253-472804674a11 + - d437847d-b101-4d30-85e5-ade1f734a58c Original-Request: - - req_VjmjkJk42nvufT + - req_ML8x0xRXjzSwUg + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_VjmjkJk42nvufT + - req_ML8x0xRXjzSwUg Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDPEKuuB1fWySnfTpQN2nX", + "id": "pm_1P6h7MKuuB1fWySnC2fh20kl", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989380, + "created": 1713393496, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:21 GMT + recorded_at: Wed, 17 Apr 2024 22:38:17 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDPEKuuB1fWySnfTpQN2nX&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h7MKuuB1fWySnC2fh20kl&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_VjmjkJk42nvufT","request_duration_ms":471}}' + - '{"last_request_metrics":{"request_id":"req_ML8x0xRXjzSwUg","request_duration_ms":498}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:21 GMT + - Wed, 17 Apr 2024 22:38:17 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - c8240b50-af45-43c2-a5f1-b1536d5f26ce + - 1c64ce4f-10a5-4d25-b4a3-0770f59fe416 Original-Request: - - req_GF305zf2VNbAxw + - req_byoPGN1UVs38aW + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_GF305zf2VNbAxw + - req_byoPGN1UVs38aW Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPFKuuB1fWySn0xtGMkh3", + "id": "pi_3P6h7NKuuB1fWySn04AMksxW", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPFKuuB1fWySn0xtGMkh3_secret_iXCE4rocewv0Z1GDsSMxDxEF6", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989381, + "created": 1713393497, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPEKuuB1fWySnfTpQN2nX", + "payment_method": "pm_1P6h7MKuuB1fWySnC2fh20kl", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:21 GMT + recorded_at: Wed, 17 Apr 2024 22:38:17 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPFKuuB1fWySn0xtGMkh3/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7NKuuB1fWySn04AMksxW/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_GF305zf2VNbAxw","request_duration_ms":511}}' + - '{"last_request_metrics":{"request_id":"req_byoPGN1UVs38aW","request_duration_ms":508}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:22 GMT + - Wed, 17 Apr 2024 22:38:18 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 605bfb04-4da2-4e3e-aec6-b260501929bf + - 71a3372c-0bae-4c21-b1d3-3f15c6395ab5 Original-Request: - - req_SQJ9H6cTSPmrzQ + - req_GinJvOrjI3jPoK + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_SQJ9H6cTSPmrzQ + - req_GinJvOrjI3jPoK Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPFKuuB1fWySn0xtGMkh3", + "id": "pi_3P6h7NKuuB1fWySn04AMksxW", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPFKuuB1fWySn0xtGMkh3_secret_iXCE4rocewv0Z1GDsSMxDxEF6", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989381, + "created": 1713393497, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPFKuuB1fWySn0J8F7I8A", + "latest_charge": "ch_3P6h7NKuuB1fWySn0YW3AXzB", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPEKuuB1fWySnfTpQN2nX", + "payment_method": "pm_1P6h7MKuuB1fWySnC2fh20kl", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,5 +398,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:22 GMT + recorded_at: Wed, 17 Apr 2024 22:38:18 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa_debit_/captures_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa_debit_/captures_the_payment.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa_debit_/captures_the_payment.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa_debit_/captures_the_payment.yml index 5d40da036d..63a1b68cf1 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa_debit_/captures_the_payment.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa_debit_/captures_the_payment.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4000056655665556&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_qEvlMAKraRlSYa","request_duration_ms":961}}' + - '{"last_request_metrics":{"request_id":"req_pXfL18SxvJbCBU","request_duration_ms":1010}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:29 GMT + - Wed, 17 Apr 2024 22:38:25 GMT Content-Type: - application/json Content-Length: - - '959' + - '995' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 8add02cf-5166-4f6a-a699-0ed64e2243c3 + - bd815d42-e8c8-4979-b188-e0c462044392 Original-Request: - - req_99k0mbgXRg1Aps + - req_219VLTcIujaPsx + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_99k0mbgXRg1Aps + - req_219VLTcIujaPsx Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDPMKuuB1fWySnWtCxU7ER", + "id": "pm_1P6h7VKuuB1fWySnsX7ucKLX", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989388, + "created": 1713393505, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:29 GMT + recorded_at: Wed, 17 Apr 2024 22:38:25 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDPMKuuB1fWySnWtCxU7ER&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h7VKuuB1fWySnsX7ucKLX&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_99k0mbgXRg1Aps","request_duration_ms":417}}' + - '{"last_request_metrics":{"request_id":"req_219VLTcIujaPsx","request_duration_ms":458}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:29 GMT + - Wed, 17 Apr 2024 22:38:26 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 4c7fd4fc-8e5c-4cda-a69f-1e6515e1c693 + - 98fe770f-204b-4bf3-ba9c-2a26562a7e09 Original-Request: - - req_bpaBsEPhjqThIj + - req_QTyZoiVYbbIw5w + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_bpaBsEPhjqThIj + - req_QTyZoiVYbbIw5w Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPNKuuB1fWySn0ku46tFL", + "id": "pi_3P6h7VKuuB1fWySn2XHLMoF9", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPNKuuB1fWySn0ku46tFL_secret_39243YQSjSfUyKIE2N9hrnsas", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989389, + "created": 1713393505, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPMKuuB1fWySnWtCxU7ER", + "payment_method": "pm_1P6h7VKuuB1fWySnsX7ucKLX", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:29 GMT + recorded_at: Wed, 17 Apr 2024 22:38:26 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPNKuuB1fWySn0ku46tFL/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7VKuuB1fWySn2XHLMoF9/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_bpaBsEPhjqThIj","request_duration_ms":383}}' + - '{"last_request_metrics":{"request_id":"req_QTyZoiVYbbIw5w","request_duration_ms":437}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:30 GMT + - Wed, 17 Apr 2024 22:38:27 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 1155cf2b-1cc6-49f4-88bf-5e8c7690eed8 + - c754d625-abdc-429c-b974-e066f6a364d9 Original-Request: - - req_B7NeTFjREyv2Wc + - req_42Ejxtw3ANOc7Z + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_B7NeTFjREyv2Wc + - req_42Ejxtw3ANOc7Z Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPNKuuB1fWySn0ku46tFL", + "id": "pi_3P6h7VKuuB1fWySn2XHLMoF9", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPNKuuB1fWySn0ku46tFL_secret_39243YQSjSfUyKIE2N9hrnsas", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989389, + "created": 1713393505, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPNKuuB1fWySn0dePwWio", + "latest_charge": "ch_3P6h7VKuuB1fWySn28tKnIYE", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPMKuuB1fWySnWtCxU7ER", + "payment_method": "pm_1P6h7VKuuB1fWySnsX7ucKLX", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,29 +398,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:30 GMT + recorded_at: Wed, 17 Apr 2024 22:38:27 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPNKuuB1fWySn0ku46tFL + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7VKuuB1fWySn2XHLMoF9 body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_B7NeTFjREyv2Wc","request_duration_ms":966}}' + - '{"last_request_metrics":{"request_id":"req_42Ejxtw3ANOc7Z","request_duration_ms":1127}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -423,7 +430,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:30 GMT + - Wed, 17 Apr 2024 22:38:27 GMT Content-Type: - application/json Content-Length: @@ -448,10 +455,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_bsKMbTG417wqFA + - req_GwCDbtlfFx98Ca Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -462,7 +475,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPNKuuB1fWySn0ku46tFL", + "id": "pi_3P6h7VKuuB1fWySn2XHLMoF9", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -476,20 +489,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPNKuuB1fWySn0ku46tFL_secret_39243YQSjSfUyKIE2N9hrnsas", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989389, + "created": 1713393505, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPNKuuB1fWySn0dePwWio", + "latest_charge": "ch_3P6h7VKuuB1fWySn28tKnIYE", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPMKuuB1fWySnWtCxU7ER", + "payment_method": "pm_1P6h7VKuuB1fWySnsX7ucKLX", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -514,29 +527,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:30 GMT + recorded_at: Wed, 17 Apr 2024 22:38:27 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPNKuuB1fWySn0ku46tFL/capture + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7VKuuB1fWySn2XHLMoF9/capture body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_bsKMbTG417wqFA","request_duration_ms":280}}' + - '{"last_request_metrics":{"request_id":"req_GwCDbtlfFx98Ca","request_duration_ms":406}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -549,7 +559,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:31 GMT + - Wed, 17 Apr 2024 22:38:28 GMT Content-Type: - application/json Content-Length: @@ -574,16 +584,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - d3d7e530-8d4a-4e90-a488-99b25dfc8931 + - e31e1c73-e6ea-4709-aac2-6b25bfbd32bd Original-Request: - - req_1KfDgu6PARycSc + - req_FFdCC8GBHe6yzl + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_1KfDgu6PARycSc + - req_FFdCC8GBHe6yzl Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -594,7 +610,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPNKuuB1fWySn0ku46tFL", + "id": "pi_3P6h7VKuuB1fWySn2XHLMoF9", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -608,20 +624,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPNKuuB1fWySn0ku46tFL_secret_39243YQSjSfUyKIE2N9hrnsas", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989389, + "created": 1713393505, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPNKuuB1fWySn0dePwWio", + "latest_charge": "ch_3P6h7VKuuB1fWySn28tKnIYE", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPMKuuB1fWySnWtCxU7ER", + "payment_method": "pm_1P6h7VKuuB1fWySnsX7ucKLX", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -646,29 +662,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:31 GMT + recorded_at: Wed, 17 Apr 2024 22:38:28 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPNKuuB1fWySn0ku46tFL + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7VKuuB1fWySn2XHLMoF9 body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_1KfDgu6PARycSc","request_duration_ms":1079}}' + - '{"last_request_metrics":{"request_id":"req_FFdCC8GBHe6yzl","request_duration_ms":1124}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -681,7 +694,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:32 GMT + - Wed, 17 Apr 2024 22:38:29 GMT Content-Type: - application/json Content-Length: @@ -706,10 +719,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_vVwW7XX2KXhG23 + - req_VCkHzjjHMXrfND Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -720,7 +739,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPNKuuB1fWySn0ku46tFL", + "id": "pi_3P6h7VKuuB1fWySn2XHLMoF9", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -734,20 +753,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPNKuuB1fWySn0ku46tFL_secret_39243YQSjSfUyKIE2N9hrnsas", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989389, + "created": 1713393505, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPNKuuB1fWySn0dePwWio", + "latest_charge": "ch_3P6h7VKuuB1fWySn28tKnIYE", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPMKuuB1fWySnWtCxU7ER", + "payment_method": "pm_1P6h7VKuuB1fWySnsX7ucKLX", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -772,5 +791,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:32 GMT + recorded_at: Wed, 17 Apr 2024 22:38:29 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa_debit_/returns_payment_intent_id_and_does_not_raise.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa_debit_/returns_payment_intent_id_and_does_not_raise.yml similarity index 74% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa_debit_/returns_payment_intent_id_and_does_not_raise.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa_debit_/returns_payment_intent_id_and_does_not_raise.yml index 7bd72ebb8e..0ed7d06d49 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa_debit_/returns_payment_intent_id_and_does_not_raise.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/valid_non-3D_credit_cards_are_correctly_handled/behaves_like_payments_intents/from_Visa_debit_/returns_payment_intent_id_and_does_not_raise.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4000056655665556&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_cR0qyGrivZ1YV5","request_duration_ms":312}}' + - '{"last_request_metrics":{"request_id":"req_tfIcynbnVwUvuZ","request_duration_ms":406}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:26 GMT + - Wed, 17 Apr 2024 22:38:23 GMT Content-Type: - application/json Content-Length: - - '959' + - '995' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - dd8e0c1f-dae8-49c2-bfad-f854fa76b24b + - a7b996f1-a409-4a18-aa1b-1880b0a5034e Original-Request: - - req_NvmhCfHjRHZGdS + - req_bkXwpvWqb1uGih + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_NvmhCfHjRHZGdS + - req_bkXwpvWqb1uGih Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDPKKuuB1fWySnhiNvJpgj", + "id": "pm_1P6h7TKuuB1fWySnjAMDCuUb", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,35 +123,32 @@ http_interactions: }, "wallet": null }, - "created": 1708989386, + "created": 1713393503, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:16:26 GMT + recorded_at: Wed, 17 Apr 2024 22:38:23 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=100¤cy=eur&payment_method=pm_1OoDPKKuuB1fWySnhiNvJpgj&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1P6h7TKuuB1fWySnjAMDCuUb&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_NvmhCfHjRHZGdS","request_duration_ms":495}}' + - '{"last_request_metrics":{"request_id":"req_bkXwpvWqb1uGih","request_duration_ms":573}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:27 GMT + - Wed, 17 Apr 2024 22:38:24 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 902ad78e-ca92-4d10-864e-54ca7c74bf58 + - 554816c3-59e5-4e14-ae85-c157106cfeb6 Original-Request: - - req_Ef6g9UEQMmu2O1 + - req_F5w6Gb6QlfUAzd + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_Ef6g9UEQMmu2O1 + - req_F5w6Gb6QlfUAzd Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,7 +211,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPLKuuB1fWySn0N9hjTbQ", + "id": "pi_3P6h7TKuuB1fWySn2fA3dJIq", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -218,9 +225,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPLKuuB1fWySn0N9hjTbQ_secret_xdmxDsPVEGWNCi8pRzzlEO7df", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989387, + "created": 1713393503, "currency": "eur", "customer": null, "description": null, @@ -231,7 +238,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPKKuuB1fWySnhiNvJpgj", + "payment_method": "pm_1P6h7TKuuB1fWySnjAMDCuUb", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +263,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:27 GMT + recorded_at: Wed, 17 Apr 2024 22:38:24 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OoDPLKuuB1fWySn0N9hjTbQ/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3P6h7TKuuB1fWySn2fA3dJIq/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_Ef6g9UEQMmu2O1","request_duration_ms":714}}' + - '{"last_request_metrics":{"request_id":"req_F5w6Gb6QlfUAzd","request_duration_ms":507}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +295,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:16:28 GMT + - Wed, 17 Apr 2024 22:38:25 GMT Content-Type: - application/json Content-Length: @@ -316,16 +320,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 6f809170-ee2d-4124-9c59-13822aac8748 + - '089dc653-e311-418b-a775-17489143e1dd' Original-Request: - - req_qEvlMAKraRlSYa + - req_pXfL18SxvJbCBU + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_qEvlMAKraRlSYa + - req_pXfL18SxvJbCBU Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -336,7 +346,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OoDPLKuuB1fWySn0N9hjTbQ", + "id": "pi_3P6h7TKuuB1fWySn2fA3dJIq", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -350,20 +360,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OoDPLKuuB1fWySn0N9hjTbQ_secret_xdmxDsPVEGWNCi8pRzzlEO7df", + "client_secret": "", "confirmation_method": "automatic", - "created": 1708989387, + "created": 1713393503, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OoDPLKuuB1fWySn0G1DK2sb", + "latest_charge": "ch_3P6h7TKuuB1fWySn2rsh6FhI", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OoDPKKuuB1fWySnhiNvJpgj", + "payment_method": "pm_1P6h7TKuuB1fWySnjAMDCuUb", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,5 +398,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Mon, 26 Feb 2024 23:16:28 GMT + recorded_at: Wed, 17 Apr 2024 22:38:25 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_ProfileStorer/create_customer_from_token/when_called_from_Stripe_SCA/fetches_the_customer_id_and_the_card_id_from_the_correct_response_fields.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_ProfileStorer/create_customer_from_token/when_called_from_Stripe_SCA/fetches_the_customer_id_and_the_card_id_from_the_correct_response_fields.yml similarity index 77% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_ProfileStorer/create_customer_from_token/when_called_from_Stripe_SCA/fetches_the_customer_id_and_the_card_id_from_the_correct_response_fields.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_ProfileStorer/create_customer_from_token/when_called_from_Stripe_SCA/fetches_the_customer_id_and_the_card_id_from_the_correct_response_fields.yml index 765ecfae27..a61ab62589 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_ProfileStorer/create_customer_from_token/when_called_from_Stripe_SCA/fetches_the_customer_id_and_the_card_id_from_the_correct_response_fields.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_ProfileStorer/create_customer_from_token/when_called_from_Stripe_SCA/fetches_the_customer_id_and_the_card_id_from_the_correct_response_fields.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4242424242424242&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_LTPedcXLyXiFZW","request_duration_ms":387}}' + - '{"last_request_metrics":{"request_id":"req_ClLaOaXNsGN8vL","request_duration_ms":510}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:59 GMT + - Wed, 17 Apr 2024 22:40:09 GMT Content-Type: - application/json Content-Length: - - '960' + - '996' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - cd63c5e5-e7c8-4ec2-8d3b-bae7c83b50c6 + - 26c82b1c-e35b-4828-952f-a080feddcf32 Original-Request: - - req_LAYTMe7Nu6P06T + - req_z85eXoVPKfYehv + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_LAYTMe7Nu6P06T + - req_z85eXoVPKfYehv Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQpKuuB1fWySn7VRFead3", + "id": "pm_1P6h9BKuuB1fWySnAQFqlFlo", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,30 +123,30 @@ http_interactions: }, "wallet": null }, - "created": 1708989479, + "created": 1713393609, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:17:59 GMT + recorded_at: Wed, 17 Apr 2024 22:40:09 GMT - request: method: post uri: https://api.stripe.com/v1/customers body: encoding: UTF-8 - string: expand[0]=sources&email=harriett.johns%40sanford.name + string: expand[0]=sources&email=ghislaine%40dach.co.uk headers: Content-Type: - application/x-www-form-urlencoded Authorization: - - Basic c2tfdGVzdF94RmdKUU9sWHBNQUZzb3p0endGQlRGaFAwMEhHN0J1Q0ptOg== + - "" User-Agent: - Stripe/v1 ActiveMerchantBindings/1.133.0 Stripe-Version: - '2020-08-27' X-Stripe-Client-User-Agent: - - '{"bindings_version":"1.133.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","publisher":"active_merchant"}' + - "" X-Stripe-Client-User-Metadata: - '{"ip":null}' Connection: @@ -159,11 +163,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:17:59 GMT + - Wed, 17 Apr 2024 22:40:10 GMT Content-Type: - application/json Content-Length: - - '824' + - '817' Connection: - close Access-Control-Allow-Credentials: @@ -183,12 +187,18 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fcustomers; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 36dc228c-2fb0-4962-900d-60aaf076643f + - b36aa62a-c1cf-4617-bdd8-3fe3aa3496a4 Original-Request: - - req_H9D9hcbThnVvw7 + - req_0I9IWH3SSf59xs + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_H9D9hcbThnVvw7 + - req_0I9IWH3SSf59xs Stripe-Should-Retry: - 'false' Stripe-Version: @@ -203,19 +213,19 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "cus_PdUPusUuoW8fFz", + "id": "cus_PwaJYPemgpF6Y8", "object": "customer", "address": null, "balance": 0, - "created": 1708989479, + "created": 1713393610, "currency": null, "default_currency": null, "default_source": null, "delinquent": false, "description": null, "discount": null, - "email": "harriett.johns@sanford.name", - "invoice_prefix": "A0F05DFF", + "email": "ghislaine@dach.co.uk", + "invoice_prefix": "F33E9510", "invoice_settings": { "custom_fields": null, "default_payment_method": null, @@ -234,29 +244,29 @@ http_interactions: "data": [], "has_more": false, "total_count": 0, - "url": "/v1/customers/cus_PdUPusUuoW8fFz/sources" + "url": "/v1/customers/cus_PwaJYPemgpF6Y8/sources" }, "tax_exempt": "none", "test_clock": null } - recorded_at: Mon, 26 Feb 2024 23:18:00 GMT + recorded_at: Wed, 17 Apr 2024 22:40:10 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_methods/pm_1OoDQpKuuB1fWySn7VRFead3/attach + uri: https://api.stripe.com/v1/payment_methods/pm_1P6h9BKuuB1fWySnAQFqlFlo/attach body: encoding: UTF-8 - string: customer=cus_PdUPusUuoW8fFz + string: customer=cus_PwaJYPemgpF6Y8 headers: Content-Type: - application/x-www-form-urlencoded Authorization: - - Basic c2tfdGVzdF94RmdKUU9sWHBNQUZzb3p0endGQlRGaFAwMEhHN0J1Q0ptOg== + - "" User-Agent: - Stripe/v1 ActiveMerchantBindings/1.133.0 Stripe-Version: - '2020-08-27' X-Stripe-Client-User-Agent: - - '{"bindings_version":"1.133.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","publisher":"active_merchant"}' + - "" X-Stripe-Client-User-Metadata: - '{"ip":null}' Connection: @@ -273,11 +283,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:00 GMT + - Wed, 17 Apr 2024 22:40:11 GMT Content-Type: - application/json Content-Length: - - '971' + - '1007' Connection: - close Access-Control-Allow-Credentials: @@ -298,12 +308,18 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 7d73b16f-db8f-4154-9a72-a0b00a41f62b + - cd195fa3-40ac-44ab-8a8a-fe68d61ff151 Original-Request: - - req_wgmphutuU70jnL + - req_FLbgIeKnb6BHgs + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_wgmphutuU70jnL + - req_FLbgIeKnb6BHgs Stripe-Should-Retry: - 'false' Stripe-Version: @@ -318,8 +334,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQpKuuB1fWySn7VRFead3", + "id": "pm_1P6h9BKuuB1fWySnAQFqlFlo", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -359,11 +376,11 @@ http_interactions: }, "wallet": null }, - "created": 1708989479, - "customer": "cus_PdUPusUuoW8fFz", + "created": 1713393609, + "customer": "cus_PwaJYPemgpF6Y8", "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:18:00 GMT + recorded_at: Wed, 17 Apr 2024 22:40:11 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_ProfileStorer/create_customer_from_token/when_request_fails/raises_an_error.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_ProfileStorer/create_customer_from_token/when_request_fails/raises_an_error.yml similarity index 75% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_ProfileStorer/create_customer_from_token/when_request_fails/raises_an_error.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_ProfileStorer/create_customer_from_token/when_request_fails/raises_an_error.yml index 1c3470c1bd..b6988f2b63 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/Stripe_ProfileStorer/create_customer_from_token/when_request_fails/raises_an_error.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/Stripe_ProfileStorer/create_customer_from_token/when_request_fails/raises_an_error.yml @@ -8,20 +8,17 @@ http_interactions: string: type=card&card[number]=4242424242424242&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_LAYTMe7Nu6P06T","request_duration_ms":516}}' + - '{"last_request_metrics":{"request_id":"req_z85eXoVPKfYehv","request_duration_ms":454}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +31,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:01 GMT + - Wed, 17 Apr 2024 22:40:11 GMT Content-Type: - application/json Content-Length: - - '960' + - '996' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -58,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 38ea4148-864e-4b3c-b342-c49dfaddf611 + - 5eb33193-9d49-4406-aaa0-e62804b00099 Original-Request: - - req_yei1QOYmP48Ixx + - req_AezHDQR6swerUC + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_yei1QOYmP48Ixx + - req_AezHDQR6swerUC Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -78,8 +81,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQqKuuB1fWySn5tkpKZvR", + "id": "pm_1P6h9DKuuB1fWySnlqKvKCqJ", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -119,13 +123,13 @@ http_interactions: }, "wallet": null }, - "created": 1708989481, + "created": 1713393611, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:18:01 GMT + recorded_at: Wed, 17 Apr 2024 22:40:11 GMT - request: method: post uri: https://api.stripe.com/v1/customers @@ -134,20 +138,17 @@ http_interactions: string: name=Apple+Customer&email=applecustomer%40example.com headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_yei1QOYmP48Ixx","request_duration_ms":502}}' + - '{"last_request_metrics":{"request_id":"req_AezHDQR6swerUC","request_duration_ms":512}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +161,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:01 GMT + - Wed, 17 Apr 2024 22:40:12 GMT Content-Type: - application/json Content-Length: @@ -184,16 +185,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fcustomers; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 3a5bf752-3a9f-43dd-ba73-22bcd89b2ec4 + - dc780644-1c06-4a19-91b2-2cd1d84b51a8 Original-Request: - - req_H2iOD9Nd3BK612 + - req_vxSKfzkLvLJxGe + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_H2iOD9Nd3BK612 + - req_vxSKfzkLvLJxGe Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -204,18 +211,18 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "cus_PdUPA7hEQL9h3s", + "id": "cus_PwaJjS6XT3TQ5f", "object": "customer", "address": null, "balance": 0, - "created": 1708989481, + "created": 1713393612, "currency": null, "default_source": null, "delinquent": false, "description": null, "discount": null, "email": "applecustomer@example.com", - "invoice_prefix": "79164CB7", + "invoice_prefix": "19C2805E", "invoice_settings": { "custom_fields": null, "default_payment_method": null, @@ -232,29 +239,26 @@ http_interactions: "tax_exempt": "none", "test_clock": null } - recorded_at: Mon, 26 Feb 2024 23:18:01 GMT + recorded_at: Wed, 17 Apr 2024 22:40:12 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_methods/pm_1OoDQqKuuB1fWySn5tkpKZvR/attach + uri: https://api.stripe.com/v1/payment_methods/pm_1P6h9DKuuB1fWySnlqKvKCqJ/attach body: encoding: UTF-8 - string: customer=cus_PdUPA7hEQL9h3s + string: customer=cus_PwaJjS6XT3TQ5f headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_H2iOD9Nd3BK612","request_duration_ms":407}}' + - '{"last_request_metrics":{"request_id":"req_vxSKfzkLvLJxGe","request_duration_ms":511}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -267,11 +271,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:02 GMT + - Wed, 17 Apr 2024 22:40:13 GMT Content-Type: - application/json Content-Length: - - '971' + - '1007' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -292,16 +296,22 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - f7b99144-55cb-4003-a865-f58ef85f39bb + - 1af4a374-7d69-4a9c-aa74-7349f7f6c74d Original-Request: - - req_23MVJCpcGmFoMK + - req_XG8res7ijCpIgW + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_23MVJCpcGmFoMK + - req_XG8res7ijCpIgW Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -312,8 +322,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OoDQqKuuB1fWySn5tkpKZvR", + "id": "pm_1P6h9DKuuB1fWySnlqKvKCqJ", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -353,30 +364,30 @@ http_interactions: }, "wallet": null }, - "created": 1708989481, - "customer": "cus_PdUPA7hEQL9h3s", + "created": 1713393611, + "customer": "cus_PwaJjS6XT3TQ5f", "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Mon, 26 Feb 2024 23:18:02 GMT + recorded_at: Wed, 17 Apr 2024 22:40:13 GMT - request: method: post uri: https://api.stripe.com/v1/customers body: encoding: UTF-8 - string: expand[0]=sources&email=barbera.tillman%40jacobson.biz + string: expand[0]=sources&email=leia%40lindgrenwolf.biz headers: Content-Type: - application/x-www-form-urlencoded Authorization: - - Basic c2tfdGVzdF94RmdKUU9sWHBNQUZzb3p0endGQlRGaFAwMEhHN0J1Q0ptOg== + - "" User-Agent: - Stripe/v1 ActiveMerchantBindings/1.133.0 Stripe-Version: - '2020-08-27' X-Stripe-Client-User-Agent: - - '{"bindings_version":"1.133.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","publisher":"active_merchant"}' + - "" X-Stripe-Client-User-Metadata: - '{"ip":null}' Connection: @@ -393,11 +404,11 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:03 GMT + - Wed, 17 Apr 2024 22:40:14 GMT Content-Type: - application/json Content-Length: - - '825' + - '818' Connection: - close Access-Control-Allow-Credentials: @@ -417,12 +428,18 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fcustomers; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 34b2691a-3b11-4371-9215-2fae6e91d1d5 + - 799dd531-ec2d-4e1d-9d1c-f23c6cec1bb7 Original-Request: - - req_kKdMsC5shUhnJC + - req_J9xl2e10YfvJQZ + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_kKdMsC5shUhnJC + - req_J9xl2e10YfvJQZ Stripe-Should-Retry: - 'false' Stripe-Version: @@ -437,19 +454,19 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "cus_PdUPeD4HvaMVMZ", + "id": "cus_PwaJXiDsdJ2WVw", "object": "customer", "address": null, "balance": 0, - "created": 1708989482, + "created": 1713393613, "currency": null, "default_currency": null, "default_source": null, "delinquent": false, "description": null, "discount": null, - "email": "barbera.tillman@jacobson.biz", - "invoice_prefix": "D6DFEF29", + "email": "leia@lindgrenwolf.biz", + "invoice_prefix": "11F84DD5", "invoice_settings": { "custom_fields": null, "default_payment_method": null, @@ -468,29 +485,29 @@ http_interactions: "data": [], "has_more": false, "total_count": 0, - "url": "/v1/customers/cus_PdUPeD4HvaMVMZ/sources" + "url": "/v1/customers/cus_PwaJXiDsdJ2WVw/sources" }, "tax_exempt": "none", "test_clock": null } - recorded_at: Mon, 26 Feb 2024 23:18:03 GMT + recorded_at: Wed, 17 Apr 2024 22:40:14 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_methods/pm_1OoDQqKuuB1fWySn5tkpKZvR/attach + uri: https://api.stripe.com/v1/payment_methods/pm_1P6h9DKuuB1fWySnlqKvKCqJ/attach body: encoding: UTF-8 - string: customer=cus_PdUPeD4HvaMVMZ + string: customer=cus_PwaJXiDsdJ2WVw headers: Content-Type: - application/x-www-form-urlencoded Authorization: - - Basic c2tfdGVzdF94RmdKUU9sWHBNQUZzb3p0endGQlRGaFAwMEhHN0J1Q0ptOg== + - "" User-Agent: - Stripe/v1 ActiveMerchantBindings/1.133.0 Stripe-Version: - '2020-08-27' X-Stripe-Client-User-Agent: - - '{"bindings_version":"1.133.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","publisher":"active_merchant"}' + - "" X-Stripe-Client-User-Metadata: - '{"ip":null}' Connection: @@ -507,7 +524,7 @@ http_interactions: Server: - nginx Date: - - Mon, 26 Feb 2024 23:18:03 GMT + - Wed, 17 Apr 2024 22:40:14 GMT Content-Type: - application/json Content-Length: @@ -532,12 +549,18 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 88e451a0-083d-487a-8c02-fc0ecc22163c + - 4fc2fa0b-44af-4807-ac6a-9695ce2e80db Original-Request: - - req_qoSWUQVXeZ2aUA + - req_KR00YULmT3JDWA + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_qoSWUQVXeZ2aUA + - req_KR00YULmT3JDWA Stripe-Should-Retry: - 'false' Stripe-Version: @@ -554,9 +577,9 @@ http_interactions: { "error": { "message": "The payment method you provided has already been attached to a customer.", - "request_log_url": "https://dashboard.stripe.com/test/logs/req_qoSWUQVXeZ2aUA?t=1708989483", + "request_log_url": "https://dashboard.stripe.com/test/logs/req_KR00YULmT3JDWA?t=1713393614", "type": "invalid_request_error" } } - recorded_at: Mon, 26 Feb 2024 23:18:03 GMT + recorded_at: Wed, 17 Apr 2024 22:40:14 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/_As_an_hub_manager_I_want_to_make_Stripe_payments_/with_a_payment_using_a_StripeSCA_payment_method/that_is_completed/allows_to_refund_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/_As_an_hub_manager_I_want_to_make_Stripe_payments_/with_a_payment_using_a_StripeSCA_payment_method/that_is_completed/allows_to_refund_the_payment.yml similarity index 75% rename from spec/fixtures/vcr_cassettes/Stripe-v10.10.0/_As_an_hub_manager_I_want_to_make_Stripe_payments_/with_a_payment_using_a_StripeSCA_payment_method/that_is_completed/allows_to_refund_the_payment.yml rename to spec/fixtures/vcr_cassettes/Stripe-v11.1.0/_As_an_hub_manager_I_want_to_make_Stripe_payments_/with_a_payment_using_a_StripeSCA_payment_method/that_is_completed/allows_to_refund_the_payment.yml index dde14f5b26..5ffd4bc880 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.10.0/_As_an_hub_manager_I_want_to_make_Stripe_payments_/with_a_payment_using_a_StripeSCA_payment_method/that_is_completed/allows_to_refund_the_payment.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v11.1.0/_As_an_hub_manager_I_want_to_make_Stripe_payments_/with_a_payment_using_a_StripeSCA_payment_method/that_is_completed/allows_to_refund_the_payment.yml @@ -8,18 +8,17 @@ http_interactions: string: type=standard&country=AU&email=lettuce.producer%40example.com headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_ujKgcbLv0jphd1","request_duration_ms":357}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -32,7 +31,7 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:26:33 GMT + - Wed, 17 Apr 2024 22:41:17 GMT Content-Type: - application/json Content-Length: @@ -56,16 +55,22 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 8962c4d7-4235-40b4-8ae7-3452f5d5bdf6 + - e069e735-936b-48ba-bc11-d950eacdfcb1 Original-Request: - - req_bb1i3QF8PMYoCQ + - req_MacTcb3W5I01lR + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_bb1i3QF8PMYoCQ + - req_MacTcb3W5I01lR Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -76,7 +81,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "acct_1Ooeiy4EBxHlGE7s", + "id": "acct_1P6hAG4EoLbwaGwm", "object": "account", "business_profile": { "annual_revenue": null, @@ -98,7 +103,7 @@ http_interactions: "type": "application" }, "country": "AU", - "created": 1709094393, + "created": 1713393676, "default_currency": "aud", "details_submitted": false, "email": "lettuce.producer@example.com", @@ -107,7 +112,7 @@ http_interactions: "data": [], "has_more": false, "total_count": 0, - "url": "/v1/accounts/acct_1Ooeiy4EBxHlGE7s/external_accounts" + "url": "/v1/accounts/acct_1P6hAG4EoLbwaGwm/external_accounts" }, "future_requirements": { "alternatives": [], @@ -204,7 +209,7 @@ http_interactions: }, "type": "standard" } - recorded_at: Wed, 28 Feb 2024 04:26:34 GMT + recorded_at: Wed, 17 Apr 2024 22:41:17 GMT - request: method: get uri: https://api.stripe.com/v1/payment_methods/pm_card_mastercard @@ -213,20 +218,17 @@ http_interactions: string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_bb1i3QF8PMYoCQ","request_duration_ms":1787}}' + - '{"last_request_metrics":{"request_id":"req_MacTcb3W5I01lR","request_duration_ms":1826}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -239,11 +241,11 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:26:34 GMT + - Wed, 17 Apr 2024 22:41:18 GMT Content-Type: - application/json Content-Length: - - '977' + - '1013' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -264,10 +266,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_36OxSQ2EFRmv16 + - req_E17pqy1AQKNOhA Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -278,8 +286,9 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1Ooej0KuuB1fWySnCoMI8Z8A", + "id": "pm_1P6hAIKuuB1fWySnoA4ulnW8", "object": "payment_method", + "allow_redisplay": "unspecified", "billing_details": { "address": { "city": null, @@ -302,7 +311,7 @@ http_interactions: }, "country": "US", "display_brand": "mastercard", - "exp_month": 2, + "exp_month": 4, "exp_year": 2025, "fingerprint": "BL35fEFVcTTS5wpE", "funding": "credit", @@ -319,13 +328,13 @@ http_interactions: }, "wallet": null }, - "created": 1709094394, + "created": 1713393678, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Wed, 28 Feb 2024 04:26:34 GMT + recorded_at: Wed, 17 Apr 2024 22:41:18 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents @@ -334,22 +343,19 @@ http_interactions: string: amount=2600¤cy=aud&payment_method=pm_card_mastercard&payment_method_types[0]=card&capture_method=automatic&confirm=true headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_36OxSQ2EFRmv16","request_duration_ms":380}}' + - '{"last_request_metrics":{"request_id":"req_E17pqy1AQKNOhA","request_duration_ms":449}}' Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Stripe-Account: - - acct_1Ooeiy4EBxHlGE7s + - acct_1P6hAG4EoLbwaGwm Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -362,7 +368,7 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:26:35 GMT + - Wed, 17 Apr 2024 22:41:19 GMT Content-Type: - application/json Content-Length: @@ -386,18 +392,24 @@ http_interactions: - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - 8de818e2-8e78-4cf6-b562-d91150c136cd + - 7df0d4fd-d090-4248-ac7e-bb3aa9a6e193 Original-Request: - - req_IkRp1OoTjJRHiH + - req_AmLqrdSk172sQV + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_IkRp1OoTjJRHiH + - req_AmLqrdSk172sQV Stripe-Account: - - acct_1Ooeiy4EBxHlGE7s + - acct_1P6hAG4EoLbwaGwm Stripe-Should-Retry: - 'false' Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -408,7 +420,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3Ooej04EBxHlGE7s0bcV528D", + "id": "pi_3P6hAI4EoLbwaGwm0sUQgKzM", "object": "payment_intent", "amount": 2600, "amount_capturable": 0, @@ -422,20 +434,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "automatic", - "client_secret": "pi_3Ooej04EBxHlGE7s0bcV528D_secret_6YjzW0BtKkgJwHytmGABXvbKA", + "client_secret": "", "confirmation_method": "automatic", - "created": 1709094394, + "created": 1713393678, "currency": "aud", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3Ooej04EBxHlGE7s0clvIC9E", + "latest_charge": "ch_3P6hAI4EoLbwaGwm0en1nUyd", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1Ooej04EBxHlGE7sU7xdsT0R", + "payment_method": "pm_1P6hAI4EoLbwaGwmQVOP30ld", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -460,29 +472,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Wed, 28 Feb 2024 04:26:35 GMT + recorded_at: Wed, 17 Apr 2024 22:41:19 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3Ooej04EBxHlGE7s0bcV528D + uri: https://api.stripe.com/v1/payment_intents/pi_3P6hAI4EoLbwaGwm0sUQgKzM body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.10.0 + - Stripe/v1 RubyBindings/11.1.0 Authorization: - - Bearer + - "" Content-Type: - application/x-www-form-urlencoded Stripe-Version: - - '2023-10-16' + - '2024-04-10' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.10.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) - 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon - Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + - "" Stripe-Account: - - acct_1Ooeiy4EBxHlGE7s + - acct_1P6hAG4EoLbwaGwm Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -495,7 +504,7 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:26:36 GMT + - Wed, 17 Apr 2024 22:42:13 GMT Content-Type: - application/json Content-Length: @@ -520,12 +529,18 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_PAxdlbVLnOfd8n + - req_eQMThJH0kUgpA0 Stripe-Account: - - acct_1Ooeiy4EBxHlGE7s + - acct_1P6hAG4EoLbwaGwm Stripe-Version: - - '2023-10-16' + - '2024-04-10' Vary: - Origin X-Stripe-Routing-Context-Priority-Tier: @@ -536,7 +551,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3Ooej04EBxHlGE7s0bcV528D", + "id": "pi_3P6hAI4EoLbwaGwm0sUQgKzM", "object": "payment_intent", "amount": 2600, "amount_capturable": 0, @@ -550,20 +565,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "automatic", - "client_secret": "pi_3Ooej04EBxHlGE7s0bcV528D_secret_6YjzW0BtKkgJwHytmGABXvbKA", + "client_secret": "", "confirmation_method": "automatic", - "created": 1709094394, + "created": 1713393678, "currency": "aud", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3Ooej04EBxHlGE7s0clvIC9E", + "latest_charge": "ch_3P6hAI4EoLbwaGwm0en1nUyd", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1Ooej04EBxHlGE7sU7xdsT0R", + "payment_method": "pm_1P6hAI4EoLbwaGwmQVOP30ld", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -588,26 +603,26 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Wed, 28 Feb 2024 04:26:36 GMT + recorded_at: Wed, 17 Apr 2024 22:42:14 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3Ooej04EBxHlGE7s0bcV528D + uri: https://api.stripe.com/v1/payment_intents/pi_3P6hAI4EoLbwaGwm0sUQgKzM body: encoding: US-ASCII string: '' headers: Authorization: - - Basic c2tfdGVzdF94RmdKUU9sWHBNQUZzb3p0endGQlRGaFAwMEhHN0J1Q0ptOg== + - "" User-Agent: - Stripe/v1 ActiveMerchantBindings/1.133.0 Stripe-Version: - '2020-08-27' X-Stripe-Client-User-Agent: - - '{"bindings_version":"1.133.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","publisher":"active_merchant"}' + - "" X-Stripe-Client-User-Metadata: - '{"ip":null}' Stripe-Account: - - acct_1Ooeiy4EBxHlGE7s + - acct_1P6hAG4EoLbwaGwm Connection: - close Accept-Encoding: @@ -622,11 +637,11 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:26:37 GMT + - Wed, 17 Apr 2024 22:42:14 GMT Content-Type: - application/json Content-Length: - - '5160' + - '5159' Connection: - close Access-Control-Allow-Credentials: @@ -647,10 +662,16 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_JmhF7mIJuAy0ah + - req_g7KbC11PO7Y9pb Stripe-Account: - - acct_1Ooeiy4EBxHlGE7s + - acct_1P6hAG4EoLbwaGwm Stripe-Version: - '2020-08-27' Vary: @@ -663,7 +684,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3Ooej04EBxHlGE7s0bcV528D", + "id": "pi_3P6hAI4EoLbwaGwm0sUQgKzM", "object": "payment_intent", "amount": 2600, "amount_capturable": 0, @@ -681,7 +702,7 @@ http_interactions: "object": "list", "data": [ { - "id": "ch_3Ooej04EBxHlGE7s0clvIC9E", + "id": "ch_3P6hAI4EoLbwaGwm0en1nUyd", "object": "charge", "amount": 2600, "amount_captured": 2600, @@ -689,7 +710,7 @@ http_interactions: "application": "", "application_fee": null, "application_fee_amount": null, - "balance_transaction": "txn_3Ooej04EBxHlGE7s0eYY617n", + "balance_transaction": "txn_3P6hAI4EoLbwaGwm0FrqlwpQ", "billing_details": { "address": { "city": null, @@ -705,7 +726,7 @@ http_interactions: }, "calculated_statement_descriptor": "OFNOFNOFN", "captured": true, - "created": 1709094395, + "created": 1713393678, "currency": "aud", "customer": null, "description": null, @@ -725,13 +746,13 @@ http_interactions: "network_status": "approved_by_network", "reason": null, "risk_level": "normal", - "risk_score": 26, + "risk_score": 5, "seller_message": "Payment complete.", "type": "authorized" }, "paid": true, - "payment_intent": "pi_3Ooej04EBxHlGE7s0bcV528D", - "payment_method": "pm_1Ooej04EBxHlGE7sU7xdsT0R", + "payment_intent": "pi_3P6hAI4EoLbwaGwm0sUQgKzM", + "payment_method": "pm_1P6hAI4EoLbwaGwmQVOP30ld", "payment_method_details": { "card": { "amount_authorized": 2600, @@ -742,7 +763,7 @@ http_interactions: "cvc_check": "pass" }, "country": "US", - "exp_month": 2, + "exp_month": 4, "exp_year": 2025, "extended_authorization": { "status": "disabled" @@ -774,14 +795,14 @@ http_interactions: "radar_options": {}, "receipt_email": null, "receipt_number": null, - "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xT29laXk0RUJ4SGxHRTdzKPzr-q4GMgbq-nfv4PU6LBZluRZWP743wLV7eYf5QqpZCB60TngSAv_bfmxatmhILOAw3_ebDoedUg7N", + "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xUDZoQUc0RW9MYndhR3dtKMaggbEGMgZ_FnALIFg6LBaPlsY1zgMRdfWxyHZTyVfmLkn556cnMDxvPM8w49hOk_cAuTT8WPgT9V-F", "refunded": false, "refunds": { "object": "list", "data": [], "has_more": false, "total_count": 0, - "url": "/v1/charges/ch_3Ooej04EBxHlGE7s0clvIC9E/refunds" + "url": "/v1/charges/ch_3P6hAI4EoLbwaGwm0en1nUyd/refunds" }, "review": null, "shipping": null, @@ -796,22 +817,22 @@ http_interactions: ], "has_more": false, "total_count": 1, - "url": "/v1/charges?payment_intent=pi_3Ooej04EBxHlGE7s0bcV528D" + "url": "/v1/charges?payment_intent=pi_3P6hAI4EoLbwaGwm0sUQgKzM" }, - "client_secret": "pi_3Ooej04EBxHlGE7s0bcV528D_secret_6YjzW0BtKkgJwHytmGABXvbKA", + "client_secret": "", "confirmation_method": "automatic", - "created": 1709094394, + "created": 1713393678, "currency": "aud", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3Ooej04EBxHlGE7s0clvIC9E", + "latest_charge": "ch_3P6hAI4EoLbwaGwm0en1nUyd", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1Ooej04EBxHlGE7sU7xdsT0R", + "payment_method": "pm_1P6hAI4EoLbwaGwmQVOP30ld", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -836,10 +857,10 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Wed, 28 Feb 2024 04:26:37 GMT + recorded_at: Wed, 17 Apr 2024 22:42:14 GMT - request: method: post - uri: https://api.stripe.com/v1/charges/ch_3Ooej04EBxHlGE7s0clvIC9E/refunds + uri: https://api.stripe.com/v1/charges/ch_3P6hAI4EoLbwaGwm0en1nUyd/refunds body: encoding: UTF-8 string: amount=2600&expand[0]=charge @@ -847,17 +868,17 @@ http_interactions: Content-Type: - application/x-www-form-urlencoded Authorization: - - Basic c2tfdGVzdF94RmdKUU9sWHBNQUZzb3p0endGQlRGaFAwMEhHN0J1Q0ptOg== + - "" User-Agent: - Stripe/v1 ActiveMerchantBindings/1.133.0 Stripe-Version: - '2020-08-27' X-Stripe-Client-User-Agent: - - '{"bindings_version":"1.133.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","publisher":"active_merchant"}' + - "" X-Stripe-Client-User-Metadata: - '{"ip":null}' Stripe-Account: - - acct_1Ooeiy4EBxHlGE7s + - acct_1P6hAG4EoLbwaGwm Connection: - close Accept-Encoding: @@ -872,11 +893,11 @@ http_interactions: Server: - nginx Date: - - Wed, 28 Feb 2024 04:26:38 GMT + - Wed, 17 Apr 2024 22:42:15 GMT Content-Type: - application/json Content-Length: - - '4536' + - '4535' Connection: - close Access-Control-Allow-Credentials: @@ -897,14 +918,20 @@ http_interactions: block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" Idempotency-Key: - - e2f17ffc-a2ed-4644-8f70-36bab187d3e9 + - 724001bc-21c7-4ea9-97fe-6b3ef466ac05 Original-Request: - - req_vaOi2rl0Jq2tUI + - req_rCM7IfNML7hG6S + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" Request-Id: - - req_vaOi2rl0Jq2tUI + - req_rCM7IfNML7hG6S Stripe-Account: - - acct_1Ooeiy4EBxHlGE7s + - acct_1P6hAG4EoLbwaGwm Stripe-Should-Retry: - 'false' Stripe-Version: @@ -919,12 +946,12 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "re_3Ooej04EBxHlGE7s044y57wq", + "id": "re_3P6hAI4EoLbwaGwm0akAUmM0", "object": "refund", "amount": 2600, - "balance_transaction": "txn_3Ooej04EBxHlGE7s0x76tB8D", + "balance_transaction": "txn_3P6hAI4EoLbwaGwm0HV1sEts", "charge": { - "id": "ch_3Ooej04EBxHlGE7s0clvIC9E", + "id": "ch_3P6hAI4EoLbwaGwm0en1nUyd", "object": "charge", "amount": 2600, "amount_captured": 2600, @@ -932,7 +959,7 @@ http_interactions: "application": "", "application_fee": null, "application_fee_amount": null, - "balance_transaction": "txn_3Ooej04EBxHlGE7s0eYY617n", + "balance_transaction": "txn_3P6hAI4EoLbwaGwm0FrqlwpQ", "billing_details": { "address": { "city": null, @@ -948,7 +975,7 @@ http_interactions: }, "calculated_statement_descriptor": "OFNOFNOFN", "captured": true, - "created": 1709094395, + "created": 1713393678, "currency": "aud", "customer": null, "description": null, @@ -968,13 +995,13 @@ http_interactions: "network_status": "approved_by_network", "reason": null, "risk_level": "normal", - "risk_score": 26, + "risk_score": 5, "seller_message": "Payment complete.", "type": "authorized" }, "paid": true, - "payment_intent": "pi_3Ooej04EBxHlGE7s0bcV528D", - "payment_method": "pm_1Ooej04EBxHlGE7sU7xdsT0R", + "payment_intent": "pi_3P6hAI4EoLbwaGwm0sUQgKzM", + "payment_method": "pm_1P6hAI4EoLbwaGwmQVOP30ld", "payment_method_details": { "card": { "amount_authorized": 2600, @@ -985,7 +1012,7 @@ http_interactions: "cvc_check": "pass" }, "country": "US", - "exp_month": 2, + "exp_month": 4, "exp_year": 2025, "extended_authorization": { "status": "disabled" @@ -1017,18 +1044,18 @@ http_interactions: "radar_options": {}, "receipt_email": null, "receipt_number": null, - "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xT29laXk0RUJ4SGxHRTdzKP7r-q4GMgYd951VCC46LBZpd1eCBQXvx_HLwJpQoaMklnC6QYgSni4VhYPoAgWqH05kFiAAg46m3yze", + "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xUDZoQUc0RW9MYndhR3dtKMeggbEGMgaBAnXtTzU6LBbNKmageZMos3dLkr8GG17rzn6S5SaQI25HXTOd3pi3Bd0bOoqylhgZQbT2", "refunded": true, "refunds": { "object": "list", "data": [ { - "id": "re_3Ooej04EBxHlGE7s044y57wq", + "id": "re_3P6hAI4EoLbwaGwm0akAUmM0", "object": "refund", "amount": 2600, - "balance_transaction": "txn_3Ooej04EBxHlGE7s0x76tB8D", - "charge": "ch_3Ooej04EBxHlGE7s0clvIC9E", - "created": 1709094397, + "balance_transaction": "txn_3P6hAI4EoLbwaGwm0HV1sEts", + "charge": "ch_3P6hAI4EoLbwaGwm0en1nUyd", + "created": 1713393735, "currency": "aud", "destination_details": { "card": { @@ -1039,7 +1066,7 @@ http_interactions: "type": "card" }, "metadata": {}, - "payment_intent": "pi_3Ooej04EBxHlGE7s0bcV528D", + "payment_intent": "pi_3P6hAI4EoLbwaGwm0sUQgKzM", "reason": null, "receipt_number": null, "source_transfer_reversal": null, @@ -1049,7 +1076,7 @@ http_interactions: ], "has_more": false, "total_count": 1, - "url": "/v1/charges/ch_3Ooej04EBxHlGE7s0clvIC9E/refunds" + "url": "/v1/charges/ch_3P6hAI4EoLbwaGwm0en1nUyd/refunds" }, "review": null, "shipping": null, @@ -1061,7 +1088,7 @@ http_interactions: "transfer_data": null, "transfer_group": null }, - "created": 1709094397, + "created": 1713393735, "currency": "aud", "destination_details": { "card": { @@ -1072,12 +1099,94 @@ http_interactions: "type": "card" }, "metadata": {}, - "payment_intent": "pi_3Ooej04EBxHlGE7s0bcV528D", + "payment_intent": "pi_3P6hAI4EoLbwaGwm0sUQgKzM", "reason": null, "receipt_number": null, "source_transfer_reversal": null, "status": "succeeded", "transfer_reversal": null } - recorded_at: Wed, 28 Feb 2024 04:26:38 GMT + recorded_at: Wed, 17 Apr 2024 22:42:16 GMT +- request: + method: delete + uri: https://api.stripe.com/v1/accounts/acct_1P6hAG4EoLbwaGwm + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/11.1.0 + Authorization: + - "" + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_AmLqrdSk172sQV","request_duration_ms":1530}}' + Stripe-Version: + - '2024-04-10' + X-Stripe-Client-User-Agent: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Wed, 17 Apr 2024 22:42:17 GMT + Content-Type: + - application/json + Content-Length: + - '77' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Faccounts%2F%3Aaccount; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Cross-Origin-Opener-Policy-Report-Only: + - same-origin; report-to="coop" + Report-To: + - '{"group":"coop","max_age":8640,"endpoints":[{"url":"https://q.stripe.com/coop-report"}],"include_subdomains":true}' + Reporting-Endpoints: + - coop="https://q.stripe.com/coop-report" + Request-Id: + - req_j5tuWVNqz8AwVk + Stripe-Account: + - acct_1P6hAG4EoLbwaGwm + Stripe-Version: + - '2024-04-10' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "acct_1P6hAG4EoLbwaGwm", + "object": "account", + "deleted": true + } + recorded_at: Wed, 17 Apr 2024 22:42:17 GMT recorded_with: VCR 6.2.0 diff --git a/spec/helpers/bulk_form_builder_spec.rb b/spec/helpers/bulk_form_builder_spec.rb index 00ab150c2c..2c1bbc23c7 100644 --- a/spec/helpers/bulk_form_builder_spec.rb +++ b/spec/helpers/bulk_form_builder_spec.rb @@ -9,7 +9,7 @@ describe BulkFormBuilder do let(:product) { create(:product) } let(:form) { BulkFormBuilder.new(:product, product, self, {}) } - it { expect(form.text_field(:name)).to_not include "changed" } + it { expect(form.text_field(:name)).not_to include "changed" } context "attribute has been changed" do before { product.assign_attributes name: "updated name" } @@ -19,7 +19,7 @@ describe BulkFormBuilder do context "and saved" do before { product.save } - it { expect(form.text_field(:name)).to_not include "changed" } + it { expect(form.text_field(:name)).not_to include "changed" } end end end diff --git a/spec/helpers/i18n_helper_spec.rb b/spec/helpers/i18n_helper_spec.rb index c91b22f6af..a4117097d4 100644 --- a/spec/helpers/i18n_helper_spec.rb +++ b/spec/helpers/i18n_helper_spec.rb @@ -10,16 +10,6 @@ describe I18nHelper, type: :helper do allow(helper).to receive(:cookies) { cookies } end - # In the real world, the helper is called in every request and sets - # I18n.locale to the chosen locale or the default. For testing purposes we - # have to restore I18n.locale for unit tests that don't call the helper, but - # rely on translated strings. - around do |example| - locale = I18n.locale - example.run - I18n.locale = locale - end - context "as guest" do before do allow(helper).to receive(:spree_current_user) { nil } diff --git a/spec/helpers/injection_helper_spec.rb b/spec/helpers/injection_helper_spec.rb index 75fbb5189c..1c355a5577 100644 --- a/spec/helpers/injection_helper_spec.rb +++ b/spec/helpers/injection_helper_spec.rb @@ -78,6 +78,6 @@ describe InjectionHelper, type: :helper do gateway_customer_profile_id: nil) injected_cards = helper.inject_saved_credit_cards expect(injected_cards).to match "1234" - expect(injected_cards).to_not match "4321" + expect(injected_cards).not_to match "4321" end end diff --git a/spec/helpers/serializer_helper_spec.rb b/spec/helpers/serializer_helper_spec.rb index 16822b89a0..6ba9589abe 100644 --- a/spec/helpers/serializer_helper_spec.rb +++ b/spec/helpers/serializer_helper_spec.rb @@ -4,10 +4,9 @@ require 'spec_helper' describe SerializerHelper, type: :helper do let(:serializer) do - class ExampleEnterpriseSerializer < ActiveModel::Serializer + Class.new(ActiveModel::Serializer) do attributes :id, :name end - ExampleEnterpriseSerializer end describe "#required_attributes" do diff --git a/spec/helpers/shared_helper_spec.rb b/spec/helpers/shared_helper_spec.rb deleted file mode 100644 index 7d61898f93..0000000000 --- a/spec/helpers/shared_helper_spec.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe SharedHelper, type: :helper do - it "does not require emptying the cart when it is empty" do - d = double(:distributor) - order = double(:order, line_items: []) - allow(helper).to receive(:current_order) { order } - expect(helper.distributor_link_class(d)).not_to match(/empties-cart/) - end - - it "does not require emptying the cart when we are on the same distributor" do - d = double(:distributor) - order = double(:order, line_items: [double(:line_item)], distributor: d) - allow(helper).to receive(:current_order) { order } - expect(helper.distributor_link_class(d)).not_to match(/empties-cart/) - end - - it "requires emptying the cart otherwise" do - d1 = double(:distributor) - d2 = double(:distributor) - order = double(:order, line_items: [double(:line_item)], distributor: d2) - allow(helper).to receive(:current_order) { order } - expect(helper.distributor_link_class(d1)).to match(/empties-cart/) - end -end diff --git a/spec/helpers/shop_helper_spec.rb b/spec/helpers/shop_helper_spec.rb index 3050f0b131..1c0bd4df7b 100644 --- a/spec/helpers/shop_helper_spec.rb +++ b/spec/helpers/shop_helper_spec.rb @@ -24,7 +24,7 @@ describe ShopHelper, type: :helper do end it "should not return the groups tab" do - expect(helper.shop_tabs).to_not include(name: "groups", show: true, title: "Groups") + expect(helper.shop_tabs).not_to include(name: "groups", show: true, title: "Groups") end end diff --git a/spec/helpers/spree/admin/base_helper_spec.rb b/spec/helpers/spree/admin/base_helper_spec.rb index e16c8ff730..8930d83d5a 100644 --- a/spec/helpers/spree/admin/base_helper_spec.rb +++ b/spec/helpers/spree/admin/base_helper_spec.rb @@ -21,4 +21,70 @@ describe Spree::Admin::BaseHelper, type: :helper do "name="_method" value="destroy">") end end + + describe "#preference_field_options" do + subject { helper.preference_field_options(options) } + + context 'when type is integer' do + let(:options) { { type: :integer } } + + it 'returns correct options' do + expect(subject).to eq({ size: nil, class: 'input_integer', step: 1, readonly: nil, + disabled: nil }) + end + end + + context 'when type is decimal' do + let(:options) { { type: :decimal } } + + it 'returns correct options' do + expect(subject).to eq({ size: nil, class: 'input_integer', step: :any, readonly: nil, + disabled: nil }) + end + end + + context 'when type is boolean' do + let(:options) { { type: :boolean } } + + it 'returns correct options' do + expect(subject).to eq({ readonly: nil, disabled: nil, size: nil }) + end + end + + context 'when type is password' do + let(:options) { { type: :password } } + + it 'returns correct options' do + expect(subject).to eq({ size: nil, class: 'password_string fullwidth', readonly: nil, + disabled: nil }) + end + end + + context 'when type is text' do + let(:options) { { type: :text } } + + it 'returns correct options' do + expect(subject).to eq({ size: nil, rows: 15, cols: 85, class: 'fullwidth', readonly: nil, + disabled: nil }) + end + end + + context 'when type is string' do + let(:options) { { type: :string } } + + it 'returns correct options' do + expect(subject).to eq({ size: nil, class: 'input_string fullwidth', readonly: nil, + disabled: nil }) + end + end + + context 'when readonly, disabled and size are set' do + let(:options) { { type: :integer, readonly: true, disabled: false, size: 20 } } + + it 'returns correct options' do + expect(subject).to eq({ size: 20, class: 'input_integer', step: 1, readonly: true, + disabled: false }) + end + end + end end diff --git a/spec/helpers/spree/orders_helper_spec.rb b/spec/helpers/spree/orders_helper_spec.rb index 1b47d33a0e..a44bd9afab 100644 --- a/spec/helpers/spree/orders_helper_spec.rb +++ b/spec/helpers/spree/orders_helper_spec.rb @@ -31,6 +31,11 @@ describe Spree::OrdersHelper, type: :helper do before { allow(current_distributor).to receive(:allow_order_changes?) { false } } it { expect(helper.changeable_orders).to eq [] } end + + context "when a current_distributor is not defined" do + let(:current_distributor) { nil } + it { expect(helper.changeable_orders).to eq [] } + end end context "when a current_order_cycle is not defined" do @@ -38,11 +43,6 @@ describe Spree::OrdersHelper, type: :helper do it { expect(helper.changeable_orders).to eq [] } end end - - context "when a current_distributor is not defined" do - let(:current_distributor) { nil } - it { expect(helper.changeable_orders).to eq [] } - end end context "when spree_current_user is not defined" do diff --git a/spec/javascripts/services/option_value_namer_test.js b/spec/javascripts/services/option_value_namer_test.js new file mode 100644 index 0000000000..e7878adae1 --- /dev/null +++ b/spec/javascripts/services/option_value_namer_test.js @@ -0,0 +1,163 @@ +/** + * @jest-environment jsdom + */ + +import OptionValueNamer from "../../../app/webpacker/js/services/option_value_namer"; + +describe("OptionValueNamer", () => { + beforeAll(() => { + // Requires global var from page + global.ofn_available_units_sorted = {"weight":{"1.0":{"name":"g","system":"metric"},"1000.0":{"name":"kg","system":"metric"},"1000000.0":{"name":"T","system":"metric"}},"volume":{"0.001":{"name":"mL","system":"metric"},"1.0":{"name":"L","system":"metric"},"4.54609":{"name":"gal","system":"imperial"},"1000.0":{"name":"kL","system":"metric"}}}; + }) + + describe("generating option value name", function() { + var v, namer; + beforeEach(function() { + v = {}; + var ofn_available_units_sorted = ofn_available_units_sorted; + namer = new OptionValueNamer(v); + }); + + it("when unit is blank (empty items name)", function() { + jest.spyOn(namer, "value_scaled").mockImplementation(() => true); + jest.spyOn(namer, "option_value_value_unit").mockImplementation(() => ["value", ""]); + expect(namer.name()).toBe("value"); + }); + + it("when description is blank", function() { + v.unit_description = null; + jest.spyOn(namer, "value_scaled").mockImplementation(() => true); + jest.spyOn(namer, "option_value_value_unit").mockImplementation(() => ["value", "unit"]); + expect(namer.name()).toBe("valueunit"); + }); + + it("when description is present", function() { + v.unit_description = 'desc'; + jest.spyOn(namer, "option_value_value_unit").mockImplementation(() => ["value", "unit"]); + jest.spyOn(namer, "value_scaled").mockImplementation(() => true); + expect(namer.name()).toBe("valueunit desc"); + }); + + it("when value is blank and description is present", function() { + v.unit_description = 'desc'; + jest.spyOn(namer, "option_value_value_unit").mockImplementation(() => [null, null]); + jest.spyOn(namer, "value_scaled").mockImplementation(() => true); + expect(namer.name()).toBe("desc"); + }); + + it("spaces value and unit when value is unscaled", function() { + v.unit_description = null; + jest.spyOn(namer, "option_value_value_unit").mockImplementation(() => ["value", "unit"]); + jest.spyOn(namer, "value_scaled").mockImplementation(() => false); + expect(namer.name()).toBe("value unit"); + }); + + describe("determining if a variant's value is scaled", function() { + var p; + beforeEach(function() { + p = {}; + v = { product: p }; + namer = new OptionValueNamer(v); + }); + it("returns true when the product has a scale", function() { + p.variant_unit_scale = 1000; + expect(namer.value_scaled()).toBe(true); + }); + it("returns false otherwise", function() { + expect(namer.value_scaled()).toBe(false); + }); + }); + + describe("generating option value's value and unit", function() { + var v, p, namer; + + // Mock I18n. TODO: moved to a shared helper + beforeAll(() => { + const mockedT = jest.fn(); + mockedT.mockImplementation((string, opts) => (string + ', ' + JSON.stringify(opts))); + + global.I18n = { t: mockedT }; + }) + // (jest still doesn't have aroundEach https://github.com/jestjs/jest/issues/4543 ) + afterAll(() => { + delete global.I18n; + }) + + beforeEach(function() { + p = {}; + v = { product: p }; + namer = new OptionValueNamer(v); + }); + it("generates simple values", function() { + p.variant_unit = 'weight'; + p.variant_unit_scale = 1.0; + v.unit_value = 100; + expect(namer.option_value_value_unit()).toEqual([100, 'g']); + }); + it("generates values when unit value is non-integer", function() { + p.variant_unit = 'weight'; + p.variant_unit_scale = 1.0; + v.unit_value = 123.45; + expect(namer.option_value_value_unit()).toEqual([123.45, 'g']); + }); + it("returns a value of 1 when unit value equals the scale", function() { + p.variant_unit = 'weight'; + p.variant_unit_scale = 1000.0; + v.unit_value = 1000.0; + expect(namer.option_value_value_unit()).toEqual([1, 'kg']); + }); + it("generates values for all weight scales", function() { + [[1.0, 'g'], [1000.0, 'kg'], [1000000.0, 'T']].forEach(([scale, unit]) => { + p.variant_unit = 'weight'; + p.variant_unit_scale = scale; + v.unit_value = 100 * scale; + expect(namer.option_value_value_unit()).toEqual([100, unit]); + }); + }); + it("generates values for all volume scales", function() { + [[0.001, 'mL'], [1.0, 'L'], [1000.0, 'kL']].forEach(([scale, unit]) => { + p.variant_unit = 'volume'; + p.variant_unit_scale = scale; + v.unit_value = 100 * scale; + expect(namer.option_value_value_unit()).toEqual([100, unit]); + }); + }); + it("generates right values for volume with rounded values", function() { + var unit; + unit = 'L'; + p.variant_unit = 'volume'; + p.variant_unit_scale = 1.0; + v.unit_value = 0.7; + expect(namer.option_value_value_unit()).toEqual([700, 'mL']); + }); + it("chooses the correct scale when value is very small", function() { + p.variant_unit = 'volume'; + p.variant_unit_scale = 0.001; + v.unit_value = 0.0001; + expect(namer.option_value_value_unit()).toEqual([0.1, 'mL']); + }); + it("generates values for item units", function() { + //TODO + // %w(packet box).each do |unit| + // p = double(:product, variant_unit: 'items', variant_unit_scale: nil, variant_unit_name: unit) + // v.stub(:product) { p } + // v.stub(:unit_value) { 100 } + // subject.option_value_value_unit.should == [100, unit.pluralize] + }); + it("generates singular values for item units when value is 1", function() { + p.variant_unit = 'items'; + p.variant_unit_scale = null; + p.variant_unit_name = 'packet'; + v.unit_value = 1; + expect(namer.option_value_value_unit()).toEqual([1, 'packet']); + }); + it("returns [null, null] when unit value is not set", function() { + p.variant_unit = 'items'; + p.variant_unit_scale = null; + p.variant_unit_name = 'foo'; + v.unit_value = null; + expect(namer.option_value_value_unit()).toEqual([null, null]); + }); + }); + }); +}); diff --git a/spec/javascripts/services/variant_unit_manager_test.js b/spec/javascripts/services/variant_unit_manager_test.js new file mode 100644 index 0000000000..cfd9c6f376 --- /dev/null +++ b/spec/javascripts/services/variant_unit_manager_test.js @@ -0,0 +1,72 @@ +/** + * @jest-environment jsdom + */ + +import VariantUnitManager from "../../../app/webpacker/js/services/variant_unit_manager"; + +describe("VariantUnitManager", function() { + let subject; + + describe("with default units", function() { + beforeAll(() => { + // Requires global var from page + global.ofn_available_units_sorted = { + "weight":{ + "1.0":{"name":"g","system":"metric"},"28.35":{"name":"oz","system":"imperial"},"453.6":{"name":"lb","system":"imperial"},"1000.0":{"name":"kg","system":"metric"},"1000000.0":{"name":"T","system":"metric"} + }, + "volume":{ + "0.001":{"name":"mL","system":"metric"},"1.0":{"name":"L","system":"metric"},"1000.0":{"name":"kL","system":"metric"} + }, + }; + }) + beforeEach(() => { + subject = new VariantUnitManager(); + }) + + describe("getUnitName", function() { + it("returns the unit name based on the scale and unit type (weight/volume) provided", function() { + expect(subject.getUnitName(1, "weight")).toEqual("g"); + expect(subject.getUnitName(1000, "weight")).toEqual("kg"); + expect(subject.getUnitName(1000000, "weight")).toEqual("T"); + expect(subject.getUnitName(0.001, "volume")).toEqual("mL"); + expect(subject.getUnitName(1, "volume")).toEqual("L"); + expect(subject.getUnitName(1000, "volume")).toEqual("kL"); + expect(subject.getUnitName(453.6, "weight")).toEqual("lb"); + expect(subject.getUnitName(28.35, "weight")).toEqual("oz"); + }); + }); + + describe("compatibleUnitScales", function() { + it("returns a sorted set of compatible scales based on the scale and unit type provided", function() { + expect(subject.compatibleUnitScales(1, "weight")).toEqual([1.0, 1000.0, 1000000.0]); + expect(subject.compatibleUnitScales(453.6, "weight")).toEqual([28.35, 453.6]); + expect(subject.compatibleUnitScales(0.001, "volume")).toEqual([0.001, 1.0, 1000.0]); + }); + }); + }); + + describe("should only load available units", function() { + beforeAll(() => { + // Available units: "g,T,mL,L,kL,lb" + global.ofn_available_units_sorted = { + "weight":{ + "1.0":{"name":"g","system":"metric"},"453.6":{"name":"lb","system":"imperial"},"1000000.0":{"name":"T","system":"metric"} + }, + "volume":{ + "0.001":{"name":"mL","system":"metric"},"1.0":{"name":"L","system":"metric"},"1000.0":{"name":"kL","system":"metric"} + }, + }; + }) + beforeEach(() => { + subject = new VariantUnitManager(); + }) + + describe("compatibleUnitScales", function() { + it("returns a sorted set of compatible scales based on the scale and unit type provided", function() { + expect(subject.compatibleUnitScales(1, "weight")).toEqual([1.0, 1000000.0]); + expect(subject.compatibleUnitScales(453.6, "weight")).toEqual([453.6]); + }); + }); + }); +}); + diff --git a/spec/javascripts/stimulus/bulk_form_controller_test.js b/spec/javascripts/stimulus/bulk_form_controller_test.js index 7571191708..82d83c7271 100644 --- a/spec/javascripts/stimulus/bulk_form_controller_test.js +++ b/spec/javascripts/stimulus/bulk_form_controller_test.js @@ -36,6 +36,10 @@ describe("BulkFormController", () => {
+
@@ -47,7 +51,7 @@ describe("BulkFormController", () => { }); describe("marking changed fields", () => { - it("onInput", () => { + it("input: onInput", () => { input1a.value = 'updated1a'; input1a.dispatchEvent(new Event("input")); // Expect only first field to show changed @@ -59,7 +63,23 @@ describe("BulkFormController", () => { input1a.value = 'initial1a'; input1a.dispatchEvent(new Event("input")); expect(input1a.classList).not.toContain('changed'); + }); + it("select: onInput", () => { + // Select a different option (it's the only way in Jest..) + select1.options[0].selected = true; + select1.options[1].selected = false; + select1.dispatchEvent(new Event("input")); + // Expect select to show changed + expect(input1a.classList).not.toContain('changed'); + expect(input1b.classList).not.toContain('changed'); + expect(select1.classList).toContain('changed'); + + // Change back to original value + select1.options[0].selected = false; + select1.options[1].selected = true; + select1.dispatchEvent(new Event("input")); + expect(select1.classList).not.toContain('changed'); }); it("multiple fields", () => { diff --git a/spec/javascripts/stimulus/dropdown_controller_test.js b/spec/javascripts/stimulus/dropdown_controller_test.js index 2f1bceaf4d..9e8c60c5ed 100644 --- a/spec/javascripts/stimulus/dropdown_controller_test.js +++ b/spec/javascripts/stimulus/dropdown_controller_test.js @@ -13,13 +13,20 @@ describe("Dropdown controller", () => { describe("Controller", () => { beforeEach(() => { - document.body.innerHTML = `
- - - - + document.body.innerHTML = `
+
`; }); @@ -27,48 +34,15 @@ describe("Dropdown controller", () => { document.body.innerHTML = ""; }); - it("hide menu by default", () => { - const menu = document.getElementById("menu"); - expect(menu.classList.contains("hidden")).toBe(true); - }); - - it("show menu when toggle and add/remove class on arrow", () => { - const dropdown = document.getElementById("dropdown"); - const arrow = document.getElementById("arrow"); - const menu = document.getElementById("menu"); - expect(menu.classList.contains("hidden")).toBe(true); - expect(arrow.classList.contains("expandedClass")).toBe(false); - expect(arrow.classList.contains("expandedClass2")).toBe(false); - expect(arrow.classList.contains("collapsedClass")).toBe(true); - - dropdown.click(); - - expect(menu.classList.contains("hidden")).toBe(false); - expect(arrow.classList.contains("expandedClass")).toBe(true); - expect(arrow.classList.contains("expandedCLass2")).toBe(true); - expect(arrow.classList.contains("collapsedClass")).toBe(false); - }); - it ("hide menu when click outside", () => { const dropdown = document.getElementById("dropdown"); const menu = document.getElementById("menu"); - dropdown.click(); - expect(menu.classList.contains("hidden")).toBe(false); - + //open the details + dropdown.toggleAttribute('open') + //click elsewhere document.body.click(); - expect(menu.classList.contains("hidden")).toBe(true); - }); - - it ("do not display menu when disabled", () => { - const dropdown = document.getElementById("dropdown"); - const container = document.getElementById("container"); - const menu = document.getElementById("menu"); - container.classList.add("disabled"); - - dropdown.click(); - - expect(menu.classList.contains("hidden")).toBe(true); + expect(dropdown.open).toBe(false); }); }); }); diff --git a/spec/javascripts/stimulus/popout_controller_test.js b/spec/javascripts/stimulus/popout_controller_test.js index 82da807bfb..ddb9f5bb8f 100644 --- a/spec/javascripts/stimulus/popout_controller_test.js +++ b/spec/javascripts/stimulus/popout_controller_test.js @@ -11,24 +11,11 @@ describe("PopoutController", () => { application.register("popout", popout_controller); }); - beforeEach(() => { - document.body.innerHTML = ` -
- - -
- - `; - }); - describe("Show", () => { + beforeEach(() => { + document.body.innerHTML = htmlTemplate(); + }); + it("shows the dialog on click", () => { // button.click(); // For some reason this fails due to passive: true, but works in real life. button.dispatchEvent(new Event("click")); @@ -64,6 +51,10 @@ describe("PopoutController", () => { }); describe("Close", () => { + beforeEach(() => { + document.body.innerHTML = htmlTemplate(); + }); + // For some reason this has to be in a separate block beforeEach(() => { button.dispatchEvent(new Event("click")); // Dialog is open }) @@ -72,14 +63,14 @@ describe("PopoutController", () => { input4.click(); expectToBeClosed(dialog); - expect(button.innerText).toBe("value1"); + expect(button.textContent).toBe("value1"); }); it("closes the dialog when focusing another field (eg with tab)", () => { input4.focus(); expectToBeClosed(dialog); - expect(button.innerText).toBe("value1"); + expect(button.textContent).toBe("value1"); }); it("doesn't close the dialog when focusing internal field", () => { @@ -92,7 +83,8 @@ describe("PopoutController", () => { input2.click(); expectToBeClosed(dialog); - expect(button.innerText).toBe("value1");// The checkbox label should be here, but I just couldn't get the test to work with labels. Don't worry, it works in the browser. + // and includes the checkbox label + expect(button.textContent).toBe("value1,label2"); }); it("doesn't close the dialog when checkbox is unchecked", () => { @@ -111,6 +103,29 @@ describe("PopoutController", () => { expectToBeShown(dialog); // Browser will show a validation message }); + + it("only shows enabled fields in display summary", () => { + input1.disabled = true; + input2.click(); // checkbox selected + + expectToBeClosed(dialog); + expect(button.textContent).toBe("label2"); + }); + }); + + describe("disable update-display", () => { + beforeEach(() => { + document.body.innerHTML = htmlTemplate({updateDisplay: "false" }); + }) + + it("doesn't update display value", () => { + expect(button.textContent).toBe("On demand"); + button.dispatchEvent(new Event("click")); // Dialog is open + input4.click(); //close dialog + + expectToBeClosed(dialog); + expect(button.textContent).toBe("On demand"); + }); }); describe("Cleaning up", () => { @@ -118,6 +133,23 @@ describe("PopoutController", () => { }); }); +function htmlTemplate(opts = {updateDisplay: ""}) { + return ` +
+ + +
+ + `; +} + function expectToBeShown(element) { expect(element.style.display).toBe("block"); } diff --git a/spec/javascripts/stimulus/product_controller_test.js b/spec/javascripts/stimulus/product_controller_test.js new file mode 100644 index 0000000000..bcd4f8bdad --- /dev/null +++ b/spec/javascripts/stimulus/product_controller_test.js @@ -0,0 +1,56 @@ +/** + * @jest-environment jsdom + */ + +import { Application } from "stimulus"; +import product_controller from "../../../app/webpacker/controllers/product_controller"; + +describe("ProductController", () => { + beforeAll(() => { + const application = Application.start(); + application.register("product", product_controller); + }); + + describe("variant_unit_with_scale", () => { + beforeEach(() => { + document.body.innerHTML = ` +
+ + + +
+ `; + }); + + describe("change", () => { + it("weight_1000", () => { + variant_unit_with_scale.selectedIndex = 1; + variant_unit_with_scale.dispatchEvent(new Event("change")); + + expect(variant_unit.value).toBe("weight"); + expect(variant_unit_scale.value).toBe("1000"); + }); + + it("volume_4.54609", () => { + variant_unit_with_scale.selectedIndex = 2; + variant_unit_with_scale.dispatchEvent(new Event("change")); + + expect(variant_unit.value).toBe("volume"); + expect(variant_unit_scale.value).toBe("4.54609"); + }); + + it("items", () => { + variant_unit_with_scale.selectedIndex = 3; + variant_unit_with_scale.dispatchEvent(new Event("change")); + + expect(variant_unit.value).toBe("items"); + expect(variant_unit_scale.value).toBe(""); + }); + }) + }); +}); diff --git a/spec/javascripts/stimulus/toggle_control_controller_test.js b/spec/javascripts/stimulus/toggle_control_controller_test.js index 412ec9e7ee..dca6e3df0e 100644 --- a/spec/javascripts/stimulus/toggle_control_controller_test.js +++ b/spec/javascripts/stimulus/toggle_control_controller_test.js @@ -61,6 +61,7 @@ describe("ToggleControlController", () => { }); }); }); + describe("#enableIfPresent", () => { describe("with input", () => { beforeEach(() => { @@ -88,6 +89,35 @@ describe("ToggleControlController", () => { }); }); }); + + describe("#displayIfMatch", () => { + describe("with select", () => { + beforeEach(() => { + document.body.innerHTML = `
+ + +
`; + }); + + it("Shows when match is selected", () => { + select.value = "items" + select.dispatchEvent(new Event("change")); + + expect(control.style.display).toBe("block"); + }); + + it("Hides when match is not selected", () => { + select.value = "weight_1" + select.dispatchEvent(new Event("change")); + + expect(control.style.display).toBe("none"); + }); + }); + }); + describe("#toggleDisplay", () => { beforeEach(() => { document.body.innerHTML = `
@@ -108,6 +138,7 @@ describe("ToggleControlController", () => { expect(content.style.display).toBe("block"); }); }); + describe("#toggleAdvancedSettings", () => { beforeEach(() => { document.body.innerHTML = ` diff --git a/spec/javascripts/unit/admin/bulk_product_update_spec.js.coffee b/spec/javascripts/unit/admin/bulk_product_update_spec.js.coffee index aa56ccd595..57f6225110 100644 --- a/spec/javascripts/unit/admin/bulk_product_update_spec.js.coffee +++ b/spec/javascripts/unit/admin/bulk_product_update_spec.js.coffee @@ -803,8 +803,8 @@ describe "AdminProductEditCtrl", -> expect(product).toEqual id: 123 variants: [ - {id: -1, price: null, unit_value: null, tax_category_id: null, unit_description: null, on_demand: false, on_hand: null, display_as: null, display_name: null} - {id: -2, price: null, unit_value: null, tax_category_id: null, unit_description: null, on_demand: false, on_hand: null, display_as: null, display_name: null} + {id: -1, price: null, unit_value: null, tax_category_id: null, unit_description: null, on_demand: false, on_hand: null, display_as: null, display_name: null, category_id: null} + {id: -2, price: null, unit_value: null, tax_category_id: null, unit_description: null, on_demand: false, on_hand: null, display_as: null, display_name: null, category_id: null} ] it "shows the variant(s)", -> diff --git a/spec/jobs/bulk_invoice_job_spec.rb b/spec/jobs/bulk_invoice_job_spec.rb index ace4234103..907749033c 100644 --- a/spec/jobs/bulk_invoice_job_spec.rb +++ b/spec/jobs/bulk_invoice_job_spec.rb @@ -5,45 +5,36 @@ require 'spec_helper' describe BulkInvoiceJob do subject { BulkInvoiceJob.new(order_ids, "/tmp/file/path") } - describe "#sorted_orders" do - let(:order1) { build(:order, id: 1) } - let(:order2) { build(:order, id: 2) } - let(:order3) { build(:order, id: 3) } - let(:order_ids) { [3, 1, 2] } - - it "returns results in their original order" do - expect(Spree::Order).to receive(:where).and_return([order1, order2, order3]) - - expect(subject.__send__(:sorted_orders, order_ids)).to eq [order3, order1, order2] - end - end - context "when invoices are enabled", feature: :invoices do describe "#perform" do let!(:order1) { create(:shipped_order) } - let!(:order2) { create(:order_with_line_items) } + let!(:order2) { create(:shipped_order) } let!(:order3) { create(:order_ready_to_ship) } - let(:order_ids) { [order1.id, order2.id, order3.id] } + let(:order_ids) { [order3.id, order1.id, order2.id] } let(:path){ "/tmp/file/path.pdf" } + before do allow(TermsOfServiceFile).to receive(:current_url).and_return("http://example.com/terms.pdf") order3.cancel order3.resume end - it "should generate invoices for invoiceable orders only" do + + it "should generate invoices for given order ids" do expect{ subject.perform(order_ids, path) }.to change{ order1.invoices.count }.from(0).to(1) - .and change{ order2.invoices.count }.by(0) + .and change{ order2.invoices.count }.from(0).to(1) .and change{ order3.invoices.count }.from(0).to(1) - File.open(path, "rb") do |io| + pages = File.open(path, "rb") do |io| reader = PDF::Reader.new(io) - content = reader.pages.map(&:text).join("\n") - expect(content).to include(order1.number) - expect(content).to include(order3.number) - expect(content).not_to include(order2.number) + reader.pages.map(&:text) end + + # Pages should be in the order of order ids given: + expect(pages[0]).to include(order3.number) + expect(pages[1]).to include(order1.number) + expect(pages[2]).to include(order2.number) end end end diff --git a/spec/jobs/connect_app_job_spec.rb b/spec/jobs/connect_app_job_spec.rb index 8491a0004d..0dd232d14f 100644 --- a/spec/jobs/connect_app_job_spec.rb +++ b/spec/jobs/connect_app_job_spec.rb @@ -8,7 +8,7 @@ RSpec.describe ConnectAppJob, type: :job do let(:app) { ConnectedApp.new(enterprise: ) } let(:enterprise) { build(:enterprise, id: 3, owner: user) } let(:user) { build(:user, spree_api_key: "12345") } - let(:url) { "https://n8n.openfoodnetwork.org.uk/webhook/regen/connect-enterprise" } + let(:url) { "https://n8n.openfoodnetwork.org/webhook/regen/connect-enterprise" } it "sends a semantic id and access token" do stub_request(:post, url).to_return(body: '{}') diff --git a/spec/jobs/order_cycle_closing_job_spec.rb b/spec/jobs/order_cycle_closing_job_spec.rb index 1495fd2111..33be226c24 100644 --- a/spec/jobs/order_cycle_closing_job_spec.rb +++ b/spec/jobs/order_cycle_closing_job_spec.rb @@ -15,8 +15,8 @@ describe OrderCycleClosingJob do it "sends notifications for recently closed order cycles with automatic notifications enabled" do expect(OrderCycleNotificationJob).to receive(:perform_later).with(order_cycle1.id) - expect(OrderCycleNotificationJob).to_not receive(:perform_later).with(order_cycle2.id) - expect(OrderCycleNotificationJob).to_not receive(:perform_later).with(order_cycle3.id) + expect(OrderCycleNotificationJob).not_to receive(:perform_later).with(order_cycle2.id) + expect(OrderCycleNotificationJob).not_to receive(:perform_later).with(order_cycle3.id) OrderCycleClosingJob.perform_now end diff --git a/spec/jobs/order_cycle_opened_job_spec.rb b/spec/jobs/order_cycle_opened_job_spec.rb index 948abf5029..b0ebfbe927 100644 --- a/spec/jobs/order_cycle_opened_job_spec.rb +++ b/spec/jobs/order_cycle_opened_job_spec.rb @@ -14,14 +14,14 @@ describe OrderCycleOpenedJob do } it "enqueues jobs for recently opened order cycles only" do - expect(OrderCycleWebhookService) + expect(OrderCycles::WebhookService) .to receive(:create_webhook_job).with(oc_opened_now, 'order_cycle.opened') - expect(OrderCycleWebhookService) - .to_not receive(:create_webhook_job).with(oc_opened_before, 'order_cycle.opened') + expect(OrderCycles::WebhookService) + .not_to receive(:create_webhook_job).with(oc_opened_before, 'order_cycle.opened') - expect(OrderCycleWebhookService) - .to_not receive(:create_webhook_job).with(oc_opening_soon, 'order_cycle.opened') + expect(OrderCycles::WebhookService) + .not_to receive(:create_webhook_job).with(oc_opening_soon, 'order_cycle.opened') OrderCycleOpenedJob.perform_now end @@ -41,7 +41,7 @@ describe OrderCycleOpenedJob do end ) - expect(OrderCycleWebhookService) + expect(OrderCycles::WebhookService) .to receive(:create_webhook_job).with(oc_opened_now, 'order_cycle.opened').once # Start two jobs in parallel: diff --git a/spec/jobs/report_job_spec.rb b/spec/jobs/report_job_spec.rb index 14807c6578..399cbcbbb6 100644 --- a/spec/jobs/report_job_spec.rb +++ b/spec/jobs/report_job_spec.rb @@ -25,7 +25,7 @@ describe ReportJob do it "enqueues a job for async processing" do expect { ReportJob.perform_later(**report_args) - }.to_not change { ActiveStorage::Blob.count } + }.not_to change { ActiveStorage::Blob.count } expect { perform_enqueued_jobs(only: ReportJob) @@ -76,7 +76,7 @@ describe ReportJob do # rspec-rails: https://github.com/rspec/rspec-rails/issues/2668 ReportJob.perform_later(**report_args) perform_enqueued_jobs(only: ReportJob) - }.to_not enqueue_mail + }.not_to enqueue_mail end it "rescues errors" do @@ -87,7 +87,7 @@ describe ReportJob do expect { perform_enqueued_jobs(only: ReportJob) - }.to_not raise_error + }.not_to raise_error end def expect_csv_report diff --git a/spec/jobs/subscription_confirm_job_spec.rb b/spec/jobs/subscription_confirm_job_spec.rb index ff96e97a60..d5cf92c40c 100644 --- a/spec/jobs/subscription_confirm_job_spec.rb +++ b/spec/jobs/subscription_confirm_job_spec.rb @@ -25,7 +25,7 @@ describe SubscriptionConfirmJob do let(:proxy_orders) { job.send(:unconfirmed_proxy_orders) } before do - OrderWorkflow.new(order).complete! + Orders::WorkflowService.new(order).complete! end it "returns proxy orders that meet all of the criteria" do @@ -44,38 +44,38 @@ describe SubscriptionConfirmJob do it "ignores proxy orders where the OC closed more than 1 hour ago" do proxy_order.update!(order_cycle_id: order_cycle2.id) - expect(proxy_orders).to_not include proxy_order + expect(proxy_orders).not_to include proxy_order end it "ignores cancelled proxy orders" do proxy_order.update!(canceled_at: 5.minutes.ago) - expect(proxy_orders).to_not include proxy_order + expect(proxy_orders).not_to include proxy_order end it "ignores proxy orders without a completed order" do proxy_order.order.completed_at = nil proxy_order.order.save! - expect(proxy_orders).to_not include proxy_order + expect(proxy_orders).not_to include proxy_order end it "ignores proxy orders without an associated order" do proxy_order.update!(order_id: nil) - expect(proxy_orders).to_not include proxy_order + expect(proxy_orders).not_to include proxy_order end it "ignores proxy orders that haven't been placed yet" do proxy_order.update!(placed_at: nil) - expect(proxy_orders).to_not include proxy_order + expect(proxy_orders).not_to include proxy_order end it "ignores proxy orders that have already been confirmed" do proxy_order.update!(confirmed_at: 1.second.ago) - expect(proxy_orders).to_not include proxy_order + expect(proxy_orders).not_to include proxy_order end it "ignores orders that have been cancelled" do proxy_order.order.cancel! - expect(proxy_orders).to_not include proxy_order + expect(proxy_orders).not_to include proxy_order end end @@ -126,7 +126,7 @@ describe SubscriptionConfirmJob do "or updated_at date is within the last hour" do order_cycles = job.send(:recently_closed_order_cycles) expect(order_cycles).to include order_cycle3, order_cycle4 - expect(order_cycles).to_not include order_cycle1, order_cycle2, order_cycle5 + expect(order_cycles).not_to include order_cycle1, order_cycle2, order_cycle5 end end @@ -140,7 +140,7 @@ describe SubscriptionConfirmJob do let(:order) { proxy_order.initialise_order! } before do - OrderWorkflow.new(order).complete! + Orders::WorkflowService.new(order).complete! allow(job).to receive(:send_confirmation_email).and_call_original allow(job).to receive(:send_payment_authorization_emails).and_call_original expect(job).to receive(:record_order) @@ -215,7 +215,7 @@ describe SubscriptionConfirmJob do it "sends a failed payment email" do expect(job).to receive(:send_failed_payment_email) - expect(job).to_not receive(:send_confirmation_email) + expect(job).not_to receive(:send_confirmation_email) job.send(:confirm_order!, order) end end @@ -231,8 +231,8 @@ describe SubscriptionConfirmJob do it "sends a failed payment email" do expect(job).to receive(:send_failed_payment_email) - expect(job).to_not receive(:send_confirmation_email) - expect(job).to_not receive(:send_payment_authorization_emails) + expect(job).not_to receive(:send_confirmation_email) + expect(job).not_to receive(:send_payment_authorization_emails) job.send(:confirm_order!, order) end end @@ -248,7 +248,7 @@ describe SubscriptionConfirmJob do it "sends only a subscription confirm email, no regular confirmation emails" do expect{ job.send(:confirm_order!, order) } - .to_not have_enqueued_mail(Spree::OrderMailer, :confirm_email_for_customer) + .not_to have_enqueued_mail(Spree::OrderMailer, :confirm_email_for_customer) expect(job).to have_received(:send_confirmation_email).once end diff --git a/spec/jobs/subscription_placement_job_spec.rb b/spec/jobs/subscription_placement_job_spec.rb index db71c53c14..c6bb6c232b 100644 --- a/spec/jobs/subscription_placement_job_spec.rb +++ b/spec/jobs/subscription_placement_job_spec.rb @@ -27,27 +27,27 @@ describe SubscriptionPlacementJob do it "ignores proxy orders where the OC has closed" do expect(job.send(:proxy_orders)).to include proxy_order proxy_order.update!(order_cycle_id: order_cycle2.id) - expect(job.send(:proxy_orders)).to_not include proxy_order + expect(job.send(:proxy_orders)).not_to include proxy_order end it "ignores proxy orders for paused or cancelled subscriptions" do expect(job.send(:proxy_orders)).to include proxy_order subscription.update!(paused_at: 1.minute.ago) - expect(job.send(:proxy_orders)).to_not include proxy_order + expect(job.send(:proxy_orders)).not_to include proxy_order subscription.update!(paused_at: nil) expect(job.send(:proxy_orders)).to include proxy_order subscription.update!(canceled_at: 1.minute.ago) - expect(job.send(:proxy_orders)).to_not include proxy_order + expect(job.send(:proxy_orders)).not_to include proxy_order end it "ignores proxy orders that have been marked as cancelled or placed" do expect(job.send(:proxy_orders)).to include proxy_order proxy_order.update!(canceled_at: 5.minutes.ago) - expect(job.send(:proxy_orders)).to_not include proxy_order + expect(job.send(:proxy_orders)).not_to include proxy_order proxy_order.update!(canceled_at: nil) expect(job.send(:proxy_orders)).to include proxy_order proxy_order.update!(placed_at: 5.minutes.ago) - expect(job.send(:proxy_orders)).to_not include proxy_order + expect(job.send(:proxy_orders)).not_to include proxy_order end end @@ -108,7 +108,7 @@ describe SubscriptionPlacementJob do let!(:exchange_fee) { ExchangeFee.create!(exchange: ex, enterprise_fee: fee) } before do - expect_any_instance_of(Spree::Payment).to_not receive(:process!) + expect_any_instance_of(Spree::Payment).not_to receive(:process!) allow_any_instance_of(PlaceProxyOrder).to receive(:send_placement_email) allow_any_instance_of(PlaceProxyOrder).to receive(:send_empty_email) end @@ -136,7 +136,7 @@ describe SubscriptionPlacementJob do expect(proxy_order.order.total).to eq 0 expect(proxy_order.order.adjustment_total).to eq 0 - expect(service).to_not have_received(:send_placement_email) + expect(service).not_to have_received(:send_placement_email) expect(service).to have_received(:send_empty_email) end end @@ -162,7 +162,7 @@ describe SubscriptionPlacementJob do it "does not enqueue confirmation emails" do expect{ service.call } - .to_not have_enqueued_mail(Spree::OrderMailer, :confirm_email_for_customer) + .not_to have_enqueued_mail(Spree::OrderMailer, :confirm_email_for_customer) expect(service).to have_received(:send_placement_email).once end @@ -171,7 +171,7 @@ describe SubscriptionPlacementJob do before { allow(service).to receive(:move_to_completion).and_raise(StandardError) } it "records an error and does not attempt to send an email" do - expect(service).to_not receive(:send_placement_email) + expect(service).not_to receive(:send_placement_email) expect(summarizer).to receive(:record_and_log_error).once service.call end diff --git a/spec/lib/haml_up_spec.rb b/spec/lib/haml_up_spec.rb new file mode 100644 index 0000000000..0df7c56642 --- /dev/null +++ b/spec/lib/haml_up_spec.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +require 'spec_helper' +require 'haml_up' + +describe HamlUp, skip: !Gem::Dependency.new("", "~> 5.2").match?("", Haml::VERSION) do + describe "#rewrite_template" do + it "preserves a simple template" do + original = "%p This is a paragraph" + template = call(original) + expect(template).to eq original + end + + it "rewrites non-standard attribute hashes" do + original = "%p{ng: {click: 'action', show: 'condition'}} label" + template = call(original) + expect(template).to eq "%p{ \"ng-click\": 'action', \"ng-show\": 'condition' } label" + end + + it "preserves standard attribute hashes" do + original = "%p{data: {click: 'action', show: 'condition'}} label" + template = call(original) + expect(template).to eq original + end + + it "preserves standard attribute hashes while rewriting others" do + original = "%p{data: {click: 'standard'}, ng: {click: 'not'}} label" + template = call(original) + expect(template).to eq "%p{ data: {click: 'standard'}, \"ng-click\": 'not' } label" + end + + it "rewrites multi-line attributes" do + original = <<~HAML + %li{ ng: { class: "{active: selector.active}" } } + %a{ tooltip: "{{selector.object.value}}", "tooltip-placement": "bottom", + ng: { transclude: true, class: "{active: selector.active, 'has-tip': selector.object.value}" } } + HAML + expected = <<~HAML + %li{ "ng-class": "{active: selector.active}" } + %a{ tooltip: "{{selector.object.value}}", "tooltip-placement": "bottom", "ng-transclude": true, "ng-class": "{active: selector.active, 'has-tip': selector.object.value}" } + HAML + template = call(original) + expect(template).to eq expected + end + + def call(original) + original.dup.tap { |t| subject.rewrite_template(t) } + end + end +end diff --git a/spec/lib/open_food_network/order_cycle_form_applicator_spec.rb b/spec/lib/open_food_network/order_cycle_form_applicator_spec.rb index c937397dcb..96314aa674 100644 --- a/spec/lib/open_food_network/order_cycle_form_applicator_spec.rb +++ b/spec/lib/open_food_network/order_cycle_form_applicator_spec.rb @@ -185,7 +185,7 @@ module OpenFoodNetwork before { allow(applicator).to receive(:manages_coordinator?) { false } } it "does not destroy any exchanges" do - expect(applicator).to_not receive(:with_permission) + expect(applicator).not_to receive(:with_permission) applicator.send(:destroy_untouched_exchanges) end end @@ -238,26 +238,26 @@ module OpenFoodNetwork expect(ids).to include v1.id # Does not add variants that are not editable - expect(ids).to_not include v2.id + expect(ids).not_to include v2.id # Keeps existing variants, when they are explicitly mentioned in the request expect(ids).to include v3.id # Removes existing variants that are editable, when they are not mentioned in the request - expect(ids).to_not include v4.id + expect(ids).not_to include v4.id # Removes existing variants that are editable, when the request explicitly removes them - expect(ids).to_not include v5.id + expect(ids).not_to include v5.id # Keeps existing variants that are not editable expect(ids).to include v6.id # Removes existing variants that are not in an incoming exchange, # regardless of whether they are not editable - expect(ids).to_not include v7.id, v8.id + expect(ids).not_to include v7.id, v8.id # Does not add variants that are not in an incoming exchange - expect(ids).to_not include v9.id + expect(ids).not_to include v9.id end end @@ -300,7 +300,7 @@ module OpenFoodNetwork expect(ids).to include v1.id # Does not add variants that are not editable - expect(ids).to_not include v2.id + expect(ids).not_to include v2.id # Keeps existing variants, if they are editable and requested expect(ids).to include v3.id @@ -309,13 +309,13 @@ module OpenFoodNetwork expect(ids).to include v4.id # Removes existing variants that are editable, when the request explicitly removes them - expect(ids).to_not include v5.id + expect(ids).not_to include v5.id # Keeps existing variants that are not editable expect(ids).to include v6.id # Removes existing variants that are editable, when they are not mentioned in the request - expect(ids).to_not include v7.id + expect(ids).not_to include v7.id end end @@ -500,8 +500,8 @@ module OpenFoodNetwork exchange.reload expect(exchange.variants).to match_array [variant1, variant3] expect(exchange.enterprise_fees).to match_array [enterprise_fee1, enterprise_fee2] - expect(exchange.pickup_time).to_not eq 'New Pickup Time' - expect(exchange.pickup_instructions).to_not eq 'New Pickup Instructions' + expect(exchange.pickup_time).not_to eq 'New Pickup Time' + expect(exchange.pickup_instructions).not_to eq 'New Pickup Instructions' expect(exchange.tag_list).to eq [] expect(applicator.send(:touched_exchanges)).to eq [exchange] end diff --git a/spec/lib/open_food_network/order_cycle_permissions_spec.rb b/spec/lib/open_food_network/order_cycle_permissions_spec.rb index 6dcfbd4394..d7d3f93c40 100644 --- a/spec/lib/open_food_network/order_cycle_permissions_spec.rb +++ b/spec/lib/open_food_network/order_cycle_permissions_spec.rb @@ -48,7 +48,7 @@ module OpenFoodNetwork it "returns enterprises which have granted P-OC to the coordinator" do enterprises = permissions.visible_enterprises expect(enterprises).to include hub - expect(enterprises).to_not include producer + expect(enterprises).not_to include producer end end @@ -56,7 +56,7 @@ module OpenFoodNetwork before { allow(coordinator).to receive(:sells) { 'own' } } it "returns just the coordinator" do enterprises = permissions.visible_enterprises - expect(enterprises).to_not include hub, producer + expect(enterprises).not_to include hub, producer end end end @@ -83,7 +83,7 @@ module OpenFoodNetwork before { allow(coordinator).to receive(:sells) { 'own' } } it "returns just the coordinator" do enterprises = permissions.visible_enterprises - expect(enterprises).to_not include hub, producer + expect(enterprises).not_to include hub, producer end end end @@ -91,7 +91,7 @@ module OpenFoodNetwork context "where the other enterprises are not in the order cycle" do it "returns just the coordinator" do enterprises = permissions.visible_enterprises - expect(enterprises).to_not include hub, producer + expect(enterprises).not_to include hub, producer end end end @@ -117,7 +117,7 @@ module OpenFoodNetwork it "returns my hub" do enterprises = permissions.visible_enterprises expect(enterprises).to include hub - expect(enterprises).to_not include producer, coordinator + expect(enterprises).not_to include producer, coordinator end context "and has been granted P-OC by a producer" do @@ -143,7 +143,7 @@ module OpenFoodNetwork it "does not return the producer" do enterprises = permissions.visible_enterprises - expect(enterprises).to_not include producer + expect(enterprises).not_to include producer end end end @@ -171,7 +171,7 @@ module OpenFoodNetwork it "does not return the producer" do enterprises = permissions.visible_enterprises - expect(enterprises).to_not include producer + expect(enterprises).not_to include producer end end end @@ -182,7 +182,7 @@ module OpenFoodNetwork it "does not return my hub" do enterprises = permissions.visible_enterprises - expect(enterprises).to_not include hub, producer, coordinator + expect(enterprises).not_to include hub, producer, coordinator end end end @@ -190,7 +190,7 @@ module OpenFoodNetwork context "that has not granted P-OC to the coordinator" do it "does not return my hub" do enterprises = permissions.visible_enterprises - expect(enterprises).to_not include hub, producer, coordinator + expect(enterprises).not_to include hub, producer, coordinator end context "but is already in the order cycle" do @@ -202,7 +202,7 @@ module OpenFoodNetwork it "returns my hub" do enterprises = permissions.visible_enterprises expect(enterprises).to include hub - expect(enterprises).to_not include producer, coordinator + expect(enterprises).not_to include producer, coordinator end context "and distributes variants distributed by an unmanaged & unpermitted producer" do @@ -214,7 +214,7 @@ module OpenFoodNetwork it "returns that producer as well" do enterprises = permissions.visible_enterprises expect(enterprises).to include producer, hub - expect(enterprises).to_not include coordinator + expect(enterprises).not_to include coordinator end end end @@ -241,7 +241,7 @@ module OpenFoodNetwork it "returns my producer" do enterprises = permissions.visible_enterprises expect(enterprises).to include producer - expect(enterprises).to_not include hub, coordinator + expect(enterprises).not_to include hub, coordinator end context "and has been granted P-OC by a hub" do @@ -259,7 +259,7 @@ module OpenFoodNetwork it "returns the hub as well" do enterprises = permissions.visible_enterprises expect(enterprises).to include producer, hub - expect(enterprises).to_not include coordinator + expect(enterprises).not_to include coordinator end end @@ -268,7 +268,7 @@ module OpenFoodNetwork it "does not return the hub" do enterprises = permissions.visible_enterprises - expect(enterprises).to_not include hub + expect(enterprises).not_to include hub end end end @@ -288,7 +288,7 @@ module OpenFoodNetwork it "returns the hub as well" do enterprises = permissions.visible_enterprises expect(enterprises).to include producer, hub - expect(enterprises).to_not include coordinator + expect(enterprises).not_to include coordinator end end @@ -297,7 +297,7 @@ module OpenFoodNetwork it "does not return the hub" do enterprises = permissions.visible_enterprises - expect(enterprises).to_not include hub + expect(enterprises).not_to include hub end end end @@ -308,7 +308,7 @@ module OpenFoodNetwork it "does not return my producer" do enterprises = permissions.visible_enterprises - expect(enterprises).to_not include hub, producer, coordinator + expect(enterprises).not_to include hub, producer, coordinator end end end @@ -316,7 +316,7 @@ module OpenFoodNetwork context "which has not granted P-OC to the coordinator" do it "does not return my producer" do enterprises = permissions.visible_enterprises - expect(enterprises).to_not include producer + expect(enterprises).not_to include producer end context "but is already in the order cycle" do @@ -329,7 +329,7 @@ module OpenFoodNetwork it "returns my producer" do enterprises = permissions.visible_enterprises expect(enterprises).to include producer - expect(enterprises).to_not include hub, coordinator + expect(enterprises).not_to include hub, coordinator end context "and has variants distributed by an outgoing hub" do @@ -346,7 +346,7 @@ module OpenFoodNetwork it "returns that hub as well" do enterprises = permissions.visible_enterprises expect(enterprises).to include producer, hub - expect(enterprises).to_not include coordinator + expect(enterprises).not_to include coordinator end end end @@ -527,7 +527,7 @@ module OpenFoodNetwork it "returns all variants belonging to the sending producer" do visible = permissions.visible_variants_for_incoming_exchanges_from(producer1) expect(visible).to include v1 - expect(visible).to_not include v2 + expect(visible).not_to include v2 end end @@ -541,7 +541,7 @@ module OpenFoodNetwork it "returns all variants belonging to the sending producer" do visible = permissions.visible_variants_for_incoming_exchanges_from(producer1) expect(visible).to include v1 - expect(visible).to_not include v2 + expect(visible).not_to include v2 end end @@ -561,7 +561,7 @@ module OpenFoodNetwork it "returns variants produced by that producer only" do visible = permissions.visible_variants_for_incoming_exchanges_from(producer1) expect(visible).to include v1 - expect(visible).to_not include v2 + expect(visible).not_to include v2 end end @@ -570,7 +570,7 @@ module OpenFoodNetwork it "does not return variants produced by that producer" do visible = permissions.visible_variants_for_incoming_exchanges_from(producer1) - expect(visible).to_not include v1, v2 + expect(visible).not_to include v1, v2 end end end @@ -589,7 +589,7 @@ module OpenFoodNetwork it "returns all variants of any producer which has granted the outgoing hub P-OC" do visible = permissions.visible_variants_for_outgoing_exchanges_to(hub) expect(visible).to include v1 - expect(visible).to_not include v2 + expect(visible).not_to include v2 end context "where the coordinator produces products" do @@ -598,14 +598,14 @@ module OpenFoodNetwork it "returns any variants produced by the coordinator itself for exchanges w/ 'self'" do visible = permissions.visible_variants_for_outgoing_exchanges_to(coordinator) expect(visible).to include v3 - expect(visible).to_not include v1, v2 + expect(visible).not_to include v1, v2 end it "does not return coordinator's variants for exchanges with other hubs, " \ "when permission has not been granted" do visible = permissions.visible_variants_for_outgoing_exchanges_to(hub) expect(visible).to include v1 - expect(visible).to_not include v2, v3 + expect(visible).not_to include v2, v3 end end @@ -637,7 +637,7 @@ module OpenFoodNetwork it "returns all variants of any producer which has granted the outgoing hub P-OC" do visible = permissions.visible_variants_for_outgoing_exchanges_to(hub) expect(visible).to include v1 - expect(visible).to_not include v2 + expect(visible).not_to include v2 end context "where the hub produces products" do @@ -686,7 +686,7 @@ module OpenFoodNetwork it "returns all of my produced variants" do visible = permissions.visible_variants_for_outgoing_exchanges_to(hub) expect(visible).to include v1 - expect(visible).to_not include v2 + expect(visible).not_to include v2 end end @@ -695,7 +695,7 @@ module OpenFoodNetwork it "does not return my variants" do visible = permissions.visible_variants_for_outgoing_exchanges_to(hub) - expect(visible).to_not include v1, v2 + expect(visible).not_to include v1, v2 end end end @@ -726,7 +726,7 @@ module OpenFoodNetwork it "returns those variants that are in the exchange" do visible = permissions.visible_variants_for_outgoing_exchanges_to(hub) - expect(visible).to_not include v1, v3 + expect(visible).not_to include v1, v3 expect(visible).to include v2 end end @@ -752,7 +752,7 @@ module OpenFoodNetwork it "returns all variants belonging to the sending producer" do visible = permissions.editable_variants_for_incoming_exchanges_from(producer1) expect(visible).to include v1 - expect(visible).to_not include v2 + expect(visible).not_to include v2 end end @@ -766,7 +766,7 @@ module OpenFoodNetwork it "returns all variants belonging to the sending producer" do visible = permissions.editable_variants_for_incoming_exchanges_from(producer1) expect(visible).to include v1 - expect(visible).to_not include v2 + expect(visible).not_to include v2 end end @@ -779,7 +779,7 @@ module OpenFoodNetwork it "does not return variants produced by that producer" do visible = permissions.editable_variants_for_incoming_exchanges_from(producer1) - expect(visible).to_not include v1, v2 + expect(visible).not_to include v1, v2 end end end @@ -797,7 +797,7 @@ module OpenFoodNetwork it "returns all variants of any producer which has granted the outgoing hub P-OC" do visible = permissions.editable_variants_for_outgoing_exchanges_to(hub) expect(visible).to include v1 - expect(visible).to_not include v2 + expect(visible).not_to include v2 end context "where the coordinator produces products" do @@ -806,14 +806,14 @@ module OpenFoodNetwork it "returns any variants produced by the coordinator itself for exchanges w/ 'self'" do visible = permissions.editable_variants_for_outgoing_exchanges_to(coordinator) expect(visible).to include v3 - expect(visible).to_not include v1, v2 + expect(visible).not_to include v1, v2 end it "does not return coordinator's variants for exchanges with other hubs, " \ "when permission has not been granted" do visible = permissions.editable_variants_for_outgoing_exchanges_to(hub) expect(visible).to include v1 - expect(visible).to_not include v2, v3 + expect(visible).not_to include v2, v3 end end @@ -844,7 +844,7 @@ module OpenFoodNetwork it "returns all variants of any producer which has granted the outgoing hub P-OC" do visible = permissions.editable_variants_for_outgoing_exchanges_to(hub) expect(visible).to include v1 - expect(visible).to_not include v2 + expect(visible).not_to include v2 end context "where the hub produces products" do @@ -899,7 +899,7 @@ module OpenFoodNetwork it "returns all of my produced variants" do visible = permissions.editable_variants_for_outgoing_exchanges_to(hub) expect(visible).to include v1 - expect(visible).to_not include v2 + expect(visible).not_to include v2 end end @@ -908,7 +908,7 @@ module OpenFoodNetwork it "does not return my variants" do visible = permissions.editable_variants_for_outgoing_exchanges_to(hub) - expect(visible).to_not include v1, v2 + expect(visible).not_to include v1, v2 end end end @@ -918,7 +918,7 @@ module OpenFoodNetwork it "does not return my variants" do visible = permissions.editable_variants_for_outgoing_exchanges_to(hub) - expect(visible).to_not include v1, v2 + expect(visible).not_to include v1, v2 end end end @@ -949,7 +949,7 @@ module OpenFoodNetwork it "does not return my variants" do visible = permissions.editable_variants_for_outgoing_exchanges_to(hub) - expect(visible).to_not include v1, v2, v3 + expect(visible).not_to include v1, v2, v3 end end end diff --git a/spec/lib/open_food_network/permissions_spec.rb b/spec/lib/open_food_network/permissions_spec.rb index 62e9e2aa7a..0f216a90d1 100644 --- a/spec/lib/open_food_network/permissions_spec.rb +++ b/spec/lib/open_food_network/permissions_spec.rb @@ -178,7 +178,7 @@ module OpenFoodNetwork Enterprise.where(id: [hub, producer2]) } - expect(permissions.variant_override_enterprises_per_hub[hub.id]).to_not include producer2.id + expect(permissions.variant_override_enterprises_per_hub[hub.id]).not_to include producer2.id end it "returns itself if self is also a primary producer " \ diff --git a/spec/lib/open_food_network/scope_variants_to_search_spec.rb b/spec/lib/open_food_network/scope_variants_to_search_spec.rb index 1c528a8e45..e896fa8f60 100644 --- a/spec/lib/open_food_network/scope_variants_to_search_spec.rb +++ b/spec/lib/open_food_network/scope_variants_to_search_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' require 'open_food_network/scope_variants_for_search' -require 'spec_helper' describe OpenFoodNetwork::ScopeVariantsForSearch do let!(:p1) { create(:simple_product, name: 'Product 1') } @@ -31,7 +30,7 @@ describe OpenFoodNetwork::ScopeVariantsForSearch do it "returns all products whose names or SKUs match the query" do expect(result).to include v1, v2 - expect(result).to_not include v3, v4 + expect(result).not_to include v3, v4 end context "matching both product SKUs and variant SKUs" do @@ -39,7 +38,7 @@ describe OpenFoodNetwork::ScopeVariantsForSearch do it "returns all variants whose SKU or product's SKU match the query" do expect(result).to include v1, v2, v5 - expect(result).to_not include v3, v4 + expect(result).not_to include v3, v4 end end end @@ -49,7 +48,7 @@ describe OpenFoodNetwork::ScopeVariantsForSearch do it "returns all products distributed through that schedule" do expect(result).to include v1, v3 - expect(result).to_not include v2, v4 + expect(result).not_to include v2, v4 end end @@ -58,7 +57,7 @@ describe OpenFoodNetwork::ScopeVariantsForSearch do it "returns all products distributed through that order cycle" do expect(result).to include v2 - expect(result).to_not include v1, v3, v4 + expect(result).not_to include v1, v3, v4 end end @@ -67,7 +66,7 @@ describe OpenFoodNetwork::ScopeVariantsForSearch do it "returns all products distributed through that distributor" do expect(result).to include v4 - expect(result).to_not include v1, v2, v3 + expect(result).not_to include v1, v2, v3 end context "filtering by stock availability" do @@ -127,7 +126,7 @@ describe OpenFoodNetwork::ScopeVariantsForSearch do distributor1_variant_with_override_on_hand_but_not_on_demand, distributor1_variant_with_override_without_stock_level_set_but_producer_in_stock ) - expect(result).to_not include( + expect(result).not_to include( distributor1_variant_not_backorderable_and_not_on_hand, distributor1_variant_with_override_not_on_demand_and_not_on_hand, distributor1_variant_with_override_not_in_stock_but_producer_in_stock, @@ -152,7 +151,7 @@ describe OpenFoodNetwork::ScopeVariantsForSearch do distributor1_variant_with_override_not_on_demand_and_not_on_hand, distributor1_variant_with_override_not_in_stock_but_producer_in_stock ) - expect(result).to_not include( + expect(result).not_to include( distributor2_variant_with_override_in_stock ) end diff --git a/spec/lib/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_producer_spec.rb b/spec/lib/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_producer_spec.rb index 4c25519041..76bfe69459 100644 --- a/spec/lib/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_producer_spec.rb +++ b/spec/lib/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_producer_spec.rb @@ -34,7 +34,7 @@ describe Reporting::Reports::EnterpriseFeeSummary::EnterpriseFeesWithTaxReportBy shipping_method:, ship_address: create(:address) ).tap do |order| order.recreate_all_fees! - OrderWorkflow.new(order).complete! + Orders::WorkflowService.new(order).complete! end } diff --git a/spec/lib/reports/line_items_spec.rb b/spec/lib/reports/line_items_spec.rb index 0e266352c1..8e04eb714f 100644 --- a/spec/lib/reports/line_items_spec.rb +++ b/spec/lib/reports/line_items_spec.rb @@ -3,35 +3,37 @@ require 'spec_helper' describe Reporting::LineItems do - subject(:reports_line_items) { described_class.new(order_permissions, params) } - # This object lets us add some test coverage despite the very deep coupling between the class # under test and the various objects it depends on. Other more common moking strategies where very # hard. - class FakeOrderPermissions - def initialize(line_items, orders_relation) - @relations = Spree::LineItem.where(id: line_items.map(&:id)) - @orders_relation = orders_relation + let(:fake_order_permissions) do + Class.new do + def initialize(line_items, orders_relation) + @relations = Spree::LineItem.where(id: line_items.map(&:id)) + @orders_relation = orders_relation + end + + def visible_line_items + relations + end + + def editable_line_items + line_item = FactoryBot.create(:line_item) + Spree::LineItem.where(id: line_item.id) + end + + def visible_orders + orders_relation + end + + private + + attr_reader :relations, :orders_relation end - - def visible_line_items - relations - end - - def editable_line_items - line_item = FactoryBot.create(:line_item) - Spree::LineItem.where(id: line_item.id) - end - - def visible_orders - orders_relation - end - - private - - attr_reader :relations, :orders_relation end + subject(:reports_line_items) { described_class.new(order_permissions, params) } + describe '#list' do let!(:order) do create( @@ -44,7 +46,7 @@ describe Reporting::LineItems do let!(:line_item1) { create(:line_item, order:) } let(:orders_relation) { Spree::Order.where(id: order.id) } - let(:order_permissions) { FakeOrderPermissions.new([line_item1], orders_relation) } + let(:order_permissions) { fake_order_permissions.new([line_item1], orders_relation) } let(:params) { {} } it 'returns masked data' do @@ -58,7 +60,7 @@ describe Reporting::LineItems do let!(:line_item2) { create(:line_item, order:) } let!(:line_item3) { create(:line_item, order:) } let(:order_permissions) do - FakeOrderPermissions.new([line_item1, line_item2, line_item3], orders_relation) + fake_order_permissions.new([line_item1, line_item2, line_item3], orders_relation) end let(:params) { { variant_id_in: [line_item3.variant.id, line_item1.variant.id] } } diff --git a/spec/lib/reports/order_cycle_management_report_spec.rb b/spec/lib/reports/order_cycle_management_report_spec.rb index 6b88cdc4e9..80bed21b3c 100644 --- a/spec/lib/reports/order_cycle_management_report_spec.rb +++ b/spec/lib/reports/order_cycle_management_report_spec.rb @@ -17,11 +17,10 @@ module Reporting end describe "fetching orders" do - let(:customers_with_balance) { instance_double(CustomersWithBalance) } - - it 'calls the OutstandingBalance query object' do - outstanding_balance = instance_double(OutstandingBalance, query: Spree::Order.none) - expect(OutstandingBalance).to receive(:new).and_return(outstanding_balance) + it 'calls the OutstandingBalanceQuery query object' do + outstanding_balance = instance_double(OutstandingBalanceQuery, + call: Spree::Order.none) + expect(OutstandingBalanceQuery).to receive(:new).and_return(outstanding_balance) subject.orders end diff --git a/spec/lib/reports/packing/packing_report_spec.rb b/spec/lib/reports/packing/packing_report_spec.rb index c1b12e0bfe..ead8344bcc 100644 --- a/spec/lib/reports/packing/packing_report_spec.rb +++ b/spec/lib/reports/packing/packing_report_spec.rb @@ -42,7 +42,7 @@ describe "Packing Reports" do end it "does not fetch line items for cancelled orders" do - expect(report_contents).to_not include line_item2.product.name + expect(report_contents).not_to include line_item2.product.name end end @@ -103,7 +103,7 @@ describe "Packing Reports" do context "where an order contains items from multiple suppliers" do it "only shows line items the current user supplies" do expect(report_contents).to include line_item2.product.name - expect(report_contents).to_not include line_item3.product.name + expect(report_contents).not_to include line_item3.product.name end end end @@ -126,7 +126,7 @@ describe "Packing Reports" do it "only shows line items distributed by enterprises managed by the current user" do expect(report_contents).to include line_item.product.name - expect(report_contents).to_not include line_item3.product.name + expect(report_contents).not_to include line_item3.product.name end context "filtering results" do @@ -148,7 +148,7 @@ describe "Packing Reports" do it "only shows results from the selected order cycle" do expect(report_contents).to include line_item.product.name - expect(report_contents).to_not include line_item4.product.name + expect(report_contents).not_to include line_item4.product.name end end @@ -157,7 +157,7 @@ describe "Packing Reports" do it "only shows results from the selected supplier" do expect(report_contents).to include line_item.product.name - expect(report_contents).to_not include line_item4.product.name + expect(report_contents).not_to include line_item4.product.name end end end diff --git a/spec/lib/reports/products_and_inventory_report_spec.rb b/spec/lib/reports/products_and_inventory_report_spec.rb index f2449f56f0..8096fa46b1 100644 --- a/spec/lib/reports/products_and_inventory_report_spec.rb +++ b/spec/lib/reports/products_and_inventory_report_spec.rb @@ -43,7 +43,7 @@ module Reporting allow(variant).to receive_message_chain(:product, :name).and_return("Product Name") allow(variant).to receive_message_chain(:product, :properties) .and_return [double(name: "property1"), double(name: "property2")] - allow(variant).to receive_message_chain(:product, :primary_taxon). + allow(variant).to receive_message_chain(:primary_taxon). and_return double(name: "taxon1") allow(variant).to receive_message_chain(:product, :group_buy_unit_size).and_return(21) allow(subject).to receive(:query_result).and_return [variant] diff --git a/spec/lib/reports/sales_tax_totals_by_order_spec.rb b/spec/lib/reports/sales_tax_totals_by_order_spec.rb index 9194ae3dbb..088d889bb0 100644 --- a/spec/lib/reports/sales_tax_totals_by_order_spec.rb +++ b/spec/lib/reports/sales_tax_totals_by_order_spec.rb @@ -80,7 +80,7 @@ describe "Reporting::Reports::SalesTax::SalesTaxTotalsByOrder" do end it "returns tax amount filtered by tax rate in query_row" do - OrderWorkflow.new(order).complete! + Orders::WorkflowService.new(order).complete! mock_voucher_adjustment_service filtered_tax_total = report.filtered_tax_rate_total(query_row) @@ -94,7 +94,7 @@ describe "Reporting::Reports::SalesTax::SalesTaxTotalsByOrder" do describe "#tax_rate_total" do it "returns the tax amount filtered by tax rate in the query_row" do - OrderWorkflow.new(order).complete! + Orders::WorkflowService.new(order).complete! mock_voucher_adjustment_service tax_total = report.tax_rate_total(query_row) @@ -124,7 +124,7 @@ describe "Reporting::Reports::SalesTax::SalesTaxTotalsByOrder" do describe "#total_excl_tax" do it "returns the total excluding tax specified in query_row" do - OrderWorkflow.new(order).complete! + Orders::WorkflowService.new(order).complete! mock_voucher_adjustment_service total = report.total_excl_tax(query_row) @@ -152,7 +152,7 @@ describe "Reporting::Reports::SalesTax::SalesTaxTotalsByOrder" do describe "#total_incl_tax" do it "returns the total including the tax specified in query_row" do - OrderWorkflow.new(order).complete! + Orders::WorkflowService.new(order).complete! mock_voucher_adjustment_service total = report.total_incl_tax(query_row) @@ -164,7 +164,7 @@ describe "Reporting::Reports::SalesTax::SalesTaxTotalsByOrder" do describe "#rules" do before do - OrderWorkflow.new(order).complete! + Orders::WorkflowService.new(order).complete! end it "returns rules" do @@ -274,7 +274,7 @@ describe "Reporting::Reports::SalesTax::SalesTaxTotalsByOrder" do VoucherAdjustmentsService.new(order).update order.update_totals_and_states - OrderWorkflow.new(order).complete! + Orders::WorkflowService.new(order).complete! end def mock_voucher_adjustment_service(included_tax: 0.0, excluded_tax: 0.0) diff --git a/spec/lib/reports/users_and_enterprises_report_spec.rb b/spec/lib/reports/users_and_enterprises_report_spec.rb index 12c4f1bd05..ce0ab369d9 100644 --- a/spec/lib/reports/users_and_enterprises_report_spec.rb +++ b/spec/lib/reports/users_and_enterprises_report_spec.rb @@ -84,7 +84,7 @@ module Reporting it "excludes enterprises that are not explicitly requested" do results = subject.owners_and_enterprises.to_a.map{ |oae| oae["name"] } expect(results).to include enterprise1.name - expect(results).to_not include enterprise2.name + expect(results).not_to include enterprise2.name end end @@ -95,7 +95,7 @@ module Reporting it "excludes enterprises that are not explicitly requested" do results = subject.owners_and_enterprises.to_a.map{ |oae| oae["name"] } expect(results).to include enterprise1.name - expect(results).to_not include enterprise2.name + expect(results).not_to include enterprise2.name end end end @@ -108,7 +108,7 @@ module Reporting it "excludes enterprises that are not explicitly requested" do results = subject.managers_and_enterprises.to_a.map{ |mae| mae["name"] } expect(results).to include enterprise1.name - expect(results).to_not include enterprise2.name + expect(results).not_to include enterprise2.name end end @@ -126,7 +126,7 @@ module Reporting it "excludes enterprises whose managers are not explicitly requested" do results = subject.managers_and_enterprises.to_a.map{ |mae| mae["name"] } expect(results).to include enterprise1.name - expect(results).to_not include enterprise2.name + expect(results).not_to include enterprise2.name end end end diff --git a/spec/lib/spree/core/mail_settings_spec.rb b/spec/lib/spree/core/mail_settings_spec.rb index 4039addaf2..3953c3266f 100644 --- a/spec/lib/spree/core/mail_settings_spec.rb +++ b/spec/lib/spree/core/mail_settings_spec.rb @@ -2,52 +2,37 @@ require 'spec_helper' -module Spree - module Core - describe MailSettings do - let!(:subject) { MailSettings.new } - - context "overrides appplication defaults" do - context "authentication method is none" do - before do - Config.mail_host = "smtp.example.com" - Config.mail_domain = "example.com" - Config.mail_port = 123 - Config.mail_auth_type = MailSettings::SECURE_CONNECTION_TYPES[0] - Config.smtp_username = "schof" - Config.smtp_password = "hellospree!" - Config.secure_connection_type = "TLS" - subject.override! - end - - it { expect(ActionMailer::Base.smtp_settings[:address]).to eq "smtp.example.com" } - it { expect(ActionMailer::Base.smtp_settings[:domain]).to eq "example.com" } - it { expect(ActionMailer::Base.smtp_settings[:port]).to eq 123 } - it { expect(ActionMailer::Base.smtp_settings[:authentication]).to eq "None" } - it { expect(ActionMailer::Base.smtp_settings[:enable_starttls_auto]).to be_truthy } - - it "doesnt touch user name config" do - expect(ActionMailer::Base.smtp_settings[:user_name]).to be_nil - end - - it "doesnt touch password config" do - expect(ActionMailer::Base.smtp_settings[:password]).to be_nil - end - end +describe Spree::Core::MailSettings do + context "overrides appplication defaults" do + context "authentication method is login" do + before do + Spree::Config.mail_host = "smtp.example.com" + Spree::Config.mail_domain = "example.com" + Spree::Config.mail_port = 123 + Spree::Config.mail_auth_type = "login" + Spree::Config.smtp_username = "schof" + Spree::Config.smtp_password = "hellospree!" + Spree::Config.secure_connection_type = "TLS" + subject.override! end - context "when mail_auth_type is other than none" do - before do - Config.mail_auth_type = "login" - Config.smtp_username = "schof" - Config.smtp_password = "hellospree!" - subject.override! - end + it { expect(ActionMailer::Base.smtp_settings[:address]).to eq "smtp.example.com" } + it { expect(ActionMailer::Base.smtp_settings[:domain]).to eq "example.com" } + it { expect(ActionMailer::Base.smtp_settings[:port]).to eq 123 } + it { expect(ActionMailer::Base.smtp_settings[:authentication]).to eq "login" } + it { expect(ActionMailer::Base.smtp_settings[:enable_starttls_auto]).to be_truthy } + it { expect(ActionMailer::Base.smtp_settings[:user_name]).to eq "schof" } + it { expect(ActionMailer::Base.smtp_settings[:password]).to eq "hellospree!" } + end - context "overrides user credentials" do - it { expect(ActionMailer::Base.smtp_settings[:user_name]).to eq "schof" } - it { expect(ActionMailer::Base.smtp_settings[:password]).to eq "hellospree!" } - end + context "authentication method is none" do + before do + Spree::Config.mail_auth_type = "None" + subject.override! + end + + it "doesn't store 'None' as auth method" do + expect(ActionMailer::Base.smtp_settings[:authentication]).to eq nil end end end diff --git a/spec/lib/spree/money_spec.rb b/spec/lib/spree/money_spec.rb index 8cbc869bc1..b6f2fca897 100644 --- a/spec/lib/spree/money_spec.rb +++ b/spec/lib/spree/money_spec.rb @@ -24,6 +24,11 @@ describe Spree::Money do end context "with currency" do + before do + allow(ENV).to receive(:fetch).and_call_original + allow(ENV).to receive(:fetch).with("CURRENCY").and_return("USD") + end + it "passed in option" do money = Spree::Money.new(10, with_currency: true, html_wrap: false) expect(money.to_s).to eq("$10.00 USD") @@ -96,6 +101,9 @@ describe Spree::Money do config.currency_symbol_position = :after config.display_currency = false end + + allow(ENV).to receive(:fetch).and_call_original + allow(ENV).to receive(:fetch).with("CURRENCY").and_return("EUR") end # Regression test for Spree #2634 diff --git a/spec/lib/stripe/account_connector_spec.rb b/spec/lib/stripe/account_connector_spec.rb index d816292757..b38bf88207 100644 --- a/spec/lib/stripe/account_connector_spec.rb +++ b/spec/lib/stripe/account_connector_spec.rb @@ -27,7 +27,7 @@ module Stripe it "returns false and does not create a new StripeAccount" do expect do expect(connector.create_account).to be false - end.to_not change { StripeAccount.count } + end.not_to change { StripeAccount.count } end end @@ -36,7 +36,7 @@ module Stripe it "raises a StripeError" do expect do expect{ connector.create_account }.to raise_error StripeError - end.to_not change { StripeAccount.count } + end.not_to change { StripeAccount.count } end end @@ -47,7 +47,7 @@ module Stripe it "raises an AccessDenied error" do expect do expect{ connector.create_account }.to raise_error CanCan::AccessDenied - end.to_not change { StripeAccount.count } + end.not_to change { StripeAccount.count } end end @@ -68,7 +68,7 @@ module Stripe expect(OAuth).to receive(:deauthorize).with(stripe_user_id: "some_user_id") expect do expect{ connector.create_account }.to raise_error CanCan::AccessDenied - end.to_not change { StripeAccount.count } + end.not_to change { StripeAccount.count } end end @@ -78,7 +78,7 @@ module Stripe end it "raises no errors" do - expect(OAuth).to_not receive(:deauthorize) + expect(OAuth).not_to receive(:deauthorize) connector.create_account end @@ -94,7 +94,7 @@ module Stripe let(:user) { enterprise.owner } it "raises no errors" do - expect(OAuth).to_not receive(:deauthorize) + expect(OAuth).not_to receive(:deauthorize) connector.create_account end diff --git a/spec/lib/stripe/credit_card_cloner_spec.rb b/spec/lib/stripe/credit_card_cloner_spec.rb index 69cb669e7f..f9ef2b59fd 100644 --- a/spec/lib/stripe/credit_card_cloner_spec.rb +++ b/spec/lib/stripe/credit_card_cloner_spec.rb @@ -44,6 +44,10 @@ module Stripe let(:cloner) { Stripe::CreditCardCloner.new(credit_card, connected_account.id) } + after do + Stripe::Account.delete(connected_account.id) + end + context "when called with a card without a customer (one time usage card)" do let(:payment_method_id) { pm_card.id } diff --git a/spec/lib/stripe/credit_card_remover_spec.rb b/spec/lib/stripe/credit_card_remover_spec.rb index 7cbfa23738..39638ee82d 100644 --- a/spec/lib/stripe/credit_card_remover_spec.rb +++ b/spec/lib/stripe/credit_card_remover_spec.rb @@ -36,6 +36,10 @@ describe Stripe::CreditCardRemover do let(:cloner) { Stripe::CreditCardCloner.new(credit_card, connected_account.id) } + after do + Stripe::Account.delete(connected_account.id) + end + context 'Stripe customer exists' do let(:payment_method_id) { pm_card.id } let(:customer_id) { customer.id } diff --git a/spec/lib/stripe/payment_intent_validator_spec.rb b/spec/lib/stripe/payment_intent_validator_spec.rb index 797b62f9c2..d4d37afa2b 100644 --- a/spec/lib/stripe/payment_intent_validator_spec.rb +++ b/spec/lib/stripe/payment_intent_validator_spec.rb @@ -52,7 +52,7 @@ describe Stripe::PaymentIntentValidator do expect { result = validator.call expect(result).to eq payment_intent_response_body - }.to_not raise_error Stripe::StripeError + }.not_to raise_error Stripe::StripeError end it "captures the payment" do diff --git a/spec/lib/stripe/webhook_handler_spec.rb b/spec/lib/stripe/webhook_handler_spec.rb index d893979507..df835ecf97 100644 --- a/spec/lib/stripe/webhook_handler_spec.rb +++ b/spec/lib/stripe/webhook_handler_spec.rb @@ -48,7 +48,7 @@ module Stripe end it "does not call the handler method, and returns :unknown" do - expect(handler).to_not receive(:some_method) + expect(handler).not_to receive(:some_method) expect(handler.handle).to be :unknown end end @@ -57,7 +57,7 @@ module Stripe describe "deauthorize" do context "when the event has no 'account' attribute" do it "does destroy stripe accounts, returns :ignored" do - expect(handler).to_not receive(:destroy_stripe_accounts_linked_to) + expect(handler).not_to receive(:destroy_stripe_accounts_linked_to) expect(handler.send(:deauthorize)).to be :ignored end end diff --git a/spec/lib/tasks/data/remove_transient_data_spec.rb b/spec/lib/tasks/data/remove_transient_data_spec.rb index a5e6245ebc..af47e06475 100644 --- a/spec/lib/tasks/data/remove_transient_data_spec.rb +++ b/spec/lib/tasks/data/remove_transient_data_spec.rb @@ -55,9 +55,9 @@ describe RemoveTransientData do it 'deletes cart orders and related objects older than retention_period' do RemoveTransientData.new.call - expect{ cart.reload }.to_not raise_error - expect{ line_item.reload }.to_not raise_error - expect{ adjustment.reload }.to_not raise_error + expect{ cart.reload }.not_to raise_error + expect{ line_item.reload }.not_to raise_error + expect{ adjustment.reload }.not_to raise_error expect{ old_cart.reload }.to raise_error ActiveRecord::RecordNotFound expect{ old_line_item.reload }.to raise_error ActiveRecord::RecordNotFound diff --git a/spec/lib/tasks/enterprises_rake_spec.rb b/spec/lib/tasks/enterprises_rake_spec.rb index 5e3b02873e..dfcb91cebd 100644 --- a/spec/lib/tasks/enterprises_rake_spec.rb +++ b/spec/lib/tasks/enterprises_rake_spec.rb @@ -4,14 +4,16 @@ require 'spec_helper' require 'rake' describe 'enterprises.rake' do + before(:all) do + Rake.application.rake_require("tasks/enterprises") + Rake::Task.define_task(:environment) + end + describe ':remove_enterprise' do context 'when the enterprises exists' do it 'removes the enterprise' do enterprise = create(:enterprise) - Rake.application.rake_require 'tasks/enterprises' - Rake::Task.define_task(:environment) - expect { Rake.application.invoke_task "ofn:remove_enterprise[#{enterprise.id}]" }.to change { Enterprise.count }.by(-1) diff --git a/spec/lib/tasks/import_product_images_rake_spec.rb b/spec/lib/tasks/import_product_images_rake_spec.rb new file mode 100644 index 0000000000..7a6451b0f2 --- /dev/null +++ b/spec/lib/tasks/import_product_images_rake_spec.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +require 'spec_helper' +require 'rake' + +RSpec.describe 'ofn:import:product_images' do + before(:all) do + Rake.application.rake_require("tasks/import_product_images") + Rake::Task.define_task(:environment) + end + + before do + Rake::Task['ofn:import:product_images'].reenable + end + + describe 'task' do + context "filename is blank" do + it 'raises an error' do + expect { + Rake.application.invoke_task('ofn:import:product_images') + }.to raise_error(RuntimeError, + 'Filename required') + end + end + + context "invalid CSV format" do + it 'raises an error if CSV columns are missing' do + allow(CSV).to receive(:read).and_return(CSV::Table.new([])) + + expect { + Rake.application.invoke_task('ofn:import:product_images["path/to/csv/file.csv"]') + }.to raise_error(RuntimeError, 'CSV columns reqired: ["producer", "name", "image_url"]') + end + end + + context "valid CSV" do + it 'imports images for each product in the CSV that exists and does not have images' do + filename = 'path/to/csv/file.csv' + + csv_data = [ + { producer: 'Producer 1', name: 'Product 1', image_url: 'http://example.com/image1.jpg' }, + { producer: 'Producer 2', name: 'Product 2', image_url: 'http://example.com/image2.jpg' }, + { producer: 'Producer 3', name: 'Product 3', image_url: 'http://example.com/image3.jpg' } + ] + + csv_rows = csv_data.map do |hash| + CSV::Row.new(hash.keys, hash.values) + end + + csv_table = CSV::Table.new(csv_rows) + + allow(CSV).to receive(:read).and_return(csv_table) + + allow(Enterprise).to receive(:find_by!).with(name: 'Producer 1').and_return(double) + allow(Enterprise).to receive(:find_by!).with(name: 'Producer 2').and_return(double) + allow(Enterprise).to receive(:find_by!).with(name: 'Producer 3').and_return(double) + + allow(Spree::Product).to receive(:where).and_return( + class_double('Spree::Product', first: nil), + class_double('Spree::Product', first: instance_double('Spree::Product', image: nil)), + class_double('Spree::Product', first: instance_double('Spree::Product', image: true)) + ) + + allow_any_instance_of(ImageImporter).to receive(:import).and_return(true) + + expected_output = <<~OUTPUT + Warning: use only with trusted URLs. This script will download whatever it can, including local secrets, and expose the file as an image file. + 0 Producer 1, Product 1 + product not found. + 1 Producer 2, Product 2 + image added. + 2 Producer 3, Product 3 + image exists, not updated. + OUTPUT + + expect { + Rake.application.invoke_task('ofn:import:product_images["path/to/csv/file.csv"]') + }.to output(expected_output).to_stdout + end + end + end +end diff --git a/spec/lib/tasks/users_rake_spec.rb b/spec/lib/tasks/users_rake_spec.rb index cfddfec7ae..5fdc6a0487 100644 --- a/spec/lib/tasks/users_rake_spec.rb +++ b/spec/lib/tasks/users_rake_spec.rb @@ -4,27 +4,27 @@ require 'spec_helper' require 'rake' describe 'users.rake' do - before(:all) do + before do Rake.application.rake_require 'tasks/users' Rake::Task.define_task(:environment) + Rake::Task['ofn:remove_enterprise_limit'].reenable end describe ':remove_enterprise_limit' do context 'when the user exists' do - it 'sets the enterprise_limit to the maximum integer' do - max_integer = 2_147_483_647 - user = create(:user) + let(:user) { create(:user) } + it 'sets the enterprise_limit to the maximum integer' do Rake.application.invoke_task "ofn:remove_enterprise_limit[#{user.id}]" - expect(user.reload.enterprise_limit).to eq(max_integer) + expect(user.reload.enterprise_limit).to eq(2_147_483_647) end end context 'when the user does not exist' do it 'raises' do expect { - RemoveEnterpriseLimit.new(-1).call + Rake.application.invoke_task "ofn:remove_enterprise_limit[123]" }.to raise_error(ActiveRecord::RecordNotFound) end end diff --git a/spec/mailers/order_mailer_spec.rb b/spec/mailers/order_mailer_spec.rb index 257b3fc904..506a05d6b4 100644 --- a/spec/mailers/order_mailer_spec.rb +++ b/spec/mailers/order_mailer_spec.rb @@ -35,14 +35,14 @@ describe Spree::OrderMailer do end it "doesn't aggressively escape double quotes body" do - expect(email.body).to_not include(""") + expect(email.body).not_to include(""") end it "accepts an order id as an alternative to an Order object" do expect(Spree::Order).to receive(:find).with(order.id).and_return(order) expect { described_class.confirm_email_for_customer(order.id).deliver_now - }.to_not raise_error + }.not_to raise_error end it "display the OFN header by default" do @@ -55,7 +55,7 @@ describe Spree::OrderMailer do end it 'does not display the OFN navigation' do - expect(email.body).to_not include(ContentConfig.url_for(:footer_logo)) + expect(email.body).not_to include(ContentConfig.url_for(:footer_logo)) end end end @@ -91,7 +91,7 @@ describe Spree::OrderMailer do expect(Spree::Order).to receive(:find).with(order.id).and_return(order) expect { Spree::OrderMailer.cancel_email(order.id).deliver_now - }.to_not raise_error + }.not_to raise_error end end @@ -115,11 +115,11 @@ describe Spree::OrderMailer do let!(:cancel_email) { Spree::OrderMailer.cancel_email(order) } specify do - expect(confirmation_email.body).to_not include("Ineligible Adjustment") + expect(confirmation_email.body).not_to include("Ineligible Adjustment") end specify do - expect(cancel_email.body).to_not include("Ineligible Adjustment") + expect(cancel_email.body).not_to include("Ineligible Adjustment") end end @@ -226,12 +226,12 @@ describe Spree::OrderMailer do data: invoice_data_generator.serialize_for_invoice) } - let(:generator){ instance_double(OrderInvoiceGenerator) } + let(:generator){ instance_double(Orders::GenerateInvoiceService) } let(:renderer){ instance_double(InvoiceRenderer) } let(:attachment_filename){ "invoice-#{order.number}.pdf" } let(:deliveries){ ActionMailer::Base.deliveries } before do - allow(OrderInvoiceGenerator).to receive(:new).with(order).and_return(generator) + allow(Orders::GenerateInvoiceService).to receive(:new).with(order).and_return(generator) allow(InvoiceRenderer).to receive(:new).and_return(renderer) end context "When invoices feature is not enabled" do @@ -241,7 +241,7 @@ describe Spree::OrderMailer do expect(renderer).to receive(:render_to_string).with(order, nil).and_return("invoice") expect { email.deliver_now - }.to_not raise_error + }.not_to raise_error expect(deliveries.count).to eq(1) expect(deliveries.first.attachments.count).to eq(1) expect(deliveries.first.attachments.first.filename).to eq(attachment_filename) diff --git a/spec/mailers/producer_mailer_spec.rb b/spec/mailers/producer_mailer_spec.rb index b69b36c3e9..b6460e4f6a 100644 --- a/spec/mailers/producer_mailer_spec.rb +++ b/spec/mailers/producer_mailer_spec.rb @@ -147,7 +147,7 @@ describe ProducerMailer, type: :mailer do end it "adds customer names table" do - expect(body_as_html(mail).find(".order-summary.customer-order")).to_not be_nil + expect(body_as_html(mail).find(".order-summary.customer-order")).not_to be_nil end it "displays last name for each order" do @@ -215,7 +215,7 @@ describe ProducerMailer, type: :mailer do context "products from only one supplier" do it "doesn't display a supplier column" do expect(body_as_html(mail).find(".order-summary")) - .to have_no_selector("th", text: "Supplier") + .not_to have_selector("th", text: "Supplier") end context "when the show customer names to suppliers setting is enabled" do @@ -223,7 +223,7 @@ describe ProducerMailer, type: :mailer do it "doesn't display a supplier column in the summary of orders grouped by customer" do expect(body_as_html(mail).find(".customer-order")) - .to have_no_selector("th", text: "Supplier") + .not_to have_selector("th", text: "Supplier") end end end diff --git a/spec/mailers/shipment_mailer_spec.rb b/spec/mailers/shipment_mailer_spec.rb index 8710f392e0..f0ea130c64 100644 --- a/spec/mailers/shipment_mailer_spec.rb +++ b/spec/mailers/shipment_mailer_spec.rb @@ -25,14 +25,14 @@ describe Spree::ShipmentMailer do # Regression test for #2196 it "doesn't include out of stock in the email body" do shipment_email = Spree::ShipmentMailer.shipped_email(shipment, delivery: true) - expect(shipment_email.body).to_not include(%{Out of Stock}) + expect(shipment_email.body).not_to include(%{Out of Stock}) end it "shipment_email accepts an shipment id as an alternative to an Shipment object" do expect(Spree::Shipment).to receive(:find).with(shipment.id).and_return(shipment) expect { Spree::ShipmentMailer.shipped_email(shipment.id, delivery: true).deliver_now - }.to_not raise_error + }.not_to raise_error end it "includes the distributor's name in the subject" do diff --git a/spec/mailers/subscription_mailer_spec.rb b/spec/mailers/subscription_mailer_spec.rb index f7d44d31f5..12cad33ece 100644 --- a/spec/mailers/subscription_mailer_spec.rb +++ b/spec/mailers/subscription_mailer_spec.rb @@ -35,7 +35,7 @@ describe SubscriptionMailer, type: :mailer do body = SubscriptionMailer.deliveries.last.body.encoded expect(body).to include "This order was automatically created for you." - expect(body).to_not include "Unfortunately, not all products " \ + expect(body).not_to include "Unfortunately, not all products " \ "that you requested were available." end end @@ -55,7 +55,7 @@ describe SubscriptionMailer, type: :mailer do it "provides link to make changes" do expect(body).to match %r{make changes} - expect(body).to_not match %r{ + expect(body).not_to match %r{ view details of this order } end @@ -64,7 +64,7 @@ describe SubscriptionMailer, type: :mailer do let(:shop) { create(:enterprise, allow_order_changes: false) } it "provides link to view details" do - expect(body).to_not match %r{make changes} + expect(body).not_to match %r{make changes} expect(body) .to match %r{view details of this order} end @@ -75,14 +75,14 @@ describe SubscriptionMailer, type: :mailer do let(:customer) { create(:customer, enterprise: shop, user: nil) } it "does not provide link" do - expect(body).to_not match /#{order_link_href}/ + expect(body).not_to match /#{order_link_href}/ end context "when the distributor does not allow changes to the order" do let(:shop) { create(:enterprise, allow_order_changes: false) } it "does not provide link" do - expect(body).to_not match /#{order_link_href}/ + expect(body).not_to match /#{order_link_href}/ end end end @@ -140,7 +140,7 @@ describe SubscriptionMailer, type: :mailer do let(:customer) { create(:customer, user: nil) } it "does not provide link" do - expect(email.body).to_not match /#{order_link_href}/ + expect(email.body).not_to match /#{order_link_href}/ end end end @@ -167,7 +167,7 @@ describe SubscriptionMailer, type: :mailer do end it 'does not display the OFN navigation' do - expect(email.body).to_not include(ContentConfig.url_for(:footer_logo)) + expect(email.body).not_to include(ContentConfig.url_for(:footer_logo)) end end end @@ -236,7 +236,7 @@ describe SubscriptionMailer, type: :mailer do let(:customer) { create(:customer, user: nil) } it "does not provide link" do - expect(body).to_not match /#{order_link_href}/ + expect(body).not_to match /#{order_link_href}/ end end end @@ -269,7 +269,7 @@ describe SubscriptionMailer, type: :mailer do expect(body).to include("A total of %d subscriptions were marked " \ "for automatic processing." % 37) expect(body).to include 'All were processed successfully.' - expect(body).to_not include 'Details of the issues encountered are provided below.' + expect(body).not_to include 'Details of the issues encountered are provided below.' end it "renders the shop's logo" do @@ -370,7 +370,7 @@ describe SubscriptionMailer, type: :mailer do expect(body).to include order2.number # No error messages reported when non provided - expect(body).to_not include 'No error message provided' + expect(body).not_to include 'No error message provided' end end end @@ -401,7 +401,7 @@ describe SubscriptionMailer, type: :mailer do expect(body).to include("A total of %d subscriptions were marked " \ "for automatic processing." % 37) expect(body).to include 'All were processed successfully.' - expect(body).to_not include 'Details of the issues encountered are provided below.' + expect(body).not_to include 'Details of the issues encountered are provided below.' end end @@ -497,7 +497,7 @@ describe SubscriptionMailer, type: :mailer do expect(body).to include order2.number # No error messages reported when non provided - expect(body).to_not include 'No error message provided' + expect(body).not_to include 'No error message provided' end end end diff --git a/spec/mailers/test_mailer_spec.rb b/spec/mailers/test_mailer_spec.rb index 5771db2f54..181b93164e 100644 --- a/spec/mailers/test_mailer_spec.rb +++ b/spec/mailers/test_mailer_spec.rb @@ -16,6 +16,6 @@ describe Spree::TestMailer do expect(Spree::User).to receive(:find).with(user.id).and_return(user) expect { Spree::TestMailer.test_email(user.id).deliver_now - }.to_not raise_error + }.not_to raise_error end end diff --git a/spec/migrations/convert_stripe_connect_to_stripe_sca_spec.rb b/spec/migrations/convert_stripe_connect_to_stripe_sca_spec.rb index a6cd7c244e..45248ce68c 100644 --- a/spec/migrations/convert_stripe_connect_to_stripe_sca_spec.rb +++ b/spec/migrations/convert_stripe_connect_to_stripe_sca_spec.rb @@ -89,7 +89,7 @@ describe ConvertStripeConnectToStripeSca do distributor_ids: [owner.id] ) - expect { subject.up }.to_not change { stripe.reload.attributes } + expect { subject.up }.not_to change { stripe.reload.attributes } end it "doesn't mess with other payment methods" do @@ -99,6 +99,6 @@ describe ConvertStripeConnectToStripeSca do distributor_ids: [owner.id] ) - expect { subject.up }.to_not change { cash.reload.attributes } + expect { subject.up }.not_to change { cash.reload.attributes } end end diff --git a/spec/migrations/migrate_admin_tax_amounts_spec.rb b/spec/migrations/migrate_admin_tax_amounts_spec.rb index 189bf8fca3..b60c8ae762 100644 --- a/spec/migrations/migrate_admin_tax_amounts_spec.rb +++ b/spec/migrations/migrate_admin_tax_amounts_spec.rb @@ -18,7 +18,7 @@ describe MigrateAdminTaxAmounts do let!(:adjustment_without_tax) { create(:adjustment, included_tax: 0) } it "doesn't move the tax to an adjustment" do - expect { subject.migrate_admin_taxes! }.to_not change { + expect { subject.migrate_admin_taxes! }.not_to change { Spree::Adjustment.count } end @@ -85,7 +85,7 @@ describe MigrateAdminTaxAmounts do let(:order) { nil } it "returns an empty array" do - expect(Spree::TaxRate).to_not receive(:match) + expect(Spree::TaxRate).not_to receive(:match) expect(subject.applicable_rates(adjustment)).to eq [] end @@ -95,7 +95,7 @@ describe MigrateAdminTaxAmounts do let(:distributor) { nil } it "returns an empty array" do - expect(Spree::TaxRate).to_not receive(:match) + expect(Spree::TaxRate).not_to receive(:match) expect(subject.applicable_rates(adjustment)).to eq [] end diff --git a/spec/models/concerns/order_shipment_spec.rb b/spec/models/concerns/order_shipment_spec.rb index 9bf8f8678f..26dbb3937c 100644 --- a/spec/models/concerns/order_shipment_spec.rb +++ b/spec/models/concerns/order_shipment_spec.rb @@ -43,7 +43,7 @@ describe OrderShipment do it "returns nil for empty shipping_method_id" do empty_shipping_method_id = ' ' - expect(shipment.shipping_rates).to_not receive(:find_by) + expect(shipment.shipping_rates).not_to receive(:find_by) .with(shipping_method_id: empty_shipping_method_id) expect(order.select_shipping_method(empty_shipping_method_id)).to be_nil diff --git a/spec/models/customer_spec.rb b/spec/models/customer_spec.rb index a9441b8393..fc5847239c 100644 --- a/spec/models/customer_spec.rb +++ b/spec/models/customer_spec.rb @@ -63,7 +63,7 @@ describe Customer, type: :model do c1 = Customer.create(enterprise:, email: non_existing_email, user: user1) expect(c1.user).to eq user1 expect(c1.email).to eq non_existing_email - expect(c1.email).to_not eq user1.email + expect(c1.email).not_to eq user1.email c2 = Customer.create(enterprise:, email: user2.email) expect(c2.user).to eq user2 diff --git a/spec/models/enterprise_caching_spec.rb b/spec/models/enterprise_caching_spec.rb index 8fab0abb17..e66063abc1 100644 --- a/spec/models/enterprise_caching_spec.rb +++ b/spec/models/enterprise_caching_spec.rb @@ -12,6 +12,7 @@ describe Enterprise do describe "with a supplied product" do let(:product) { create(:simple_product, supplier: enterprise, primary_taxon_id: taxon.id) } + let(:variant) { product.variants.first } let(:property) { product.product_properties.last } let(:producer_property) { enterprise.producer_properties.last } @@ -20,9 +21,9 @@ describe Enterprise do enterprise.set_producer_property 'Biodynamic', 'ASDF 4321' end - it "touches enterprise when a taxon on that product changes" do + it "touches enterprise when a taxon on that variant changes" do expect { - later { product.update(primary_taxon_id: taxon2.id) } + later { variant.update(primary_taxon_id: taxon2.id) } }.to change { enterprise.reload.updated_at } end @@ -47,6 +48,7 @@ describe Enterprise do describe "with a distributed product" do let(:product) { create(:simple_product, primary_taxon_id: taxon.id) } + let(:variant) { product.variants.first } let(:oc) { create(:simple_order_cycle, distributors: [enterprise], variants: [product.variants.first]) @@ -63,9 +65,9 @@ describe Enterprise do context "with an order cycle" do before { oc } - it "touches enterprise when a taxon on that product changes" do + it "touches enterprise when a taxon on that variant changes" do expect { - later { product.update(primary_taxon_id: taxon2.id) } + later { variant.update(primary_taxon_id: taxon2.id) } }.to change { enterprise.reload.updated_at } end diff --git a/spec/models/enterprise_fee_spec.rb b/spec/models/enterprise_fee_spec.rb index cecd9521e5..9a81c0d132 100644 --- a/spec/models/enterprise_fee_spec.rb +++ b/spec/models/enterprise_fee_spec.rb @@ -196,7 +196,7 @@ describe EnterpriseFee do end it "soft-deletes the enterprise fee" do - expect(enterprise_fee.deleted_at).to_not be_nil + expect(enterprise_fee.deleted_at).not_to be_nil end it "can be accessed by old adjustments" do diff --git a/spec/models/enterprise_relationship_spec.rb b/spec/models/enterprise_relationship_spec.rb index bbad680132..d0abff9ebe 100644 --- a/spec/models/enterprise_relationship_spec.rb +++ b/spec/models/enterprise_relationship_spec.rb @@ -196,9 +196,9 @@ describe EnterpriseRelationship do before { er.destroy } it "should set permission_revoked_at to the current time " \ "for all variant overrides of the relationship" do - expect(vo1.reload.permission_revoked_at).to_not be_nil - expect(vo2.reload.permission_revoked_at).to_not be_nil - expect(vo2.reload.permission_revoked_at).to_not be_nil + expect(vo1.reload.permission_revoked_at).not_to be_nil + expect(vo2.reload.permission_revoked_at).not_to be_nil + expect(vo2.reload.permission_revoked_at).not_to be_nil end end end @@ -207,8 +207,8 @@ describe EnterpriseRelationship do before { er.permissions_list = [:add_to_order_cycles]; er.save! } it "should set permission_revoked_at to the current time " \ "for all relevant variant overrides" do - expect(vo1.reload.permission_revoked_at).to_not be_nil - expect(vo2.reload.permission_revoked_at).to_not be_nil + expect(vo1.reload.permission_revoked_at).not_to be_nil + expect(vo2.reload.permission_revoked_at).not_to be_nil end it "should not affect other variant overrides" do @@ -277,7 +277,7 @@ describe EnterpriseRelationship do end it "should not affect other variant overrides" do - expect(vo3.reload.permission_revoked_at).to_not be_nil + expect(vo3.reload.permission_revoked_at).not_to be_nil end end @@ -285,9 +285,9 @@ describe EnterpriseRelationship do before { er.permissions_list = [:add_to_order_cycles, :manage_products]; er.save! } it "should have no effect on existing variant_overrides" do - expect(vo1.reload.permission_revoked_at).to_not be_nil - expect(vo2.reload.permission_revoked_at).to_not be_nil - expect(vo3.reload.permission_revoked_at).to_not be_nil + expect(vo1.reload.permission_revoked_at).not_to be_nil + expect(vo2.reload.permission_revoked_at).not_to be_nil + expect(vo3.reload.permission_revoked_at).not_to be_nil end end end diff --git a/spec/models/enterprise_spec.rb b/spec/models/enterprise_spec.rb index f38a4e8240..e764c9da73 100644 --- a/spec/models/enterprise_spec.rb +++ b/spec/models/enterprise_spec.rb @@ -96,7 +96,7 @@ describe Enterprise do it "adds new owner to list of managers" do expect(e.owner).to eq u1 expect(e.users).to include u1 - expect(e.users).to_not include u2 + expect(e.users).not_to include u2 e.owner = u2 e.save! e.reload @@ -132,14 +132,14 @@ describe Enterprise do it "prevents duplicate names for new records" do e = Enterprise.new name: enterprise.name - expect(e).to_not be_valid + expect(e).not_to be_valid expect(e.errors[:name].first).to include enterprise_name_error(owner.email) end it "prevents duplicate names for existing records" do e = create(:enterprise, name: 'foo') e.name = enterprise.name - expect(e).to_not be_valid + expect(e).not_to be_valid expect(e.errors[:name].first).to include enterprise_name_error(owner.email) end @@ -155,27 +155,27 @@ describe Enterprise do describe "prevent a wrong instagram link pattern" do it "invalidates the instagram attribute https://facebook.com/user" do e = build(:enterprise, instagram: 'https://facebook.com/user') - expect(e).to_not be_valid + expect(e).not_to be_valid end it "invalidates the instagram attribute tagram.com/user" do e = build(:enterprise, instagram: 'tagram.com/user') - expect(e).to_not be_valid + expect(e).not_to be_valid end it "invalidates the instagram attribute https://instagram.com/user/preferences" do e = build(:enterprise, instagram: 'https://instagram.com/user/preferences') - expect(e).to_not be_valid + expect(e).not_to be_valid end it "invalidates the instagram attribute https://www.instagram.com/p/Cpg4McNPyJA/" do e = build(:enterprise, instagram: 'https://www.instagram.com/p/Cpg4McNPyJA/') - expect(e).to_not be_valid + expect(e).not_to be_valid end it "invalidates the instagram attribute https://instagram.com/user-user" do e = build(:enterprise, instagram: 'https://instagram.com/user-user') - expect(e).to_not be_valid + expect(e).not_to be_valid end end @@ -260,18 +260,18 @@ describe Enterprise do it "commas at the beginning and end are disallowed" do enterprise = build(:enterprise, preferred_shopfront_taxon_order: ",1,2,3") - expect(enterprise).to be_invalid + expect(enterprise).not_to be_valid enterprise = build(:enterprise, preferred_shopfront_taxon_order: "1,2,3,") - expect(enterprise).to be_invalid + expect(enterprise).not_to be_valid end it "any other characters are invalid" do enterprise = build(:enterprise, preferred_shopfront_taxon_order: "a1,2,3") - expect(enterprise).to be_invalid + expect(enterprise).not_to be_valid enterprise = build(:enterprise, preferred_shopfront_taxon_order: ".1,2,3") - expect(enterprise).to be_invalid + expect(enterprise).not_to be_valid enterprise = build(:enterprise, preferred_shopfront_taxon_order: " 1,2,3") - expect(enterprise).to be_invalid + expect(enterprise).not_to be_valid end end @@ -295,18 +295,18 @@ describe Enterprise do it "commas at the beginning and end are disallowed" do enterprise = build(:enterprise, preferred_shopfront_producer_order: ",1,2,3") - expect(enterprise).to be_invalid + expect(enterprise).not_to be_valid enterprise = build(:enterprise, preferred_shopfront_producer_order: "1,2,3,") - expect(enterprise).to be_invalid + expect(enterprise).not_to be_valid end it "any other characters are invalid" do enterprise = build(:enterprise, preferred_shopfront_producer_order: "a1,2,3") - expect(enterprise).to be_invalid + expect(enterprise).not_to be_valid enterprise = build(:enterprise, preferred_shopfront_producer_order: ".1,2,3") - expect(enterprise).to be_invalid + expect(enterprise).not_to be_valid enterprise = build(:enterprise, preferred_shopfront_producer_order: " 1,2,3") - expect(enterprise).to be_invalid + expect(enterprise).not_to be_valid end end @@ -336,7 +336,7 @@ describe Enterprise do it "does not validate if URL is invalid and can't be infered" do e = build(:enterprise, white_label_logo_link: 'with spaces') - expect(e).to be_invalid + expect(e).not_to be_valid end end end @@ -368,7 +368,7 @@ describe Enterprise do it "finds enterprises that have a sells property other than 'unspecified'" do activated_enterprises = Enterprise.activated expect(activated_enterprises).to include active_enterprise - expect(activated_enterprises).to_not include inactive_enterprise + expect(activated_enterprises).not_to include inactive_enterprise end end diff --git a/spec/models/invoice/data_presenter_spec.rb b/spec/models/invoice/data_presenter_spec.rb index 864044d502..bd35562762 100644 --- a/spec/models/invoice/data_presenter_spec.rb +++ b/spec/models/invoice/data_presenter_spec.rb @@ -11,4 +11,68 @@ describe Invoice::DataPresenter do expect(presenter.display_date).to eq "August 01, 2023" end end + + context "#display_line_item_tax_rate" do + let!(:order){ + create(:order_with_taxes, + product_price: 100, + tax_rate_name: "VAT", + tax_rate_amount: 0.15) + } + let(:non_taxable_line_item) { order.line_items.first } + let(:taxable_line_item) { order.line_items.last } # only the last item one has tax rate + let(:invoice){ order.invoices.latest } + let(:presenter){ Invoice::DataPresenter.new(invoice) } + before do + order.create_tax_charge! + Orders::GenerateInvoiceService.new(order).generate_or_update_latest_invoice + end + + it "displays nothing when the line item refer to a non taxable product" do + expect(presenter.display_line_item_tax_rate(non_taxable_line_item)).to eq "" + end + + it "displays the tax rate when the line item refer to a taxable product" do + expect(presenter.display_line_item_tax_rate(taxable_line_item)).to eq "15.0%" + end + + context "if multiple tax rates belong to the tax category" do + let(:taxable_line_item_tax_rate){ + order.line_items.last.tax_category.tax_rates.first + } + let(:tax_rate_calculator){ + taxable_line_item_tax_rate.calculator + } + before do + tax_rate_clone = taxable_line_item_tax_rate.dup.tap do |dup| + dup.amount = 0.20 + dup.calculator = tax_rate_calculator.dup.tap do |calc| + calc.calculable = dup + end + end + tax_rate_clone.save! + tax_rate_clone.calculator.save! + order.create_tax_charge! + Orders::GenerateInvoiceService.new(order).generate_or_update_latest_invoice + end + + it "displays the tax rate when the line item refer to a taxable product" do + expect(order.invoices.count).to eq 2 + expect(presenter.display_line_item_tax_rate(taxable_line_item)).to eq "15.0%, 20.0%" + end + + context "one of the tax rate is appliable to a different tax zone" do + before do + order.line_items.last.tax_category.tax_rates.last.update!(zone: create(:zone)) + order.create_tax_charge! + Orders::GenerateInvoiceService.new(order).generate_or_update_latest_invoice + end + + it "displays only the tax rates that were applied to the line items" do + expect(order.invoices.count).to eq 3 + expect(presenter.display_line_item_tax_rate(taxable_line_item)).to eq "15.0%" + end + end + end + end end diff --git a/spec/models/order_cycle_spec.rb b/spec/models/order_cycle_spec.rb index 9ee874dce5..912ff2ec15 100644 --- a/spec/models/order_cycle_spec.rb +++ b/spec/models/order_cycle_spec.rb @@ -15,7 +15,7 @@ describe OrderCycle do it 'should not be valid when open date is after close date' do oc = build(:simple_order_cycle, orders_open_at: Time.zone.now, orders_close_at: 1.minute.ago) - expect(oc).to_not be_valid + expect(oc).not_to be_valid end it "has a coordinator and associated fees" do @@ -246,7 +246,7 @@ describe OrderCycle do it "does not consider soft-deleted variants to be currently distributed in the oc" do p2_v.delete - expect(oc.variants_distributed_by(d1)).to_not include p2_v + expect(oc.variants_distributed_by(d1)).not_to include p2_v end end end @@ -564,12 +564,12 @@ describe OrderCycle do it "it does not reset opened_at if open date is changed to be earlier" do expect{ oc.update!(orders_open_at: 3.days.ago) } - .to_not change { oc.opened_at } + .not_to change { oc.opened_at } end it "it does not reset opened_at if open date does not change" do expect{ oc.update!(orders_close_at: 1.day.from_now) } - .to_not change { oc.opened_at } + .not_to change { oc.opened_at } end end @@ -580,21 +580,21 @@ describe OrderCycle do } it "reset processed_at if close date change in future" do - expect(oc.processed_at).to_not be_nil + expect(oc.processed_at).not_to be_nil oc.update!(orders_close_at: 1.week.from_now) expect(oc.processed_at).to be_nil end it "it does not reset processed_at if close date is changed to be earlier" do - expect(oc.processed_at).to_not be_nil + expect(oc.processed_at).not_to be_nil oc.update!(orders_close_at: 2.days.ago) - expect(oc.processed_at).to_not be_nil + expect(oc.processed_at).not_to be_nil end it "it does not reset processed_at if close date does not change" do - expect(oc.processed_at).to_not be_nil + expect(oc.processed_at).not_to be_nil oc.update!(orders_open_at: 2.weeks.ago) - expect(oc.processed_at).to_not be_nil + expect(oc.processed_at).not_to be_nil end end diff --git a/spec/models/product_importer_spec.rb b/spec/models/product_importer_spec.rb index d63249428e..ff6470d782 100644 --- a/spec/models/product_importer_spec.rb +++ b/spec/models/product_importer_spec.rb @@ -161,7 +161,7 @@ describe ProductImport::ProductImporter do expect(carrots.variants.first.unit_value).to eq 500 expect(carrots.variant_unit).to eq 'weight' expect(carrots.variant_unit_scale).to eq 1 - expect(carrots.variants.first.on_demand).to_not eq true + expect(carrots.variants.first.on_demand).not_to eq true expect(carrots.variants.first.import_date).to be_within(1.minute).of Time.zone.now potatoes = Spree::Product.find_by(name: 'Potatoes') @@ -171,7 +171,7 @@ describe ProductImport::ProductImporter do expect(potatoes.variants.first.unit_value).to eq 2000 expect(potatoes.variant_unit).to eq 'weight' expect(potatoes.variant_unit_scale).to eq 1000 - expect(potatoes.variants.first.on_demand).to_not eq true + expect(potatoes.variants.first.on_demand).not_to eq true expect(potatoes.variants.first.import_date).to be_within(1.minute).of Time.zone.now pea_soup = Spree::Product.find_by(name: 'Pea Soup') @@ -181,7 +181,7 @@ describe ProductImport::ProductImporter do expect(pea_soup.variants.first.unit_value).to eq 0.75 expect(pea_soup.variant_unit).to eq 'volume' expect(pea_soup.variant_unit_scale).to eq 0.001 - expect(pea_soup.variants.first.on_demand).to_not eq true + expect(pea_soup.variants.first.on_demand).not_to eq true expect(pea_soup.variants.first.import_date).to be_within(1.minute).of Time.zone.now salad = Spree::Product.find_by(name: 'Salad') @@ -191,7 +191,7 @@ describe ProductImport::ProductImporter do expect(salad.variants.first.unit_value).to eq 1 expect(salad.variant_unit).to eq 'items' expect(salad.variant_unit_scale).to eq nil - expect(salad.variants.first.on_demand).to_not eq true + expect(salad.variants.first.on_demand).not_to eq true expect(salad.variants.first.import_date).to be_within(1.minute).of Time.zone.now buns = Spree::Product.find_by(name: 'Hot Cross Buns') @@ -284,7 +284,7 @@ describe ProductImport::ProductImporter do carrots = Spree::Product.find_by(name: 'Good Carrots') expect(carrots.on_hand).to eq 5 expect(carrots.variants.first.price).to eq 3.20 - expect(carrots.primary_taxon.name).to eq "Vegetables" + expect(carrots.variants.first.primary_taxon.name).to eq "Vegetables" expect(carrots.variants.first.shipping_category).to eq shipping_category expect(carrots.supplier).to eq enterprise expect(carrots.variants.first.unit_presentation).to eq "500g" @@ -550,7 +550,7 @@ describe ProductImport::ProductImporter do beetroot = Spree::Product.find_by(name: 'Beetroot').variants.first expect(beetroot.price).to eq 3.50 - expect(beetroot.on_demand).to_not eq true + expect(beetroot.on_demand).not_to eq true tomato = Spree::Product.find_by(name: 'Tomato').variants.first expect(tomato.price).to eq 5.50 @@ -562,7 +562,7 @@ describe ProductImport::ProductImporter do let(:csv_data) { CSV.generate do |csv| csv << ["name", "producer", "category", "on_hand", "price", "units", "unit_type"] - csv << ["Beetroot", enterprise3.name, "Meat", "5", "3.50", "500", "g"] + csv << ["Beetroot", enterprise3.name, "Vegetables", "5", "3.50", "500", "Kg"] csv << ["Tomato", enterprise3.name, "Vegetables", "6", "5.50", "500", "Kg"] end } diff --git a/spec/models/proxy_order_spec.rb b/spec/models/proxy_order_spec.rb index c6ec6bd628..0061284d5b 100644 --- a/spec/models/proxy_order_spec.rb +++ b/spec/models/proxy_order_spec.rb @@ -186,12 +186,12 @@ describe ProxyOrder, type: :model do describe "initialise_order!" do let(:order) { create(:order) } - let(:factory) { instance_double(OrderFactory) } + let(:factory) { instance_double(Orders::FactoryService) } let!(:proxy_order) { create(:proxy_order) } context "when the order has not already been initialised" do - it "creates a new order using the OrderFactory, and returns it" do - expect(OrderFactory).to receive(:new) { factory } + it "creates a new order using the Orders::FactoryService, and returns it" do + expect(Orders::FactoryService).to receive(:new) { factory } expect(factory).to receive(:create) { order } expect(proxy_order.initialise_order!).to eq order end @@ -205,8 +205,8 @@ describe ProxyOrder, type: :model do end it "returns the existing order" do - expect(OrderFactory).to_not receive(:new) - expect(proxy_order).to_not receive(:save!) + expect(Orders::FactoryService).not_to receive(:new) + expect(proxy_order).not_to receive(:save!) expect(proxy_order.initialise_order!).to eq existing_order end end diff --git a/spec/models/report_blob_spec.rb b/spec/models/report_blob_spec.rb index 1238ae1564..7df91b4344 100644 --- a/spec/models/report_blob_spec.rb +++ b/spec/models/report_blob_spec.rb @@ -9,6 +9,6 @@ describe ReportBlob, type: :model do expect do blob = ReportBlob.create!("customers.html", content) content = blob.result - end.to_not change { content.encoding }.from(Encoding::UTF_8) + end.not_to change { content.encoding }.from(Encoding::UTF_8) end end diff --git a/spec/models/semantic_link_spec.rb b/spec/models/semantic_link_spec.rb new file mode 100644 index 0000000000..ac0eae743f --- /dev/null +++ b/spec/models/semantic_link_spec.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe SemanticLink, type: :model do + it { is_expected.to belong_to :variant } + it { is_expected.to validate_presence_of(:semantic_id) } +end diff --git a/spec/models/spree/ability_spec.rb b/spec/models/spree/ability_spec.rb index 1ceb168452..b787e64a87 100644 --- a/spec/models/spree/ability_spec.rb +++ b/spec/models/spree/ability_spec.rb @@ -13,8 +13,6 @@ describe Spree::Ability do user.spree_roles.clear end - TOKEN = 'token123' - after(:each) { user.spree_roles = [] } @@ -55,10 +53,10 @@ describe Spree::Ability do context 'with customer' do it 'should not be able to admin' do - expect(subject).to_not be_able_to :admin, resource - expect(subject).to_not be_able_to :admin, resource_order - expect(subject).to_not be_able_to :admin, resource_product - expect(subject).to_not be_able_to :admin, resource_user + expect(subject).not_to be_able_to :admin, resource + expect(subject).not_to be_able_to :admin, resource_order + expect(subject).not_to be_able_to :admin, resource_product + expect(subject).not_to be_able_to :admin, resource_user end end end diff --git a/spec/models/spree/address_spec.rb b/spec/models/spree/address_spec.rb index 090a113aa6..41d0a28b15 100644 --- a/spec/models/spree/address_spec.rb +++ b/spec/models/spree/address_spec.rb @@ -36,9 +36,9 @@ describe Spree::Address do expect(cloned.state_name).to eq original.state_name expect(cloned.zipcode).to eq original.zipcode - expect(cloned.id).to_not eq original.id - expect(cloned.created_at).to_not eq original.created_at - expect(cloned.updated_at).to_not eq original.updated_at + expect(cloned.id).not_to eq original.id + expect(cloned.created_at).not_to eq original.created_at + expect(cloned.updated_at).not_to eq original.updated_at end end @@ -74,7 +74,7 @@ describe Spree::Address do it "errors when state_name is nil" do address.state_name = nil address.state = nil - expect(address).to_not be_valid + expect(address).not_to be_valid end it "full state name is in state_name and country does contain that state" do diff --git a/spec/models/spree/addresses_spec.rb b/spec/models/spree/addresses_spec.rb index fcb31c1210..1b76aa51ce 100644 --- a/spec/models/spree/addresses_spec.rb +++ b/spec/models/spree/addresses_spec.rb @@ -12,7 +12,7 @@ describe Spree::Address do describe "destroy" do it "can be deleted" do - expect { address.destroy }.to_not raise_error + expect { address.destroy }.not_to raise_error end it "cannot be deleted with associated enterprise" do diff --git a/spec/models/spree/adjustment_spec.rb b/spec/models/spree/adjustment_spec.rb index c85b61360e..f3e08d06fe 100644 --- a/spec/models/spree/adjustment_spec.rb +++ b/spec/models/spree/adjustment_spec.rb @@ -107,7 +107,7 @@ module Spree it "is false when adjustment state is open" do adjustment.state = "open" - expect(adjustment).to_not be_immutable + expect(adjustment).not_to be_immutable end end @@ -119,9 +119,9 @@ module Spree it "is false when adjustment state isn't finalized" do adjustment.state = "closed" - expect(adjustment).to_not be_finalized + expect(adjustment).not_to be_finalized adjustment.state = "open" - expect(adjustment).to_not be_finalized + expect(adjustment).not_to be_finalized end end end diff --git a/spec/models/spree/credit_card_spec.rb b/spec/models/spree/credit_card_spec.rb index 5e6e950565..1a0468ec28 100644 --- a/spec/models/spree/credit_card_spec.rb +++ b/spec/models/spree/credit_card_spec.rb @@ -74,41 +74,41 @@ module Spree context "#valid?" do it "should validate presence of number" do credit_card.attributes = valid_credit_card_attributes.except(:number) - expect(credit_card).to_not be_valid + expect(credit_card).not_to be_valid expect(credit_card.errors[:number]).to eq ["can't be blank"] end it "should validate presence of security code" do credit_card.attributes = valid_credit_card_attributes.except(:verification_value) - expect(credit_card).to_not be_valid + expect(credit_card).not_to be_valid expect(credit_card.errors[:verification_value]).to eq ["can't be blank"] end it "should validate expiration is not in the past" do credit_card.month = 1.month.ago.month credit_card.year = 1.month.ago.year - expect(credit_card).to_not be_valid + expect(credit_card).not_to be_valid expect(credit_card.errors[:base]).to eq ["has expired"] end it "does not run expiration in the past validation if month is not set" do credit_card.month = nil credit_card.year = Time.zone.now.year - expect(credit_card).to_not be_valid + expect(credit_card).not_to be_valid expect(credit_card.errors[:base]).to be_blank end it "does not run expiration in the past validation if year is not set" do credit_card.month = Time.zone.now.month credit_card.year = nil - expect(credit_card).to_not be_valid + expect(credit_card).not_to be_valid expect(credit_card.errors[:base]).to be_blank end it "does not run expiration in the past validation if year and month are empty" do credit_card.year = "" credit_card.month = "" - expect(credit_card).to_not be_valid + expect(credit_card).not_to be_valid expect(credit_card.errors[:card]).to be_blank end diff --git a/spec/models/spree/gateway/stripe_sca_spec.rb b/spec/models/spree/gateway/stripe_sca_spec.rb index 58308deb89..f3191c09d4 100644 --- a/spec/models/spree/gateway/stripe_sca_spec.rb +++ b/spec/models/spree/gateway/stripe_sca_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Spree::Gateway::StripeSCA, type: :model do +describe Spree::Gateway::StripeSCA, :vcr, :stripe_version, type: :model do let(:order) { create(:order_ready_for_payment) } let(:year_valid) { Time.zone.now.year.next } @@ -46,7 +46,11 @@ describe Spree::Gateway::StripeSCA, type: :model do }) end - describe "#purchase", :vcr, :stripe_version do + after do + Stripe::Account.delete(connected_account.id) + end + + describe "#purchase" do # Stripe acepts amounts as positive integers representing how much to charge # in the smallest currency unit let(:capture_amount) { order.total.to_i * 100 } # order total is 10 AUD @@ -71,7 +75,7 @@ describe Spree::Gateway::StripeSCA, type: :model do end end - describe "#void", :vcr, :stripe_version do + describe "#void" do let(:stripe_test_account) { connected_account.id } before do @@ -136,7 +140,7 @@ describe Spree::Gateway::StripeSCA, type: :model do end end - describe "#credit", :vcr, :stripe_version do + describe "#credit" do let(:stripe_test_account) { connected_account.id } before do @@ -166,7 +170,7 @@ describe Spree::Gateway::StripeSCA, type: :model do end end - describe "#error message", :vcr, :stripe_version do + describe "#error message" do context "when payment intent state is not in 'requires_capture' state" do before do payment diff --git a/spec/models/spree/gateway_spec.rb b/spec/models/spree/gateway_spec.rb index 294073a559..9bf43378f4 100644 --- a/spec/models/spree/gateway_spec.rb +++ b/spec/models/spree/gateway_spec.rb @@ -3,20 +3,20 @@ require 'spec_helper' describe Spree::Gateway do - class Provider - def initialize(options); end + let(:test_gateway) do + Class.new(Spree::Gateway) do + def provider_class + Class.new do + def initialize(options = {}); end - def imaginary_method; end - end - - class TestGateway < Spree::Gateway - def provider_class - Provider + def imaginary_method; end + end + end end end it "passes through all arguments on a method_missing call" do - gateway = TestGateway.new + gateway = test_gateway.new expect(gateway.provider).to receive(:imaginary_method).with('foo') gateway.imaginary_method('foo') end diff --git a/spec/models/spree/inventory_unit_spec.rb b/spec/models/spree/inventory_unit_spec.rb index 03eb0e7f61..964e57c4c4 100644 --- a/spec/models/spree/inventory_unit_spec.rb +++ b/spec/models/spree/inventory_unit_spec.rb @@ -29,7 +29,7 @@ describe Spree::InventoryUnit do # Regression for Spree #3066 it "returns modifiable objects" do units = Spree::InventoryUnit.backordered_for_stock_item(stock_item) - expect { units.first.save! }.to_not raise_error + expect { units.first.save! }.not_to raise_error end it "finds inventory units from its stock location " \ @@ -44,7 +44,7 @@ describe Spree::InventoryUnit do other_variant_unit.save! expect(Spree::InventoryUnit.backordered_for_stock_item(stock_item)) - .to_not include(other_variant_unit) + .not_to include(other_variant_unit) end end diff --git a/spec/models/spree/line_item_spec.rb b/spec/models/spree/line_item_spec.rb index 2a1499a288..fbc6f753c5 100644 --- a/spec/models/spree/line_item_spec.rb +++ b/spec/models/spree/line_item_spec.rb @@ -200,7 +200,7 @@ module Spree li3.variant.product.destroy expect(o.line_items.reload.sorted_by_name_and_unit_value).to eq([li6, li5, li4, li3]) - expect(o.line_items.sorted_by_name_and_unit_value.to_sql).to_not match "deleted_at" + expect(o.line_items.sorted_by_name_and_unit_value.to_sql).not_to match "deleted_at" end end @@ -340,7 +340,7 @@ module Spree it "draws stock from the variant override" do expect(vo.reload.count_on_hand).to eq 3 expect{ line_item.increment!(:quantity) } - .to_not change{ Spree::Variant.find(variant.id).on_hand } + .not_to change{ Spree::Variant.find(variant.id).on_hand } expect(vo.reload.count_on_hand).to eq 2 end end @@ -367,7 +367,7 @@ module Spree it "restores stock to the variant override" do expect(vo.reload.count_on_hand).to eq 3 - expect{ line_item.destroy }.to_not change{ Spree::Variant.find(variant.id).on_hand } + expect{ line_item.destroy }.not_to change{ Spree::Variant.find(variant.id).on_hand } expect(vo.reload.count_on_hand).to eq 4 end end @@ -458,7 +458,7 @@ module Spree end it "returns false otherwise" do - expect(li_no_tax).to_not have_tax + expect(li_no_tax).not_to have_tax end end diff --git a/spec/models/spree/order/checkout_spec.rb b/spec/models/spree/order/checkout_spec.rb index 391442e2f6..a8686917b2 100644 --- a/spec/models/spree/order/checkout_spec.rb +++ b/spec/models/spree/order/checkout_spec.rb @@ -6,22 +6,6 @@ describe Spree::Order::Checkout do let(:order) { Spree::Order.new } context "with default state machine" do - context "#checkout_steps" do - context "when payment not required" do - before { allow(order).to receive_messages payment_required?: false } - specify do - expect(order.checkout_steps).to eq %w(address delivery confirmation complete) - end - end - - context "when payment required" do - before { allow(order).to receive_messages payment_required?: true } - specify do - expect(order.checkout_steps).to eq %w(address delivery payment confirmation complete) - end - end - end - it "starts out at cart" do expect(order.state).to eq "cart" end diff --git a/spec/models/spree/order/payment_spec.rb b/spec/models/spree/order/payment_spec.rb index c817d9d846..2eb15a022c 100644 --- a/spec/models/spree/order/payment_spec.rb +++ b/spec/models/spree/order/payment_spec.rb @@ -87,7 +87,7 @@ module Spree expect(zero_order.payment_state).to eq "paid" expect(zero_payment.reload.state).to eq "completed" - expect(zero_payment.captured_at).to_not be_nil + expect(zero_payment.captured_at).not_to be_nil end end diff --git a/spec/models/spree/order/tax_spec.rb b/spec/models/spree/order/tax_spec.rb index b815c24e97..1e1bb80f7c 100644 --- a/spec/models/spree/order/tax_spec.rb +++ b/spec/models/spree/order/tax_spec.rb @@ -159,7 +159,7 @@ module Spree it "removes any legacy tax adjustments on order" do order.create_tax_charge! - expect(order.reload.adjustments).to_not include legacy_tax_adjustment + expect(order.reload.adjustments).not_to include legacy_tax_adjustment end it "re-applies taxes on individual items" do diff --git a/spec/models/spree/order_contents_spec.rb b/spec/models/spree/order_contents_spec.rb index d82ca11af5..4355a4f8a7 100644 --- a/spec/models/spree/order_contents_spec.rb +++ b/spec/models/spree/order_contents_spec.rb @@ -146,7 +146,7 @@ describe Spree::OrderContents do end it "does not update the order's enterprise fees if not complete" do - expect(order).to_not receive(:update_order_fees!) + expect(order).not_to receive(:update_order_fees!) subject.update_item(line_item, { quantity: 3 }) end diff --git a/spec/models/spree/order_spec.rb b/spec/models/spree/order_spec.rb index 2ce5294d59..3a0dfb7d3c 100644 --- a/spec/models/spree/order_spec.rb +++ b/spec/models/spree/order_spec.rb @@ -34,7 +34,7 @@ describe Spree::Order do end it "can find a line item matching a given variant" do - expect(order.find_line_item_by_variant(order.line_items.third.variant)).to_not be_nil + expect(order.find_line_item_by_variant(order.line_items.third.variant)).not_to be_nil expect(order.find_line_item_by_variant(build(:variant))).to be_nil end end @@ -107,7 +107,7 @@ describe Spree::Order do context "#create" do it "should assign an order number" do order = Spree::Order.create - expect(order.number).to_not be_nil + expect(order.number).not_to be_nil end end @@ -140,23 +140,6 @@ describe Spree::Order do end end - context "#invoiceable?" do - it "should return true if the order is completed" do - allow(order).to receive_messages(complete?: true) - expect(order.invoiceable?).to be_truthy - end - - it "should return true if the order is resumed" do - allow(order).to receive_messages(resumed?: true) - expect(order.invoiceable?).to be_truthy - end - - it "should return false if the order is neither completed nor resumed" do - allow(order).to receive_messages(complete?: false, resumed?: false) - expect(order.invoiceable?).to be_falsy - end - end - context '#changes_allowed?' do let(:order) { create(:order_ready_for_details) } let(:complete) { true } @@ -616,7 +599,7 @@ describe Spree::Order do describe "applying enterprise fees" do subject { create(:order) } - let(:fee_handler) { OrderFeesHandler.new(subject) } + let(:fee_handler) { Orders::HandleFeesService.new(subject) } before do allow(subject).to receive(:fee_handler) { fee_handler } @@ -628,7 +611,7 @@ describe Spree::Order do subject.recreate_all_fees! end - it "creates line item and order fee adjustments via OrderFeesHandler" do + it "creates line item and order fee adjustments via Orders::HandleFeesService" do expect(fee_handler).to receive(:create_line_item_fees!) expect(fee_handler).to receive(:create_order_fees!) subject.recreate_all_fees! @@ -997,6 +980,19 @@ describe Spree::Order do end describe "scopes" do + describe "invoiceable" do + it "finds only active orders" do + order_complete = create(:order, state: :complete) + order_canceled = create(:order, state: :canceled) + order_resumed = create(:order, state: :resumed) + + expect(Spree::Order.invoiceable).to match_array [ + order_complete, + order_resumed, + ] + end + end + describe "not_state" do it "finds only orders not in specified state" do o = FactoryBot.create(:completed_order_with_totals, @@ -1012,7 +1008,7 @@ describe Spree::Order do it "returns only orders which have line items" do expect(Spree::Order.not_empty).to include order_with_line_items - expect(Spree::Order.not_empty).to_not include order_without_line_items + expect(Spree::Order.not_empty).not_to include order_without_line_items end end end @@ -1041,19 +1037,19 @@ describe Spree::Order do describe "#customer" do it "is not required for new records" do - is_expected.to_not validate_presence_of(:customer) + is_expected.not_to validate_presence_of(:customer) end it "is not required for new complete orders" do order = Spree::Order.new(state: "complete") - expect(order).to_not validate_presence_of(:customer) + expect(order).not_to validate_presence_of(:customer) end it "is not required for existing orders in cart state" do order = create(:order) - expect(order).to_not validate_presence_of(:customer) + expect(order).not_to validate_presence_of(:customer) end it "is created for existing orders in complete state" do @@ -1070,7 +1066,7 @@ describe Spree::Order do it "does not create a customer" do expect { create(:order, distributor:) - }.to_not change { + }.not_to change { Customer.count } end @@ -1130,7 +1126,7 @@ describe Spree::Order do expect { other_order.update!(state: "complete") - }.to_not change { Customer.count } + }.not_to change { Customer.count } expect(other_order.customer.email).to eq "new@email.org" expect(order.customer).to eq other_order.customer @@ -1325,19 +1321,6 @@ describe Spree::Order do end end - describe "determining checkout steps for an order" do - let!(:enterprise) { create(:enterprise) } - let!(:order) { create(:order, distributor: enterprise) } - let!(:payment_method) { - create(:stripe_sca_payment_method, distributor_ids: [enterprise.id]) - } - let!(:payment) { create(:payment, order:, payment_method:) } - - it "does not include the :confirm step" do - expect(order.checkout_steps).to_not include "confirm" - end - end - describe "payments" do let(:payment_method) { create(:payment_method) } let(:shipping_method) { create(:shipping_method) } diff --git a/spec/models/spree/payment_spec.rb b/spec/models/spree/payment_spec.rb index 2b32af90ff..26edb058ad 100644 --- a/spec/models/spree/payment_spec.rb +++ b/spec/models/spree/payment_spec.rb @@ -145,7 +145,7 @@ describe Spree::Payment do it "should call capture if the payment is already authorized" do expect(payment).to receive(:capture!) - expect(payment).to_not receive(:purchase!) + expect(payment).not_to receive(:purchase!) payment.process_offline! end end @@ -222,7 +222,7 @@ describe Spree::Payment do it "should mark payment as failed" do allow(payment_method).to receive(:authorize).and_return(failed_response) expect(payment).to receive(:failure) - expect(payment).to_not receive(:pend) + expect(payment).not_to receive(:pend) expect { payment.authorize! }.to raise_error(Spree::Core::GatewayError) @@ -313,7 +313,7 @@ describe Spree::Payment do it "should not make payment complete" do allow(payment_method).to receive(:capture).and_return(failed_response) expect(payment).to receive(:failure) - expect(payment).to_not receive(:complete) + expect(payment).not_to receive(:complete) expect { payment.capture! }.to raise_error(Spree::Core::GatewayError) end end @@ -323,9 +323,9 @@ describe Spree::Payment do context "when payment is completed" do it "should do nothing" do payment = build_stubbed(:payment, :completed) - expect(payment).to_not receive(:complete) - expect(payment.payment_method).to_not receive(:capture) - expect(payment.log_entries).to_not receive(:create) + expect(payment).not_to receive(:complete) + expect(payment.payment_method).not_to receive(:capture) + expect(payment.log_entries).not_to receive(:create) payment.capture! end end @@ -382,7 +382,7 @@ describe Spree::Payment do context "if unsuccessful" do it "should not void the payment" do allow(payment_method).to receive(:void).and_return(failed_response) - expect(payment).to_not receive(:void) + expect(payment).not_to receive(:void) expect { payment.void_transaction! }.to raise_error(Spree::Core::GatewayError) end end @@ -391,7 +391,7 @@ describe Spree::Payment do context "if payment is already voided" do it "should not void the payment" do payment = build_stubbed(:payment, payment_method:, state: 'void') - expect(payment.payment_method).to_not receive(:void) + expect(payment.payment_method).not_to receive(:void) payment.void_transaction! end end @@ -570,8 +570,8 @@ describe Spree::Payment do payment = build_stubbed(:payment) payment.state = 'processing' - expect(payment).to_not receive(:authorize!) - expect(payment).to_not receive(:purchase!) + expect(payment).not_to receive(:authorize!) + expect(payment).not_to receive(:purchase!) expect(payment.process!).to be_nil end end @@ -717,7 +717,7 @@ describe Spree::Payment do payment_method.distributors << create(:distributor_enterprise) payment_method.save! - expect(payment_method).to_not receive :create_profile + expect(payment_method).not_to receive :create_profile payment = Spree::Payment.create( amount: 100, order: create(:order), @@ -1012,7 +1012,7 @@ describe Spree::Payment do expect(payment.adjustment.eligible?).to be false expect(payment.adjustment.finalized?).to be true expect(order.all_adjustments.payment_fee.count).to eq 1 - expect(order.all_adjustments.payment_fee.eligible).to_not include payment.adjustment + expect(order.all_adjustments.payment_fee.eligible).not_to include payment.adjustment end end @@ -1031,7 +1031,7 @@ describe Spree::Payment do expect(payment.adjustment.eligible?).to be false expect(payment.adjustment.finalized?).to be true expect(order.all_adjustments.payment_fee.count).to eq 1 - expect(order.all_adjustments.payment_fee.eligible).to_not include payment.adjustment + expect(order.all_adjustments.payment_fee.eligible).not_to include payment.adjustment end end diff --git a/spec/models/spree/preferences/configuration_spec.rb b/spec/models/spree/preferences/configuration_spec.rb index 32883d3fb6..fc4b51a709 100644 --- a/spec/models/spree/preferences/configuration_spec.rb +++ b/spec/models/spree/preferences/configuration_spec.rb @@ -3,25 +3,24 @@ require 'spec_helper' describe Spree::Preferences::Configuration do - before :all do - class AppConfig < Spree::Preferences::Configuration + let(:config) do + Class.new(Spree::Preferences::Configuration) do preference :color, :string, default: :blue - end - @config = AppConfig.new + end.new end it "has named methods to access preferences" do - @config.color = 'orange' - expect(@config.color).to eq 'orange' + config.color = 'orange' + expect(config.color).to eq 'orange' end it "uses [ ] to access preferences" do - @config[:color] = 'red' - expect(@config[:color]).to eq 'red' + config[:color] = 'red' + expect(config[:color]).to eq 'red' end it "uses set/get to access preferences" do - @config.set :color, 'green' - expect(@config.get(:color)).to eq 'green' + config.set :color, 'green' + expect(config.get(:color)).to eq 'green' end end diff --git a/spec/models/spree/preferences/preferable_spec.rb b/spec/models/spree/preferences/preferable_spec.rb index e95e069de0..4cf412c392 100644 --- a/spec/models/spree/preferences/preferable_spec.rb +++ b/spec/models/spree/preferences/preferable_spec.rb @@ -3,8 +3,8 @@ require 'spec_helper' describe Spree::Preferences::Preferable do - before :all do - class A + a_class = A = + Class.new do include Spree::Preferences::Preferable attr_reader :id @@ -15,16 +15,38 @@ describe Spree::Preferences::Preferable do preference :color, :string, default: 'green', description: "My Favorite Color" end - class B < A + b_class = B = + Class.new(a_class) do preference :flavor, :string end - end - before :each do - @a = A.new - allow(@a).to receive_messages(persisted?: true) - @b = B.new - allow(@b).to receive_messages(persisted?: true) + let(:a) { a_class.new } + let(:b) { b_class.new } + + create_pref_test = + Class.new(ActiveRecord::Migration[4.2]) do + def self.up + create_table :pref_tests do |t| + t.string :col + end + end + + def self.down + drop_table :pref_tests + end + end + + pref_test_class = + Class.new(ApplicationRecord) do + self.table_name = 'pref_tests' + + preference :pref_test_pref, :string, default: 'abc' + preference :pref_test_any, :any, default: [] + end + + before do + allow(a).to receive_messages(persisted?: true) + allow(b).to receive_messages(persisted?: true) # ensure we're persisting as that is the default # @@ -34,235 +56,213 @@ describe Spree::Preferences::Preferable do describe "preference definitions" do it "parent should not see child definitions" do - expect(@a.has_preference?(:color)).to be_truthy - expect(@a.has_preference?(:flavor)).not_to be_truthy + expect(a.has_preference?(:color)).to be_truthy + expect(a.has_preference?(:flavor)).not_to be_truthy end it "child should have parent and own definitions" do - expect(@b.has_preference?(:color)).to be_truthy - expect(@b.has_preference?(:flavor)).to be_truthy + expect(b.has_preference?(:color)).to be_truthy + expect(b.has_preference?(:flavor)).to be_truthy end it "instances have defaults" do - expect(@a.preferred_color).to eq 'green' - expect(@b.preferred_color).to eq 'green' - expect(@b.preferred_flavor).to be_nil + expect(a.preferred_color).to eq 'green' + expect(b.preferred_color).to eq 'green' + expect(b.preferred_flavor).to be_nil end it "can be asked if it has a preference definition" do - expect(@a.has_preference?(:color)).to be_truthy - expect(@a.has_preference?(:bad)).to be_falsy + expect(a.has_preference?(:color)).to be_truthy + expect(a.has_preference?(:bad)).to be_falsy end it "can be asked and raises" do expect { - @a.has_preference! :flavor + a.has_preference! :flavor }.to raise_error(NoMethodError, "flavor preference not defined") end it "has a type" do - expect(@a.preferred_color_type).to eq :string - expect(@a.preference_type(:color)).to eq :string + expect(a.preferred_color_type).to eq :string + expect(a.preference_type(:color)).to eq :string end it "has a default" do - expect(@a.preferred_color_default).to eq 'green' - expect(@a.preference_default(:color)).to eq 'green' + expect(a.preferred_color_default).to eq 'green' + expect(a.preference_default(:color)).to eq 'green' end it "has a description" do - expect(@a.preferred_color_description).to eq "My Favorite Color" - expect(@a.preference_description(:color)).to eq "My Favorite Color" + expect(a.preferred_color_description).to eq "My Favorite Color" + expect(a.preference_description(:color)).to eq "My Favorite Color" end it "raises if not defined" do expect { - @a.get_preference :flavor + a.get_preference :flavor }.to raise_error(NoMethodError, "flavor preference not defined") end end describe "preference access" do it "handles ghost methods for preferences" do - @a.preferred_color = 'blue' - expect(@a.preferred_color).to eq 'blue' + a.preferred_color = 'blue' + expect(a.preferred_color).to eq 'blue' - @a.prefers_color = 'green' - expect(@a.prefers_color?).to eq 'green' + a.prefers_color = 'green' + expect(a.prefers_color?).to eq 'green' end it "has genric readers" do - @a.preferred_color = 'red' - expect(@a.prefers?(:color)).to eq 'red' - expect(@a.preferred(:color)).to eq 'red' + a.preferred_color = 'red' + expect(a.prefers?(:color)).to eq 'red' + expect(a.preferred(:color)).to eq 'red' end it "parent and child instances have their own prefs" do - @a.preferred_color = 'red' - @b.preferred_color = 'blue' + a.preferred_color = 'red' + b.preferred_color = 'blue' - expect(@a.preferred_color).to eq 'red' - expect(@b.preferred_color).to eq 'blue' + expect(a.preferred_color).to eq 'red' + expect(b.preferred_color).to eq 'blue' end it "raises when preference not defined" do expect { - @a.set_preference(:bad, :bone) + a.set_preference(:bad, :bone) }.to raise_exception(NoMethodError, "bad preference not defined") end it "builds a hash of preferences" do - @b.preferred_flavor = :strawberry - expect(@b.preferences[:flavor]).to eq 'strawberry' - expect(@b.preferences[:color]).to eq 'green' # default from A + b.preferred_flavor = :strawberry + expect(b.preferences[:flavor]).to eq 'strawberry' + expect(b.preferences[:color]).to eq 'green' # default from A end context "database fallback" do before do - @a.instance_variable_set("@pending_preferences", {}) + a.instance_variable_set("@pending_preferences", {}) end it "retrieves a preference from the database before falling back to default" do preference = double(value: "chatreuse", key: 'a/color/123') expect(Spree::Preference).to receive(:find_by).and_return(preference) - expect(@a.preferred_color).to eq 'chatreuse' + expect(a.preferred_color).to eq 'chatreuse' end it "defaults if no database key exists" do expect(Spree::Preference).to receive(:find_by).and_return(nil) - expect(@a.preferred_color).to eq 'green' + expect(a.preferred_color).to eq 'green' end end context "converts integer preferences to integer values" do before do - A.preference :is_integer, :integer + a_class.preference :is_integer, :integer end it "with strings" do - @a.set_preference(:is_integer, '3') - expect(@a.preferences[:is_integer]).to eq 3 + a.set_preference(:is_integer, '3') + expect(a.preferences[:is_integer]).to eq 3 - @a.set_preference(:is_integer, '') - expect(@a.preferences[:is_integer]).to eq 0 + a.set_preference(:is_integer, '') + expect(a.preferences[:is_integer]).to eq 0 end end context "converts decimal preferences to BigDecimal values" do before do - A.preference :if_decimal, :decimal + a_class.preference :if_decimal, :decimal end it "returns a BigDecimal" do - @a.set_preference(:if_decimal, 3.3) - expect(@a.preferences[:if_decimal].class).to eq BigDecimal + a.set_preference(:if_decimal, 3.3) + expect(a.preferences[:if_decimal].class).to eq BigDecimal end it "with strings" do - @a.set_preference(:if_decimal, '3.3') - expect(@a.preferences[:if_decimal]).to eq 3.3 + a.set_preference(:if_decimal, '3.3') + expect(a.preferences[:if_decimal]).to eq 3.3 - @a.set_preference(:if_decimal, '') - expect(@a.preferences[:if_decimal]).to eq 0.0 + a.set_preference(:if_decimal, '') + expect(a.preferences[:if_decimal]).to eq 0.0 end context "when the value cannot be converted to BigDecimal" do it "returns the original value" do - @a.set_preference(:if_decimal, "invalid") - expect(@a.preferences[:if_decimal]).to eq "invalid" + a.set_preference(:if_decimal, "invalid") + expect(a.preferences[:if_decimal]).to eq "invalid" end end end context "converts boolean preferences to boolean values" do before do - A.preference :is_boolean, :boolean, default: true + a_class.preference :is_boolean, :boolean, default: true end it "with strings" do - @a.set_preference(:is_boolean, '0') - expect(@a.preferences[:is_boolean]).to be_falsy - @a.set_preference(:is_boolean, 'f') - expect(@a.preferences[:is_boolean]).to be_falsy - @a.set_preference(:is_boolean, 't') - expect(@a.preferences[:is_boolean]).to be_truthy + a.set_preference(:is_boolean, '0') + expect(a.preferences[:is_boolean]).to be_falsy + a.set_preference(:is_boolean, 'f') + expect(a.preferences[:is_boolean]).to be_falsy + a.set_preference(:is_boolean, 't') + expect(a.preferences[:is_boolean]).to be_truthy end it "with integers" do - @a.set_preference(:is_boolean, 0) - expect(@a.preferences[:is_boolean]).to be_falsy - @a.set_preference(:is_boolean, 1) - expect(@a.preferences[:is_boolean]).to be_truthy + a.set_preference(:is_boolean, 0) + expect(a.preferences[:is_boolean]).to be_falsy + a.set_preference(:is_boolean, 1) + expect(a.preferences[:is_boolean]).to be_truthy end it "with an empty string" do - @a.set_preference(:is_boolean, '') - expect(@a.preferences[:is_boolean]).to be_falsy + a.set_preference(:is_boolean, '') + expect(a.preferences[:is_boolean]).to be_falsy end it "with an empty hash" do - @a.set_preference(:is_boolean, []) - expect(@a.preferences[:is_boolean]).to be_falsy + a.set_preference(:is_boolean, []) + expect(a.preferences[:is_boolean]).to be_falsy end end context "converts any preferences to any values" do before do - A.preference :product_ids, :any, default: [] - A.preference :product_attributes, :any, default: {} + a_class.preference :product_ids, :any, default: [] + a_class.preference :product_attributes, :any, default: {} end it "with array" do - expect(@a.preferences[:product_ids]).to eq [] - @a.set_preference(:product_ids, [1, 2]) - expect(@a.preferences[:product_ids]).to eq [1, 2] + expect(a.preferences[:product_ids]).to eq [] + a.set_preference(:product_ids, [1, 2]) + expect(a.preferences[:product_ids]).to eq [1, 2] end it "with hash" do - expect(@a.preferences[:product_attributes]).to eq({}) - @a.set_preference(:product_attributes, { id: 1, name: 2 }) + expect(a.preferences[:product_attributes]).to eq({}) + a.set_preference(:product_attributes, { id: 1, name: 2 }) attributes_hash = { id: 1, name: 2 } - expect(@a.preferences[:product_attributes]).to eq attributes_hash + expect(a.preferences[:product_attributes]).to eq attributes_hash end end end describe "persisted preferables" do before(:all) do - class CreatePrefTest < ActiveRecord::Migration[4.2] - def self.up - create_table :pref_tests do |t| - t.string :col - end - end - - def self.down - drop_table :pref_tests - end - end - - @migration_verbosity = ActiveRecord::Migration.verbose ActiveRecord::Migration.verbose = false - CreatePrefTest.migrate(:up) - - class PrefTest < ApplicationRecord - preference :pref_test_pref, :string, default: 'abc' - preference :pref_test_any, :any, default: [] - end + create_pref_test.migrate(:up) end after(:all) do - CreatePrefTest.migrate(:down) - ActiveRecord::Migration.verbose = @migration_verbosity - end - - before(:each) do - @pt = PrefTest.create + create_pref_test.migrate(:down) + ActiveRecord::Migration.verbose = true end describe "pending preferences for new activerecord objects" do it "saves preferences after record is saved" do - pr = PrefTest.new + pr = pref_test_class.new pr.set_preference(:pref_test_pref, 'XXX') expect(pr.get_preference(:pref_test_pref)).to eq 'XXX' pr.save! @@ -270,7 +270,7 @@ describe Spree::Preferences::Preferable do end it "saves preferences for serialized object" do - pr = PrefTest.new + pr = pref_test_class.new pr.set_preference(:pref_test_any, [1, 2]) expect(pr.get_preference(:pref_test_any)).to eq [1, 2] pr.save! @@ -280,54 +280,56 @@ describe Spree::Preferences::Preferable do describe "requires a valid id" do it "for cache_key" do - pref_test = PrefTest.new + pref_test = pref_test_class.new expect(pref_test.preference_cache_key(:pref_test_pref)).to be_nil pref_test.save - expect(pref_test.preference_cache_key(:pref_test_pref)).to_not be_nil + expect(pref_test.preference_cache_key(:pref_test_pref)).not_to be_nil end it "but returns default values" do - pref_test = PrefTest.new + pref_test = pref_test_class.new expect(pref_test.get_preference(:pref_test_pref)).to eq 'abc' end it "adds prefs in a pending hash until after_create" do - pref_test = PrefTest.new + pref_test = pref_test_class.new expect(pref_test).to receive(:add_pending_preference).with(:pref_test_pref, 'XXX') pref_test.set_preference(:pref_test_pref, 'XXX') end end + let!(:pt) { pref_test_class.create } + it "clear preferences" do - @pt.set_preference(:pref_test_pref, 'xyz') - expect(@pt.preferred_pref_test_pref).to eq 'xyz' - @pt.clear_preferences - expect(@pt.preferred_pref_test_pref).to eq 'abc' + pt.set_preference(:pref_test_pref, 'xyz') + expect(pt.preferred_pref_test_pref).to eq 'xyz' + pt.clear_preferences + expect(pt.preferred_pref_test_pref).to eq 'abc' end it "clear preferences when record is deleted" do - @pt.save! - @pt.preferred_pref_test_pref = 'lmn' - @pt.save! - @pt.destroy - @pt1 = PrefTest.new(col: 'aaaa') - @pt1.id = @pt.id - @pt1.save! - expect(@pt1.get_preference(:pref_test_pref)).to_not eq 'lmn' - expect(@pt1.get_preference(:pref_test_pref)).to eq 'abc' + pt.save! + pt.preferred_pref_test_pref = 'lmn' + pt.save! + pt.destroy + pt1 = pref_test_class.new(col: 'aaaa') + pt1.id = pt.id + pt1.save! + expect(pt1.get_preference(:pref_test_pref)).not_to eq 'lmn' + expect(pt1.get_preference(:pref_test_pref)).to eq 'abc' end end it "builds cache keys" do - expect(@a.preference_cache_key(:color)).to match %r{a/color/\d+} + expect(a.preference_cache_key(:color)).to match %r{a/color/\d+} end it "can add and remove preferences" do - A.preference :test_temp, :boolean, default: true - expect(@a.preferred_test_temp).to be_truthy - A.remove_preference :test_temp - expect(@a.has_preference?(:test_temp)).to be_falsy - expect(@a.respond_to?(:preferred_test_temp)).to be_falsy + a_class.preference :test_temp, :boolean, default: true + expect(a.preferred_test_temp).to be_truthy + a_class.remove_preference :test_temp + expect(a.has_preference?(:test_temp)).to be_falsy + expect(a.respond_to?(:preferred_test_temp)).to be_falsy end end diff --git a/spec/models/spree/price_spec.rb b/spec/models/spree/price_spec.rb index 1b4898c2a2..d0fd0ad44f 100644 --- a/spec/models/spree/price_spec.rb +++ b/spec/models/spree/price_spec.rb @@ -21,7 +21,7 @@ module Spree let(:expensive_variant) { build(:variant, price: 10_000_000) } it "saves without error" do - expect{ expensive_variant.save }.to_not raise_error + expect{ expensive_variant.save }.not_to raise_error expect(expensive_variant.persisted?).to be true end end diff --git a/spec/models/spree/product_property_spec.rb b/spec/models/spree/product_property_spec.rb index 4109db924e..c99820f815 100644 --- a/spec/models/spree/product_property_spec.rb +++ b/spec/models/spree/product_property_spec.rb @@ -7,7 +7,7 @@ describe Spree::ProductProperty do it "should validate length of value" do pp = create(:product_property) pp.value = "x" * 256 - expect(pp).to_not be_valid + expect(pp).not_to be_valid end end end diff --git a/spec/models/spree/product_spec.rb b/spec/models/spree/product_spec.rb index d9bed878ce..7efd2da024 100644 --- a/spec/models/spree/product_spec.rb +++ b/spec/models/spree/product_spec.rb @@ -25,7 +25,7 @@ module Spree context "#destroy" do it "should set deleted_at value" do product.destroy - expect(product.deleted_at).to_not be_nil + expect(product.deleted_at).not_to be_nil expect(product.variants.all? { |v| !v.deleted_at.nil? }).to be_truthy end end @@ -155,7 +155,6 @@ module Spree describe "associations" do it { is_expected.to belong_to(:supplier).required } - it { is_expected.to belong_to(:primary_taxon).required } end describe "validations and defaults" do @@ -167,10 +166,6 @@ module Spree it { is_expected.to validate_length_of(:name).is_at_most(255) } it { is_expected.to validate_length_of(:sku).is_at_most(255) } - it "requires a primary taxon" do - expect(build(:simple_product, primary_taxon: nil)).not_to be_valid - end - context "unit value" do it "requires a unit value when variant unit is weight" do expect(build(:simple_product, variant_unit: 'weight', variant_unit_name: 'name', @@ -229,10 +224,11 @@ module Spree context "saving a new product" do let!(:product){ Spree::Product.new } let!(:shipping_category){ create(:shipping_category) } + let!(:taxon){ create(:taxon) } before do create(:stock_location) - product.primary_taxon = create(:taxon) + product.primary_taxon_id = taxon.id product.supplier = create(:supplier_enterprise) product.name = "Product1" product.variant_unit = "weight" @@ -248,6 +244,7 @@ module Spree standard_variant = product.variants.reload.first expect(standard_variant.price).to eq 4.27 expect(standard_variant.shipping_category).to eq shipping_category + expect(standard_variant.primary_taxon).to eq taxon end end @@ -276,7 +273,7 @@ module Spree product.variant_unit_name = nil product.variant_unit_scale = nil - expect(product).to be_invalid + expect(product).not_to be_valid end it "requires a unit scale when variant unit is weight" do @@ -324,7 +321,7 @@ module Spree let(:product) { create(:simple_product) } describe "touching affected enterprises when the product is deleted" do - let(:product) { create(:simple_product) } + let(:product) { create(:simple_product, supplier: distributor) } let(:supplier) { product.supplier } let(:distributor) { create(:distributor_enterprise) } let!(:oc) { @@ -441,14 +438,14 @@ module Spree distributors = Enterprise.where(id: [distributor1.id, distributor2.id]).to_a expect(Product.in_distributors(distributors)).to include product1, product2, product3 - expect(Product.in_distributors(distributors)).to_not include product4 + expect(Product.in_distributors(distributors)).not_to include product4 end it "returns distributed products for a given array of enterprise ids" do distributors_ids = [distributor1.id, distributor2.id] expect(Product.in_distributors(distributors_ids)).to include product1, product2, product3 - expect(Product.in_distributors(distributors_ids)).to_not include product4 + expect(Product.in_distributors(distributors_ids)).not_to include product4 end end @@ -569,7 +566,7 @@ module Spree it "lists any products with variants that are listed as visible=true" do expect(products.length).to eq(1) expect(products).to include product - expect(products).to_not include new_variant.product, hidden_variant.product + expect(products).not_to include new_variant.product, hidden_variant.product end end @@ -591,7 +588,7 @@ module Spree it 'shows products produced by the enterprise and any producers granting P-OC' do stockable_products = Spree::Product.stockable_by(shop) expect(stockable_products).to include p1, p2 - expect(stockable_products).to_not include p3 + expect(stockable_products).not_to include p3 end end diff --git a/spec/models/spree/return_authorization_spec.rb b/spec/models/spree/return_authorization_spec.rb index fe87f15f0c..68249cedc3 100644 --- a/spec/models/spree/return_authorization_spec.rb +++ b/spec/models/spree/return_authorization_spec.rb @@ -49,7 +49,7 @@ describe Spree::ReturnAuthorization do end it "should not update order state" do - expect{ return_authorization.add_variant(variant.id, 1) }.to_not change{ order.state } + expect{ return_authorization.add_variant(variant.id, 1) }.not_to change{ order.state } end end end diff --git a/spec/models/spree/shipment_spec.rb b/spec/models/spree/shipment_spec.rb index 8a3d4bd195..fc2b31b272 100644 --- a/spec/models/spree/shipment_spec.rb +++ b/spec/models/spree/shipment_spec.rb @@ -124,7 +124,7 @@ describe Spree::Shipment do to receive(:new).with(shipment.order).and_return(mock_estimator) allow(shipment).to receive_messages(shipping_method: nil) expect(shipment.refresh_rates).to eq shipping_rates - expect(shipment.reload.selected_shipping_rate).to_not be_nil + expect(shipment.reload.selected_shipping_rate).not_to be_nil end it 'should not refresh if shipment is shipped' do @@ -347,10 +347,10 @@ describe Spree::Shipment do it "should update shipped_at timestamp" do allow(shipment).to receive(:send_shipped_email) shipment.ship! - expect(shipment.shipped_at).to_not be_nil + expect(shipment.shipped_at).not_to be_nil # Ensure value is persisted shipment.reload - expect(shipment.shipped_at).to_not be_nil + expect(shipment.shipped_at).not_to be_nil end it "should send a shipment email if order.send_shipment_email is true" do diff --git a/spec/models/spree/shipping_method_spec.rb b/spec/models/spree/shipping_method_spec.rb index a7b1235499..839367c8d1 100644 --- a/spec/models/spree/shipping_method_spec.rb +++ b/spec/models/spree/shipping_method_spec.rb @@ -191,7 +191,7 @@ module Spree it "soft-deletes when destroy is called" do shipping_method.destroy - expect(shipping_method.deleted_at).to_not be_blank + expect(shipping_method.deleted_at).not_to be_blank end end diff --git a/spec/models/spree/stock/availability_validator_spec.rb b/spec/models/spree/stock/availability_validator_spec.rb index e2f03027d5..d7e39ed175 100644 --- a/spec/models/spree/stock/availability_validator_spec.rb +++ b/spec/models/spree/stock/availability_validator_spec.rb @@ -75,7 +75,7 @@ module Spree it "is not valid" do line_item.quantity = 999 validator.validate(line_item) - expect(line_item).to_not be_valid + expect(line_item).not_to be_valid end end end diff --git a/spec/models/spree/tax_rate_spec.rb b/spec/models/spree/tax_rate_spec.rb index e22fb9829c..5437ab2182 100644 --- a/spec/models/spree/tax_rate_spec.rb +++ b/spec/models/spree/tax_rate_spec.rb @@ -218,7 +218,7 @@ module Spree it "should apply adjustments for two tax rates to the order" do expect(rate_1).to receive(:adjust) - expect(rate_2).to_not receive(:adjust) + expect(rate_2).not_to receive(:adjust) Spree::TaxRate.adjust(order, line_items) end end @@ -234,7 +234,7 @@ module Spree it "should apply adjustments for two tax rates to the order" do expect(rate_1).to receive(:adjust) - expect(rate_2).to_not receive(:adjust) + expect(rate_2).not_to receive(:adjust) Spree::TaxRate.adjust(order, shipments) end end diff --git a/spec/models/spree/taxon_spec.rb b/spec/models/spree/taxon_spec.rb index edbc968585..7f481413df 100644 --- a/spec/models/spree/taxon_spec.rb +++ b/spec/models/spree/taxon_spec.rb @@ -41,11 +41,11 @@ module Spree let!(:taxon1) { create(:taxon) } let!(:taxon2) { create(:taxon) } let!(:product) { create(:simple_product, primary_taxon: taxon1) } + let(:variant) { product.variants.first } - it "is touched when assignment of primary_taxon on a product changes" do + it "is touched when assignment of primary_taxon on a variant changes" do expect do - product.primary_taxon = taxon2 - product.save + variant.update(primary_taxon: taxon2) end.to change { taxon2.reload.updated_at } end end diff --git a/spec/models/spree/user_spec.rb b/spec/models/spree/user_spec.rb index 8fc144b275..368792f8ed 100644 --- a/spec/models/spree/user_spec.rb +++ b/spec/models/spree/user_spec.rb @@ -52,7 +52,7 @@ describe Spree::User do it "enforces the limit on the number of enterprise owned" do expect(u2.owned_enterprises.reload).to eq [] u2.owned_enterprises << e1 - expect { u2.save! }.to_not raise_error + expect { u2.save! }.not_to raise_error expect do u2.owned_enterprises << e2 u2.save! @@ -92,13 +92,13 @@ describe Spree::User do it "detects emails without @" do user.email = "examplemail.com" - expect(user).to_not be_valid + expect(user).not_to be_valid expect(user.errors.messages[:email]).to include "is invalid" end it "detects backslashes at the end" do user.email = "example@gmail.com\\\\" - expect(user).to_not be_valid + expect(user).not_to be_valid end it "is okay with numbers before the @" do @@ -111,7 +111,7 @@ describe Spree::User do # valid, the network requests slow down tests and could make them flaky. expect_any_instance_of(ValidEmail2::Address).to receive(:valid_mx?).and_call_original user.email = "example@ho020tmail.com" - expect(user).to_not be_valid + expect(user).not_to be_valid end end @@ -164,10 +164,10 @@ describe Spree::User do describe "as an enterprise user" do it "returns a list of users which manage shared enterprises" do expect(u1.known_users).to include u1, u2 - expect(u1.known_users).to_not include u3 + expect(u1.known_users).not_to include u3 expect(u2.known_users).to include u1, u2 - expect(u2.known_users).to_not include u3 - expect(u3.known_users).to_not include u1, u2, u3 + expect(u2.known_users).not_to include u3 + expect(u3.known_users).not_to include u1, u2, u3 end end diff --git a/spec/models/spree/variant_spec.rb b/spec/models/spree/variant_spec.rb index 82317e9571..1771e860a1 100644 --- a/spec/models/spree/variant_spec.rb +++ b/spec/models/spree/variant_spec.rb @@ -6,10 +6,12 @@ require 'spree/localized_number' describe Spree::Variant do subject(:variant) { build(:variant) } + it { is_expected.to have_many :semantic_links } + context "validations" do it "should validate price is greater than 0" do variant.price = -1 - expect(variant).to be_invalid + expect(variant).not_to be_valid end it "should validate price is 0" do @@ -19,7 +21,7 @@ describe Spree::Variant do it "should validate unit_value is greater than 0" do variant.unit_value = 0 - expect(variant).to be_invalid + expect(variant).not_to be_valid end describe "tax category" do @@ -37,7 +39,7 @@ describe Spree::Variant do expect(variant.tax_category).to eq default expect { variant.tax_category = nil - }.to_not change { + }.not_to change { variant.tax_category } expect(variant).to be_valid @@ -57,17 +59,6 @@ describe Spree::Variant do end context "price parsing" do - before(:each) do - I18n.locale = I18n.default_locale - I18n.backend.store_translations(:de, - { number: { currency: { format: { delimiter: '.', - separator: ',' } } } }) - end - - after do - I18n.locale = I18n.default_locale - end - context "price=" do context "with decimal point" do it "captures the proper amount for a formatted price" do @@ -78,17 +69,19 @@ describe Spree::Variant do context "with decimal comma" do it "captures the proper amount for a formatted price" do - I18n.locale = :es - variant.price = '1.599,99' - expect(variant.price).to eq 1599.99 + I18n.with_locale(:es) do + variant.price = '1.599,99' + expect(variant.price).to eq 1599.99 + end end end context "with a numeric price" do it "uses the price as is" do - I18n.locale = :es - variant.price = 1599.99 - expect(variant.price).to eq 1599.99 + I18n.with_locale(:es) do + variant.price = 1599.99 + expect(variant.price).to eq 1599.99 + end end end end @@ -358,7 +351,7 @@ describe Spree::Variant do it "lists any variants that are not listed as visible=false" do expect(variants).to include new_variant, visible_variant - expect(variants).to_not include hidden_variant + expect(variants).not_to include hidden_variant end context "when inventory items exist for other enterprises" do @@ -379,7 +372,7 @@ describe Spree::Variant do it "lists any variants not listed as visible=false only for the relevant enterprise" do expect(variants).to include new_variant, visible_variant - expect(variants).to_not include hidden_variant + expect(variants).not_to include hidden_variant end end end @@ -390,7 +383,7 @@ describe Spree::Variant do it "lists any variants that are listed as visible=true" do expect(variants).to include visible_variant - expect(variants).to_not include new_variant, hidden_variant + expect(variants).not_to include new_variant, hidden_variant end end end @@ -415,7 +408,7 @@ describe Spree::Variant do it 'shows variants produced by the enterprise and any producers granting P-OC' do stockable_variants = Spree::Variant.stockable_by(shop) expect(stockable_variants).to include v1, v2 - expect(stockable_variants).to_not include v3 + expect(stockable_variants).not_to include v3 end end end diff --git a/spec/models/stripe_account_spec.rb b/spec/models/stripe_account_spec.rb index 52506ab31e..1de1df4b50 100644 --- a/spec/models/stripe_account_spec.rb +++ b/spec/models/stripe_account_spec.rb @@ -43,7 +43,7 @@ describe StripeAccount do it "destroys the record" do # returns status 200 - expect(Bugsnag).to_not receive(:notify) # and does not receive Bugsnag notification + expect(Bugsnag).not_to receive(:notify) # and does not receive Bugsnag notification expect { stripe_account.deauthorize_and_destroy }.to change { @@ -58,7 +58,7 @@ describe StripeAccount do } it "Doesn't make a Stripe API disconnection request " do - expect(Stripe::OAuth).to_not receive(:deauthorize) + expect(Stripe::OAuth).not_to receive(:deauthorize) stripe_account.deauthorize_and_destroy expect(StripeAccount.all).not_to include(stripe_account) end diff --git a/spec/models/subscription_spec.rb b/spec/models/subscription_spec.rb index 742e1952f1..29e2d0c22e 100644 --- a/spec/models/subscription_spec.rb +++ b/spec/models/subscription_spec.rb @@ -47,7 +47,7 @@ describe Subscription, type: :model do expect{ subscription.cancel }.to raise_error "Some error" expect(subscription.reload.canceled_at).to be nil expect(proxy_order1).to have_received(:cancel) - expect(proxy_order2).to_not have_received(:cancel) + expect(proxy_order2).not_to have_received(:cancel) end end end diff --git a/spec/models/variant_override_spec.rb b/spec/models/variant_override_spec.rb index 9ff4ba0709..2da715f80a 100644 --- a/spec/models/variant_override_spec.rb +++ b/spec/models/variant_override_spec.rb @@ -20,7 +20,7 @@ describe VariantOverride do } it "ignores variant_overrides with revoked_permissions by default" do - expect(VariantOverride.all).to_not include vo3 + expect(VariantOverride.all).not_to include vo3 expect(VariantOverride.unscoped).to include vo3 end @@ -141,7 +141,7 @@ describe VariantOverride do end it "soft-deletes the price" do - expect(price_object.reload.deleted_at).to_not be_nil + expect(price_object.reload.deleted_at).not_to be_nil end it "can access the soft-deleted price" do diff --git a/spec/queries/complete_orders_with_balance_spec.rb b/spec/queries/complete_orders_with_balance_query_spec.rb similarity index 53% rename from spec/queries/complete_orders_with_balance_spec.rb rename to spec/queries/complete_orders_with_balance_query_spec.rb index a587153766..0f7e856865 100644 --- a/spec/queries/complete_orders_with_balance_spec.rb +++ b/spec/queries/complete_orders_with_balance_query_spec.rb @@ -2,12 +2,12 @@ require 'spec_helper' -describe CompleteOrdersWithBalance do - let(:complete_orders_with_balance) { described_class.new(user) } +describe CompleteOrdersWithBalanceQuery do + subject(:result) { described_class.new(user).call } - describe '#query' do + describe '#call' do let(:user) { order.user } - let(:outstanding_balance) { instance_double(OutstandingBalance) } + let(:outstanding_balance) { instance_double(OutstandingBalanceQuery) } context 'when the user has complete orders' do let(:order) do @@ -24,37 +24,39 @@ describe CompleteOrdersWithBalance do ) end - it 'calls OutstandingBalance#query' do - allow(OutstandingBalance).to receive(:new).and_return(outstanding_balance) - expect(outstanding_balance).to receive(:query) + it 'calls OutstandingBalanceQuery#call' do + allow(OutstandingBalanceQuery).to receive(:new).and_return(outstanding_balance) + allow(outstanding_balance).to receive(:call) - complete_orders_with_balance.query + result + + expect(outstanding_balance).to have_received(:call) end it 'returns complete orders including their balance' do - order = complete_orders_with_balance.query.first + order = result.first expect(order[:balance_value]).to eq(-1.0) end it 'sorts them by their completed_at with the most recent first' do - orders = complete_orders_with_balance.query - expect(orders.pluck(:id)).to eq([other_order.id, order.id]) + expect(result.pluck(:id)).to eq([other_order.id, order.id]) end end context 'when the user has no complete orders' do let(:order) { create(:order) } - it 'calls OutstandingBalance' do - allow(OutstandingBalance).to receive(:new).and_return(outstanding_balance) - expect(outstanding_balance).to receive(:query) + it 'calls OutstandingBalanceQuery' do + allow(OutstandingBalanceQuery).to receive(:new).and_return(outstanding_balance) + allow(outstanding_balance).to receive(:call) - complete_orders_with_balance.query + result + + expect(outstanding_balance).to have_received(:call) end it 'returns an empty array' do - order = complete_orders_with_balance.query - expect(order).to be_empty + expect(result).to be_empty end end end diff --git a/spec/queries/complete_visible_orders_spec.rb b/spec/queries/complete_visible_orders_query_spec.rb similarity index 72% rename from spec/queries/complete_visible_orders_spec.rb rename to spec/queries/complete_visible_orders_query_spec.rb index 2018674338..af7d54872f 100644 --- a/spec/queries/complete_visible_orders_spec.rb +++ b/spec/queries/complete_visible_orders_query_spec.rb @@ -2,11 +2,12 @@ require 'spec_helper' -describe CompleteVisibleOrders do - subject(:complete_visible_orders) { described_class.new(order_permissions) } +describe CompleteVisibleOrdersQuery do + subject(:result) { described_class.new(order_permissions).call } + let(:filter_canceled) { false } - describe '#query' do + describe '#call' do let(:user) { create(:user) } let(:enterprise) { create(:enterprise) } let(:order_permissions) { Permissions::Order.new(user, filter_canceled) } @@ -20,7 +21,7 @@ describe CompleteVisibleOrders do let(:cart_order) { create(:order, distributor: enterprise) } it 'does not return it' do - expect(complete_visible_orders.query).not_to include(cart_order) + expect(result).not_to include(cart_order) end end @@ -28,13 +29,13 @@ describe CompleteVisibleOrders do let(:complete_order) { create(:order, completed_at: 1.day.ago, distributor: enterprise) } it 'does not return it' do - expect(complete_visible_orders.query).to include(complete_order) + expect(result).to include(complete_order) end end it 'calls #visible_orders' do expect(order_permissions).to receive(:visible_orders).and_call_original - complete_visible_orders.query + result end end end diff --git a/spec/queries/customers_with_balance_spec.rb b/spec/queries/customers_with_balance_query_spec.rb similarity index 80% rename from spec/queries/customers_with_balance_spec.rb rename to spec/queries/customers_with_balance_query_spec.rb index 7a600e9412..47811e21ce 100644 --- a/spec/queries/customers_with_balance_spec.rb +++ b/spec/queries/customers_with_balance_query_spec.rb @@ -2,35 +2,40 @@ require 'spec_helper' -describe CustomersWithBalance do - subject(:customers_with_balance) { described_class.new(Customer.where(id: customer)) } +describe CustomersWithBalanceQuery do + subject(:result) { described_class.new(Customer.where(id: customers)).call } - describe '#query' do + describe '#call' do let(:customer) { create(:customer) } + let(:customers) { [customer] } let(:total) { 200.00 } let(:order_total) { 100.00 } - let(:outstanding_balance) { instance_double(OutstandingBalance) } + let(:outstanding_balance) { instance_double(OutstandingBalanceQuery) } - it 'calls CustomersWithBalance#statement' do - allow(OutstandingBalance).to receive(:new).and_return(outstanding_balance) - expect(outstanding_balance).to receive(:statement) + it 'calls OutstandingBalanceQuery#statement' do + allow(OutstandingBalanceQuery).to receive(:new).and_return(outstanding_balance) + allow(outstanding_balance).to receive(:statement) - customers_with_balance.query + result + + expect(outstanding_balance).to have_received(:statement) end describe 'arguments' do context 'with customers collection' do + let(:customers) { create_pair(:customer) } + it 'returns balance' do - customers = create_pair(:customer) - query = described_class.new(Customer.where(id: customers)).query - expect(query.pluck(:id).sort).to eq([customers.first.id, customers.second.id].sort) - expect(query.map(&:balance_value)).to eq([0, 0]) + expect(result.pluck(:id).sort).to eq([customers.first.id, customers.second.id].sort) + expect(result.map(&:balance_value)).to eq([0, 0]) end end context 'with empty customers collection' do + let(:customers) { Customer.none } + it 'returns empty customers collection' do - expect(described_class.new(Customer.none).query).to eq([]) + expect(result).to eq([]) end end end @@ -42,7 +47,7 @@ describe CustomersWithBalance do end it 'returns the customer balance' do - customer = customers_with_balance.query.first + customer = result.first expect(customer.balance_value).to eq(0) end end @@ -54,7 +59,7 @@ describe CustomersWithBalance do end it 'returns the customer balance' do - customer = customers_with_balance.query.first + customer = result.first expect(customer.balance_value).to eq(0) end end @@ -62,11 +67,12 @@ describe CustomersWithBalance do context 'when orders are in delivery state' do before do create(:order, customer:, total: order_total, payment_total: 0, state: 'delivery') - create(:order, customer:, total: order_total, payment_total: 50, state: 'delivery') + create(:order, customer:, total: order_total, payment_total: 50, + state: 'delivery') end it 'returns the customer balance' do - customer = customers_with_balance.query.first + customer = result.first expect(customer.balance_value).to eq(0) end end @@ -78,7 +84,7 @@ describe CustomersWithBalance do end it 'returns the customer balance' do - customer = customers_with_balance.query.first + customer = result.first expect(customer.balance_value).to eq(0) end end @@ -92,7 +98,7 @@ describe CustomersWithBalance do end it 'returns the customer balance' do - customer = customers_with_balance.query.first + customer = result.first expect(customer.balance_value).to eq(-total) end end @@ -108,7 +114,7 @@ describe CustomersWithBalance do end it 'returns the customer balance' do - customer = customers_with_balance.query.first + customer = result.first expect(customer.balance_value).to eq(payment_total - total) end end @@ -130,7 +136,7 @@ describe CustomersWithBalance do end it 'returns the customer balance' do - customer = customers_with_balance.query.first + customer = result.first expect(customer.balance_value).to eq(payment_total - non_canceled_orders_total) end end @@ -146,7 +152,7 @@ describe CustomersWithBalance do end it 'returns the customer balance' do - customer = customers_with_balance.query.first + customer = result.first expect(customer.balance_value).to eq(payment_total - total) end end @@ -162,7 +168,7 @@ describe CustomersWithBalance do end it 'returns the customer balance' do - customer = customers_with_balance.query.first + customer = result.first expect(customer.balance_value).to eq(payment_total - total) end end @@ -178,7 +184,7 @@ describe CustomersWithBalance do end it 'returns the customer balance' do - customer = customers_with_balance.query.first + customer = result.first expect(customer.balance_value).to eq(payment_total - total) end end @@ -195,14 +201,14 @@ describe CustomersWithBalance do end it 'returns the customer balance' do - customer = customers_with_balance.query.first + customer = result.first expect(customer.balance_value).to eq(payment_total - non_returned_orders_total) end end context 'when there are no orders' do it 'returns the customer balance' do - customer = customers_with_balance.query.first + customer = result.first expect(customer.balance_value).to eq(0) end end diff --git a/spec/queries/outstanding_balance_spec.rb b/spec/queries/outstanding_balance_query_spec.rb similarity index 87% rename from spec/queries/outstanding_balance_spec.rb rename to spec/queries/outstanding_balance_query_spec.rb index 91b80f4c82..77e9acb307 100644 --- a/spec/queries/outstanding_balance_spec.rb +++ b/spec/queries/outstanding_balance_query_spec.rb @@ -2,16 +2,17 @@ require 'spec_helper' -describe OutstandingBalance do - subject(:outstanding_balance) { described_class.new(relation) } +describe OutstandingBalanceQuery do + subject(:query) { described_class.new(relation) } + + let(:result) { query.call } describe '#statement' do let(:relation) { Spree::Order.none } + let(:normalized_sql_statement) { normalize(query.statement) } it 'returns the CASE statement necessary to compute the order balance' do - normalized_sql_statement = normalize(outstanding_balance.statement) - - expect(normalized_sql_statement).to eq(normalize(<<-SQL)) + expect(normalized_sql_statement).to eq(normalize(<<-SQL.squish)) CASE WHEN "spree_orders"."state" IN ('canceled', 'returned') THEN "spree_orders"."payment_total" WHEN "spree_orders"."state" IS NOT NULL THEN "spree_orders"."payment_total" - "spree_orders"."total" ELSE 0 END @@ -23,7 +24,7 @@ describe OutstandingBalance do end end - describe '#query' do + describe '#call' do let(:relation) { Spree::Order.all } let(:total) { 200.00 } let(:order_total) { 100.00 } @@ -35,7 +36,7 @@ describe OutstandingBalance do end it 'returns the order balance' do - order = outstanding_balance.query.first + order = result.first expect(order.balance_value).to eq(-order_total) end end @@ -47,7 +48,7 @@ describe OutstandingBalance do end it 'returns the order balance' do - order = outstanding_balance.query.first + order = result.first expect(order.balance_value).to eq(-order_total) end end @@ -59,7 +60,7 @@ describe OutstandingBalance do end it 'returns the order balance' do - order = outstanding_balance.query.first + order = result.first expect(order.balance_value).to eq(-order_total) end end @@ -71,7 +72,7 @@ describe OutstandingBalance do end it 'returns the order balance' do - order = outstanding_balance.query.first + order = result.first expect(order.balance_value).to eq(-order_total) end end @@ -85,7 +86,7 @@ describe OutstandingBalance do end it 'returns the customer balance' do - order = outstanding_balance.query.first + order = result.first expect(order.balance_value).to eq(-order_total) end end @@ -101,7 +102,7 @@ describe OutstandingBalance do end it 'returns the customer balance' do - order = outstanding_balance.query.first + order = result.first expect(order.balance_value).to eq(payment_total - 200.0) end end @@ -117,7 +118,7 @@ describe OutstandingBalance do end it 'returns the customer balance' do - order = outstanding_balance.query.first + order = result.first expect(order.balance_value).to eq(payment_total) end end @@ -133,7 +134,7 @@ describe OutstandingBalance do end it 'returns the customer balance' do - order = outstanding_balance.query.first + order = result.first expect(order.balance_value).to eq(payment_total - 200.0) end end @@ -149,7 +150,7 @@ describe OutstandingBalance do end it 'returns the customer balance' do - order = outstanding_balance.query.first + order = result.first expect(order.balance_value).to eq(payment_total - 200.0) end end @@ -165,7 +166,7 @@ describe OutstandingBalance do end it 'returns the customer balance' do - order = outstanding_balance.query.first + order = result.first expect(order.balance_value).to eq(payment_total - 200.0) end end @@ -182,14 +183,14 @@ describe OutstandingBalance do end it 'returns the customer balance' do - order = outstanding_balance.query.first + order = result.first expect(order.balance_value).to eq(payment_total) end end context 'when there are no orders' do it 'returns the order balance' do - orders = outstanding_balance.query + orders = result expect(orders).to be_empty end end diff --git a/spec/queries/payments_requiring_action_spec.rb b/spec/queries/payments_requiring_action_query_spec.rb similarity index 70% rename from spec/queries/payments_requiring_action_spec.rb rename to spec/queries/payments_requiring_action_query_spec.rb index 77a9ca0404..4101a181ca 100644 --- a/spec/queries/payments_requiring_action_spec.rb +++ b/spec/queries/payments_requiring_action_query_spec.rb @@ -2,12 +2,13 @@ require 'spec_helper' -describe PaymentsRequiringAction do +describe PaymentsRequiringActionQuery do + subject(:result) { described_class.new(user).call } + let(:user) { create(:user) } let(:order) { create(:order, user:) } - subject(:payments_requiring_action) { described_class.new(user) } - describe '#query' do + describe '#call' do context "payment has a cvv_response_message" do let(:payment) do create(:payment, @@ -17,7 +18,7 @@ describe PaymentsRequiringAction do end it "finds the payment" do - expect(payments_requiring_action.query.all).to include(payment) + expect(result.all).to include(payment) end end @@ -27,7 +28,7 @@ describe PaymentsRequiringAction do end it "does not find the payment" do - expect(payments_requiring_action.query.all).to_not include(payment) + expect(result.all).not_to include(payment) end end end diff --git a/spec/queries/product_scope_query_spec.rb b/spec/queries/product_scope_query_spec.rb index f8bde2c8da..9674a201f5 100755 --- a/spec/queries/product_scope_query_spec.rb +++ b/spec/queries/product_scope_query_spec.rb @@ -12,7 +12,7 @@ describe ProductScopeQuery do before { current_api_user.enterprise_roles.create(enterprise: supplier2) } - describe 'bulk update' do + describe '#bulk_products' do let!(:product3) { create(:product, supplier: supplier2) } it "returns a list of products" do @@ -28,12 +28,29 @@ describe ProductScopeQuery do expect(subject).not_to include(product2, product3) end - it "filters results by product category" do - subject = ProductScopeQuery - .new(current_api_user, { q: { primary_taxon_id_eq: taxon.id } }).bulk_products + describe "by variant category" do + it "filters results by product category" do + create(:variant, product: product2, primary_taxon: taxon) - expect(subject).to include(product, product2) - expect(subject).not_to include(product3) + subject = ProductScopeQuery + .new(current_api_user, { q: { variants_primary_taxon_id_eq: taxon.id } }) + .bulk_products + + expect(subject).to match_array([product, product2]) + expect(subject).not_to include(product3) + end + + context "with mutiple variant in the same category" do + it "doesn't duplicate products" do + create(:variant, product: product2, primary_taxon: taxon) + + subject = ProductScopeQuery + .new(current_api_user, { q: { variants_primary_taxon_id_eq: taxon.id } }) + .bulk_products + + expect(subject).to match_array([product, product2]) + end + end end it "filters results by import_date" do diff --git a/spec/reflexes/products_reflex_spec.rb b/spec/reflexes/products_reflex_spec.rb index 72bab6b015..97bf617161 100644 --- a/spec/reflexes/products_reflex_spec.rb +++ b/spec/reflexes/products_reflex_spec.rb @@ -14,212 +14,6 @@ describe ProductsReflex, type: :reflex, feature: :admin_style_v3 do allow_any_instance_of(described_class).to receive(:flash).and_return(flash) end - describe '#fetch' do - subject{ build_reflex(method_name: :fetch, **context) } - - describe "sorting" do - let!(:product_z) { create(:simple_product, name: "Zucchini") } - # let!(:product_b) { create(:simple_product, name: "bananas") } # Fails on macOS - let!(:product_a) { create(:simple_product, name: "Apples") } - - it "Should sort products alphabetically by default" do - subject.run(:fetch) - - expect(subject.get(:products).to_a).to eq [ - product_a, - # product_b, - product_z, - ] - end - end - end - - describe '#bulk_update' do - let!(:variant_a1) { - product_a.variants.first.tap{ |v| - v.update! display_name: "Medium box", sku: "APL-01", price: 5.25, on_hand: 5, - on_demand: false - } - } - let!(:product_c) { create(:simple_product, name: "Carrots", sku: "CAR-00") } - let!(:product_b) { create(:simple_product, name: "Bananas", sku: "BAN-00") } - let!(:product_a) { create(:simple_product, name: "Apples", sku: "APL-00") } - - it "saves valid changes" do - params = { - # '[products][0][name]' - "products" => { - "0" => { - "id" => product_a.id.to_s, - "name" => "Pommes", - "sku" => "POM-00", - }, - }, - } - - expect{ - run_reflex(:bulk_update, params:) - product_a.reload - }.to change{ product_a.name }.to("Pommes") - .and change{ product_a.sku }.to("POM-00") - - expect(flash).to include success: "Changes saved" - end - - it "saves valid changes to products and nested variants" do - # Form field names: - # '[products][0][id]' (hidden field) - # '[products][0][name]' - # '[products][0][variants_attributes][0][id]' (hidden field) - # '[products][0][variants_attributes][0][display_name]' - params = { - "products" => { - "0" => { - "id" => product_a.id.to_s, - "name" => "Pommes", - "variants_attributes" => { - "0" => { - "id" => variant_a1.id.to_s, - "display_name" => "Large box", - "sku" => "POM-01", - "price" => "10.25", - "on_hand" => "6", - }, - }, - }, - }, - } - - expect{ - run_reflex(:bulk_update, params:) - product_a.reload - variant_a1.reload - }.to change{ product_a.name }.to("Pommes") - .and change{ variant_a1.display_name }.to("Large box") - .and change{ variant_a1.sku }.to("POM-01") - .and change{ variant_a1.price }.to(10.25) - .and change{ variant_a1.on_hand }.to(6) - - expect(flash).to include success: "Changes saved" - end - - it "creates new variants" do - # Form field names: - # '[products][0][id]' (hidden field) - # '[products][0][name]' - # '[products][0][variants_attributes][0][id]' (hidden field) - # '[products][0][variants_attributes][0][display_name]' - # '[products][0][variants_attributes][1][display_name]' (id is omitted for new record) - # '[products][0][variants_attributes][2][display_name]' (more than 1 new record is allowed) - params = { - "products" => { - "0" => { - "id" => product_a.id.to_s, - "name" => "Pommes", - "variants_attributes" => { - "0" => { - "id" => variant_a1.id.to_s, - "display_name" => "Large box", - }, - "1" => { - "display_name" => "Small box", - "sku" => "POM-02", - "price" => "5.25", - "unit_value" => "0.5", - }, - "2" => { - "sku" => "POM-03", - "price" => "15.25", - "unit_value" => "2", - }, - }, - }, - }, - } - - expect{ - run_reflex(:bulk_update, params:) - product_a.reload - variant_a1.reload - }.to change{ product_a.name }.to("Pommes") - .and change{ variant_a1.display_name }.to("Large box") - .and change{ product_a.variants.count }.by(2) - - variant_a2 = product_a.variants[1] - expect(variant_a2.display_name).to eq "Small box" - expect(variant_a2.sku).to eq "POM-02" - expect(variant_a2.price).to eq 5.25 - expect(variant_a2.unit_value).to eq 0.5 - - variant_a3 = product_a.variants[2] - expect(variant_a3.display_name).to be_nil - expect(variant_a3.sku).to eq "POM-03" - expect(variant_a3.price).to eq 15.25 - expect(variant_a3.unit_value).to eq 2 - - expect(flash).to include success: "Changes saved" - end - - describe "sorting" do - let(:params) { - { - "products" => { - "0" => { - "id" => product_a.id.to_s, - "name" => "Pommes", - }, - "1" => { - "id" => product_b.id.to_s, - }, - }, - } - } - subject{ run_reflex(:bulk_update, params:) } - - it "Should retain sort order, even when names change" do - expect(subject.get(:products).map(&:id)).to eq [ - product_a.id, - product_b.id, - ] - expect(flash).to include success: "Changes saved" - end - end - - describe "error messages" do - it "summarises error messages" do - params = { - "products" => { - "0" => { - "id" => product_a.id.to_s, - "name" => "Pommes", - }, - "1" => { - "id" => product_b.id.to_s, - "name" => "", # Name can't be blank - }, - "2" => { - "id" => product_c.id.to_s, - "name" => "", # Name can't be blank - }, - }, - } - - reflex = run_reflex(:bulk_update, params:) - expect(reflex.get(:error_counts)).to eq({ saved: 1, invalid: 2 }) - expect(flash).to_not include success: "Changes saved" - - # # WTF - # expect{ reflex(:bulk_update, params:) }.to broadcast( - # replace: { - # selector: "#products-form", - # html: /2 products have errors/, - # }, - # broadcast: nil - # ) - end - end - end - describe '#delete_product' do let(:product) { create(:simple_product) } let(:action_name) { :delete_product } diff --git a/spec/requests/admin/images_spec.rb b/spec/requests/admin/images_spec.rb index 1ab0f05fcf..11d3659482 100644 --- a/spec/requests/admin/images_spec.rb +++ b/spec/requests/admin/images_spec.rb @@ -47,7 +47,7 @@ describe "/admin/products/:product_id/images", type: :request do expect { subject product.reload - }.to_not change{ product.image&.attachment&.filename.to_s } + }.not_to change{ product.image&.attachment&.filename.to_s } pending "error status code" expect(response).to be_unprocessable diff --git a/spec/requests/checkout/failed_checkout_spec.rb b/spec/requests/checkout/failed_checkout_spec.rb index 555d93e827..fdde8cb297 100644 --- a/spec/requests/checkout/failed_checkout_spec.rb +++ b/spec/requests/checkout/failed_checkout_spec.rb @@ -39,7 +39,7 @@ describe "checking out an order that initially fails", type: :request do before do order_cycle_distributed_variants = double(:order_cycle_distributed_variants) - allow(OrderCycleDistributedVariants).to receive(:new) + allow(OrderCycles::DistributedVariantsService).to receive(:new) .and_return(order_cycle_distributed_variants) allow(order_cycle_distributed_variants) .to receive(:distributes_order_variants?).and_return(true) diff --git a/spec/requests/checkout/routes_spec.rb b/spec/requests/checkout/routes_spec.rb index 4d51386a7b..0f1b518b8d 100644 --- a/spec/requests/checkout/routes_spec.rb +++ b/spec/requests/checkout/routes_spec.rb @@ -26,7 +26,7 @@ describe 'checkout endpoints', type: :request do before do order_cycle_distributed_variants = double(:order_cycle_distributed_variants) - allow(OrderCycleDistributedVariants).to receive(:new) + allow(OrderCycles::DistributedVariantsService).to receive(:new) .and_return(order_cycle_distributed_variants) allow(order_cycle_distributed_variants).to receive(:distributes_order_variants?) .and_return(true) diff --git a/spec/requests/checkout/stripe_sca_spec.rb b/spec/requests/checkout/stripe_sca_spec.rb index d6acbc0857..8c5c48a363 100644 --- a/spec/requests/checkout/stripe_sca_spec.rb +++ b/spec/requests/checkout/stripe_sca_spec.rb @@ -84,7 +84,9 @@ describe "checking out an order with a Stripe SCA payment method", type: :reques before do order_cycle_distributed_variants = double(:order_cycle_distributed_variants) - allow(OrderCycleDistributedVariants).to receive(:new) { order_cycle_distributed_variants } + allow(OrderCycles::DistributedVariantsService).to receive(:new) { + order_cycle_distributed_variants + } allow(order_cycle_distributed_variants).to receive(:distributes_order_variants?) { true } allow(Stripe).to receive(:publishable_key).and_return("some_token") allow(Spree::Config).to receive(:stripe_connect_enabled).and_return(true) diff --git a/spec/requests/omniauth_callbacks_controller_spec.rb b/spec/requests/omniauth_callbacks_controller_spec.rb index 0aad02a08c..0bf3147ea2 100644 --- a/spec/requests/omniauth_callbacks_controller_spec.rb +++ b/spec/requests/omniauth_callbacks_controller_spec.rb @@ -43,7 +43,7 @@ describe '/user/spree_user/auth/openid_connect/callback', type: :request do end it 'fails with bad auth data' do - expect { request! }.to_not change { OidcAccount.count } + expect { request! }.not_to change { OidcAccount.count } expect(response.status).to eq(302) end diff --git a/spec/requests/spree/admin/overview_spec.rb b/spec/requests/spree/admin/overview_spec.rb index 14f03d6498..4fc00f5563 100644 --- a/spec/requests/spree/admin/overview_spec.rb +++ b/spec/requests/spree/admin/overview_spec.rb @@ -45,7 +45,7 @@ describe "/admin", type: :request do get "/admin" - expect(response.body).to_not include("Terms of Service have been updated") + expect(response.body).not_to include("Terms of Service have been updated") end end @@ -66,7 +66,7 @@ describe "/admin", type: :request do get "/admin" - expect(response.body).to_not include("Terms of Service have been updated") + expect(response.body).not_to include("Terms of Service have been updated") end end @@ -79,7 +79,7 @@ describe "/admin", type: :request do it "doesn't show accept new ToS banner" do get "/admin" - expect(response.body).to_not include("Terms of Service have been updated") + expect(response.body).not_to include("Terms of Service have been updated") end end end diff --git a/spec/requests/voucher_adjustments_spec.rb b/spec/requests/voucher_adjustments_spec.rb index 39d2e78545..56af4db442 100644 --- a/spec/requests/voucher_adjustments_spec.rb +++ b/spec/requests/voucher_adjustments_spec.rb @@ -25,7 +25,7 @@ describe VoucherAdjustmentsController, type: :request do order.update!(created_by: user) order.select_shipping_method shipping_method.id - OrderWorkflow.new(order).advance_to_payment + Orders::WorkflowService.new(order).advance_to_payment sign_in user end diff --git a/spec/serializers/api/admin/enterprise_serializer_spec.rb b/spec/serializers/api/admin/enterprise_serializer_spec.rb index 80fc821298..7c588bee1c 100644 --- a/spec/serializers/api/admin/enterprise_serializer_spec.rb +++ b/spec/serializers/api/admin/enterprise_serializer_spec.rb @@ -21,7 +21,7 @@ describe Api::Admin::EnterpriseSerializer do it "includes URLs of image versions" do serializer = Api::Admin::EnterpriseSerializer.new(enterprise) - expect(serializer.as_json[:logo]).to_not be_blank + expect(serializer.as_json[:logo]).not_to be_blank expect(serializer.as_json[:logo][:medium]).to match(/logo-black.png/) end end @@ -46,7 +46,7 @@ describe Api::Admin::EnterpriseSerializer do it "includes URLs of image versions" do serializer = Api::Admin::EnterpriseSerializer.new(enterprise) - expect(serializer.as_json[:promo_image]).to_not be_blank + expect(serializer.as_json[:promo_image]).not_to be_blank expect(serializer.as_json[:promo_image][:medium]).to match(/logo-black\.png$/) end end diff --git a/spec/serializers/api/admin/exchange_serializer_spec.rb b/spec/serializers/api/admin/exchange_serializer_spec.rb index 7d55721205..5f12b44cd5 100644 --- a/spec/serializers/api/admin/exchange_serializer_spec.rb +++ b/spec/serializers/api/admin/exchange_serializer_spec.rb @@ -40,7 +40,7 @@ describe Api::Admin::ExchangeSerializer do .with(exchange.order_cycle.coordinator) expect(exchange.variants).to include v1, v2, v3 expect(visible_variants.keys).to include v1.id - expect(visible_variants.keys).to_not include v2.id, v3.id + expect(visible_variants.keys).not_to include v2.id, v3.id end end @@ -54,10 +54,10 @@ describe Api::Admin::ExchangeSerializer do visible_variants = serializer.variants expect(permissions_mock).to have_received(:visible_variants_for_incoming_exchanges_from) .with(exchange.sender) - expect(permitted_variants).to_not have_received(:visible_for) + expect(permitted_variants).not_to have_received(:visible_for) expect(exchange.variants).to include v1, v2, v3 expect(visible_variants.keys).to include v1.id, v2.id - expect(visible_variants.keys).to_not include v3.id + expect(visible_variants.keys).not_to include v3.id end end end @@ -88,10 +88,10 @@ describe Api::Admin::ExchangeSerializer do expect(permissions_mock).to have_received(:visible_variants_for_outgoing_exchanges_to) .with(exchange.receiver) expect(permitted_variants).to have_received(:not_hidden_for).with(exchange.receiver) - expect(permitted_variants).to_not have_received(:visible_for) + expect(permitted_variants).not_to have_received(:visible_for) expect(exchange.variants).to include v1, v2, v3 expect(visible_variants.keys).to include v1.id, v2.id - expect(visible_variants.keys).to_not include v3.id + expect(visible_variants.keys).not_to include v3.id end end @@ -107,10 +107,10 @@ describe Api::Admin::ExchangeSerializer do expect(permissions_mock).to have_received(:visible_variants_for_outgoing_exchanges_to) .with(exchange.receiver) expect(permitted_variants).to have_received(:visible_for).with(exchange.receiver) - expect(permitted_variants).to_not have_received(:not_hidden_for) + expect(permitted_variants).not_to have_received(:not_hidden_for) expect(exchange.variants).to include v1, v2, v3 expect(visible_variants.keys).to include v1.id - expect(visible_variants.keys).to_not include v2.id, v3.id + expect(visible_variants.keys).not_to include v2.id, v3.id end end end diff --git a/spec/serializers/api/admin/order_cycle_serializer_spec.rb b/spec/serializers/api/admin/order_cycle_serializer_spec.rb index b3badb7672..e04e362dc1 100644 --- a/spec/serializers/api/admin/order_cycle_serializer_spec.rb +++ b/spec/serializers/api/admin/order_cycle_serializer_spec.rb @@ -22,7 +22,7 @@ describe Api::Admin::OrderCycleSerializer do variant_ids = from_json(serializer.editable_variants_for_incoming_exchanges).values.flatten expect(variant_ids).to include order_cycle.variants.first.id - expect(distributor_ids).to_not include order_cycle.distributors.first.id.to_s + expect(distributor_ids).not_to include order_cycle.distributors.first.id.to_s end it "serializes the order cycle with editable_variants_for_outgoing_exchanges" do diff --git a/spec/serializers/api/product_serializer_spec.rb b/spec/serializers/api/product_serializer_spec.rb index fc50f7c3c0..d44e964665 100644 --- a/spec/serializers/api/product_serializer_spec.rb +++ b/spec/serializers/api/product_serializer_spec.rb @@ -28,7 +28,7 @@ describe Api::ProductSerializer do it "serializes various attributes" do expect(serializer.serializable_hash.keys).to eq [ :id, :name, :meta_keywords, :group_buy, :notes, :description, :description_html, - :properties_with_values, :variants, :primary_taxon, :image, :supplier + :properties_with_values, :variants, :image, :supplier ] end diff --git a/spec/services/cart_service_spec.rb b/spec/services/cart_service_spec.rb index 89d7432752..ea5b1dc731 100644 --- a/spec/services/cart_service_spec.rb +++ b/spec/services/cart_service_spec.rb @@ -284,12 +284,12 @@ describe CartService do let(:order_cycle_distributed_variants) { double(:order_cycle_distributed_variants) } before do - expect(OrderCycleDistributedVariants) + expect(OrderCycles::DistributedVariantsService) .to receive(:new).with(234, 123).and_return(order_cycle_distributed_variants) cart_service.instance_eval { @distributor = 123; @order_cycle = 234 } end - it "delegates to OrderCycleDistributedVariants, returning true when available" do + it "delegates to OrderCycles::DistributedVariantsService, returning true when available" do expect(order_cycle_distributed_variants).to receive(:available_variants) .and_return([variant]) @@ -297,7 +297,7 @@ describe CartService do expect(cart_service.errors).to be_empty end - it "delegates to OrderCycleDistributedVariants, returning false and erroring otherwise" do + it "delegates to OrderCycles::DistributedVariantsService, returns false - error otherwise" do expect(order_cycle_distributed_variants).to receive(:available_variants).and_return([]) expect(cart_service.send(:check_variant_available_under_distribution, variant)).to be false diff --git a/spec/services/checkout/post_checkout_actions_spec.rb b/spec/services/checkout/post_checkout_actions_spec.rb index fb8db90b98..765b84e541 100644 --- a/spec/services/checkout/post_checkout_actions_spec.rb +++ b/spec/services/checkout/post_checkout_actions_spec.rb @@ -22,7 +22,7 @@ describe Checkout::PostCheckoutActions do it "sets customer's terms_and_conditions to the current time if terms have been accepted" do params = { order: { terms_and_conditions_accepted: true } } postCheckoutActions.success(params, current_user) - expect(order.customer.terms_and_conditions_accepted_at).to_not be_nil + expect(order.customer.terms_and_conditions_accepted_at).not_to be_nil end end @@ -51,10 +51,12 @@ describe Checkout::PostCheckoutActions do end describe "#failure" do - let(:restart_checkout_service) { instance_double(OrderCheckoutRestart) } + let(:restart_checkout_service) { instance_double(Orders::CheckoutRestartService) } it "restarts the checkout process" do - expect(OrderCheckoutRestart).to receive(:new).with(order).and_return(restart_checkout_service) + expect(Orders::CheckoutRestartService).to receive(:new) + .with(order) + .and_return(restart_checkout_service) expect(restart_checkout_service).to receive(:call) postCheckoutActions.failure diff --git a/spec/services/checkout/stripe_redirect_spec.rb b/spec/services/checkout/stripe_redirect_spec.rb index 164151e145..a2d547e886 100644 --- a/spec/services/checkout/stripe_redirect_spec.rb +++ b/spec/services/checkout/stripe_redirect_spec.rb @@ -25,7 +25,7 @@ describe Checkout::StripeRedirect do end it "authorizes the payment and returns the redirect path" do - expect(OrderPaymentFinder).to receive_message_chain(:new, :last_pending_payment). + expect(Orders::FindPaymentService).to receive_message_chain(:new, :last_pending_payment). and_return(stripe_payment) expect(OrderManagement::Order::StripeScaPaymentAuthorize).to receive(:new).and_call_original diff --git a/spec/services/image_importer_spec.rb b/spec/services/image_importer_spec.rb index 8fc8e20395..b00796b25a 100644 --- a/spec/services/image_importer_spec.rb +++ b/spec/services/image_importer_spec.rb @@ -14,7 +14,7 @@ describe ImageImporter do Spree::Image.count }.by(1) - expect(product.image).to_not be_nil + expect(product.image).not_to be_nil expect(product.reload.image.attachment_blob.byte_size).to eq 6274 end end diff --git a/spec/services/order_cycle_clone_spec.rb b/spec/services/order_cycles/clone_service_spec.rb similarity index 97% rename from spec/services/order_cycle_clone_spec.rb rename to spec/services/order_cycles/clone_service_spec.rb index 7779b19da3..32525a5b73 100644 --- a/spec/services/order_cycle_clone_spec.rb +++ b/spec/services/order_cycles/clone_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe OrderCycleForm do +describe OrderCycles::CloneService do describe "#create" do it "clones the order cycle" do coordinator = create(:enterprise); @@ -14,7 +14,7 @@ describe OrderCycleForm do ex1 = create(:exchange, order_cycle: oc) ex2 = create(:exchange, order_cycle: oc) - occ = OrderCycleClone.new(oc).create + occ = OrderCycles::CloneService.new(oc).create expect(occ.name).to eq("COPY OF #{oc.name}") expect(occ.orders_open_at).to be_nil expect(occ.orders_close_at).to be_nil diff --git a/spec/services/order_cycle_distributed_products_spec.rb b/spec/services/order_cycles/distributed_products_service_spec.rb similarity index 94% rename from spec/services/order_cycle_distributed_products_spec.rb rename to spec/services/order_cycles/distributed_products_service_spec.rb index 9a137f85f3..76a41be2d7 100644 --- a/spec/services/order_cycle_distributed_products_spec.rb +++ b/spec/services/order_cycles/distributed_products_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe OrderCycleDistributedProducts do +describe OrderCycles::DistributedProductsService do describe "#products_relation" do let(:distributor) { create(:distributor_enterprise) } let(:product) { create(:product) } @@ -30,7 +30,7 @@ describe OrderCycleDistributedProducts do it "does not return product" do expect(described_class.new(distributor, order_cycle, - customer).products_relation).to_not include product + customer).products_relation).not_to include product end end @@ -42,7 +42,7 @@ describe OrderCycleDistributedProducts do it "does not return product" do expect(described_class.new(distributor, order_cycle, - customer).products_relation).to_not include product + customer).products_relation).not_to include product end end @@ -56,7 +56,7 @@ describe OrderCycleDistributedProducts do it "does not return product when variant is out of stock" do variant.update_attribute(:on_hand, 0) expect(described_class.new(distributor, order_cycle, - customer).products_relation).to_not include product + customer).products_relation).not_to include product end end @@ -67,7 +67,7 @@ describe OrderCycleDistributedProducts do it "does not return product when an override is out of stock" do expect(described_class.new(distributor, order_cycle, - customer).products_relation).to_not include product + customer).products_relation).not_to include product end it "returns product when an override is in stock" do @@ -93,11 +93,11 @@ describe OrderCycleDistributedProducts do it "returns variants in the oc" do expect(variants).to include v1 - expect(variants).to_not include v2 + expect(variants).not_to include v2 end it "does not return variants where override is out of stock" do - expect(variants).to_not include v3 + expect(variants).not_to include v3 end end end diff --git a/spec/services/order_cycle_distributed_variants_spec.rb b/spec/services/order_cycles/distributed_variants_service_spec.rb similarity index 86% rename from spec/services/order_cycle_distributed_variants_spec.rb rename to spec/services/order_cycles/distributed_variants_service_spec.rb index 672f33a3e5..6c5bde8aa1 100644 --- a/spec/services/order_cycle_distributed_variants_spec.rb +++ b/spec/services/order_cycles/distributed_variants_service_spec.rb @@ -2,11 +2,11 @@ require 'spec_helper' -describe OrderCycleDistributedVariants do +describe OrderCycles::DistributedVariantsService do let(:order) { double(:order) } let(:distributor) { double(:distributor) } let(:order_cycle) { double(:order_cycle) } - let(:subject) { OrderCycleDistributedVariants.new(order_cycle, distributor) } + let(:subject) { OrderCycles::DistributedVariantsService.new(order_cycle, distributor) } let(:product) { double(:product) } describe "checking if an order can change to a specified new distribution" do @@ -33,7 +33,7 @@ describe OrderCycleDistributedVariants do end it "returns an empty array when order cycle is nil" do - subject = OrderCycleDistributedVariants.new(nil, nil) + subject = OrderCycles::DistributedVariantsService.new(nil, nil) expect(subject.available_variants).to eq [] end end diff --git a/spec/services/order_cycle_form_spec.rb b/spec/services/order_cycles/form_service_spec.rb similarity index 92% rename from spec/services/order_cycle_form_spec.rb rename to spec/services/order_cycles/form_service_spec.rb index faac0fb6b0..3f39ad5439 100644 --- a/spec/services/order_cycle_form_spec.rb +++ b/spec/services/order_cycles/form_service_spec.rb @@ -2,12 +2,12 @@ require 'spec_helper' -describe OrderCycleForm do +describe OrderCycles::FormService do describe "save" do describe "creating a new order cycle from params" do let(:shop) { create(:enterprise) } let(:order_cycle) { OrderCycle.new } - let(:form) { OrderCycleForm.new(order_cycle, params, shop.owner) } + let(:form) { OrderCycles::FormService.new(order_cycle, params, shop.owner) } context "when creation is successful" do let(:params) { { name: "Test Order Cycle", coordinator_id: shop.id } } @@ -25,7 +25,7 @@ describe OrderCycleForm do it "returns false" do expect do expect(form.save).to be false - end.to_not change { OrderCycle.count } + end.not_to change { OrderCycle.count } end end end @@ -33,7 +33,7 @@ describe OrderCycleForm do describe "updating an existing order cycle from params" do let(:shop) { create(:enterprise) } let(:order_cycle) { create(:simple_order_cycle, name: "Old Name") } - let(:form) { OrderCycleForm.new(order_cycle, params, shop.owner) } + let(:form) { OrderCycles::FormService.new(order_cycle, params, shop.owner) } context "when update is successful" do let(:params) { { name: "Test Order Cycle", coordinator_id: shop.id } } @@ -51,7 +51,7 @@ describe OrderCycleForm do it "returns false" do expect do expect(form.save).to be false - end.to_not change{ order_cycle.reload.name } + end.not_to change{ order_cycle.reload.name } end end @@ -86,7 +86,7 @@ describe OrderCycleForm do let!(:uncoordinated_schedule) { create(:schedule, order_cycles: [uncoordinated_order_cycle] ) } context "where I manage the order_cycle's coordinator" do - let(:form) { OrderCycleForm.new(coordinated_order_cycle, params, user) } + let(:form) { OrderCycles::FormService.new(coordinated_order_cycle, params, user) } let(:syncer_mock) { instance_double(OrderManagement::Subscriptions::ProxyOrderSyncer, sync!: true) } @@ -101,7 +101,7 @@ describe OrderCycleForm do it "associates the order cycle to the schedule" do expect(form.save).to be true expect(coordinated_order_cycle.reload.schedules).to include coordinated_schedule2 - expect(coordinated_order_cycle.reload.schedules).to_not include coordinated_schedule + expect(coordinated_order_cycle.reload.schedules).not_to include coordinated_schedule expect(syncer_mock).to have_received(:sync!) end end @@ -112,8 +112,8 @@ describe OrderCycleForm do it "ignores the schedule that I don't own" do expect(form.save).to be true expect(coordinated_order_cycle.reload.schedules).to include coordinated_schedule - expect(coordinated_order_cycle.reload.schedules).to_not include uncoordinated_schedule - expect(syncer_mock).to_not have_received(:sync!) + expect(coordinated_order_cycle.reload.schedules).not_to include uncoordinated_schedule + expect(syncer_mock).not_to have_received(:sync!) end end @@ -123,7 +123,7 @@ describe OrderCycleForm do it "ignores the schedule that I don't own" do expect(form.save).to be true expect(coordinated_order_cycle.reload.schedules).to include coordinated_schedule - expect(syncer_mock).to_not have_received(:sync!) + expect(syncer_mock).not_to have_received(:sync!) end end end @@ -140,7 +140,7 @@ describe OrderCycleForm do let(:distributor_shipping_method) { shipping_method.distributor_shipping_methods.first } let(:variant) { create(:variant, product: create(:product, supplier:)) } let(:params) { { name: 'Some new name' } } - let(:form) { OrderCycleForm.new(order_cycle, params, user) } + let(:form) { OrderCycles::FormService.new(order_cycle, params, user) } let(:outgoing_exchange_params) do { enterprise_id: distributor.id, @@ -233,7 +233,7 @@ describe OrderCycleForm do it "saves the changes" do order_cycle = create(:distributor_order_cycle, distributors: [distributor]) - form = OrderCycleForm.new( + form = OrderCycles::FormService.new( order_cycle, { selected_distributor_payment_method_ids: [distributor_payment_method] }, order_cycle.coordinator.users.first @@ -250,13 +250,13 @@ describe OrderCycleForm do order_cycle = create(:distributor_order_cycle, distributors: [distributor], suppliers: [supplier]) - form = OrderCycleForm.new( + form = OrderCycles::FormService.new( order_cycle, { selected_distributor_payment_method_ids: [distributor_payment_method] }, supplier.users.first ) - expect{ form.save }.to_not change{ order_cycle.distributor_payment_methods.pluck(:id) } + expect{ form.save }.not_to change{ order_cycle.distributor_payment_methods.pluck(:id) } end end @@ -264,7 +264,7 @@ describe OrderCycleForm do it "saves the changes" do order_cycle = create(:distributor_order_cycle, distributors: [distributor]) - form = OrderCycleForm.new( + form = OrderCycles::FormService.new( order_cycle, { selected_distributor_payment_method_ids: [distributor_payment_method2] }, create(:admin_user) @@ -281,7 +281,7 @@ describe OrderCycleForm do it "saves the changes" do order_cycle = create(:distributor_order_cycle, distributors: [distributor]) - form = OrderCycleForm.new( + form = OrderCycles::FormService.new( order_cycle, { selected_distributor_payment_method_ids: [distributor_payment_method] }, distributor.users.first @@ -300,13 +300,13 @@ describe OrderCycleForm do order_cycle = create(:distributor_order_cycle, distributors: [distributor, distributor2]) - form = OrderCycleForm.new( + form = OrderCycles::FormService.new( order_cycle, { selected_distributor_payment_method_ids: [distributor_payment_method] }, distributor2.users.first ) - expect{ form.save }.to_not change{ + expect{ form.save }.not_to change{ order_cycle.distributor_payment_methods.pluck(:id) } end @@ -329,7 +329,7 @@ describe OrderCycleForm do order_cycle = create(:distributor_order_cycle, distributors: [distributor_i]) - form = OrderCycleForm.new( + form = OrderCycles::FormService.new( order_cycle, { selected_distributor_payment_method_ids: [distributor_payment_method_ii.id] }, order_cycle.coordinator.users.first @@ -355,7 +355,7 @@ describe OrderCycleForm do it "saves the changes" do order_cycle = create(:distributor_order_cycle, distributors: [distributor]) - form = OrderCycleForm.new( + form = OrderCycles::FormService.new( order_cycle, { selected_distributor_shipping_method_ids: [distributor_shipping_method] }, order_cycle.coordinator.users.first @@ -373,7 +373,7 @@ describe OrderCycleForm do order_cycle = create(:distributor_order_cycle, distributors: [distributor], suppliers: [supplier]) - form = OrderCycleForm.new( + form = OrderCycles::FormService.new( order_cycle, { selected_distributor_shipping_method_ids: [distributor_shipping_method] }, supplier.users.first @@ -388,7 +388,7 @@ describe OrderCycleForm do it "saves the changes" do order_cycle = create(:distributor_order_cycle, distributors: [distributor]) - form = OrderCycleForm.new( + form = OrderCycles::FormService.new( order_cycle, { selected_distributor_shipping_method_ids: [distributor_shipping_method] }, create(:admin_user) @@ -406,7 +406,7 @@ describe OrderCycleForm do it "saves the changes" do order_cycle = create(:distributor_order_cycle, distributors: [distributor]) - form = OrderCycleForm.new( + form = OrderCycles::FormService.new( order_cycle, { selected_distributor_shipping_method_ids: [distributor_shipping_method] }, distributor.users.first @@ -428,7 +428,7 @@ describe OrderCycleForm do order_cycle = create(:distributor_order_cycle, distributors: [distributor, distributor2]) - form = OrderCycleForm.new( + form = OrderCycles::FormService.new( order_cycle, { selected_distributor_shipping_method_ids: [distributor_shipping_method] }, distributor2.users.first @@ -460,7 +460,7 @@ describe OrderCycleForm do order_cycle = create(:distributor_order_cycle, distributors: [distributor_i]) - form = OrderCycleForm.new( + form = OrderCycles::FormService.new( order_cycle, { selected_distributor_shipping_method_ids: [distributor_shipping_method_ii.id] }, order_cycle.coordinator.users.first diff --git a/spec/services/order_cycle_warning_spec.rb b/spec/services/order_cycles/warning_service_spec.rb similarity index 91% rename from spec/services/order_cycle_warning_spec.rb rename to spec/services/order_cycles/warning_service_spec.rb index 3adf5e21f9..1cb7e0bb9f 100644 --- a/spec/services/order_cycle_warning_spec.rb +++ b/spec/services/order_cycles/warning_service_spec.rb @@ -2,9 +2,9 @@ require 'spec_helper' -describe OrderCycleWarning do +describe OrderCycles::WarningService do let(:user) { create(:user) } - let(:subject) { OrderCycleWarning } + let(:subject) { OrderCycles::WarningService } let!(:distributor) { create(:enterprise, owner: user) } let!(:order_cycle) { create(:simple_order_cycle, distributors: [distributor]) } diff --git a/spec/services/order_cycle_webhook_service_spec.rb b/spec/services/order_cycles/webhook_service_spec.rb similarity index 81% rename from spec/services/order_cycle_webhook_service_spec.rb rename to spec/services/order_cycles/webhook_service_spec.rb index 59ab3a0c1c..060607b8f9 100644 --- a/spec/services/order_cycle_webhook_service_spec.rb +++ b/spec/services/order_cycles/webhook_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe OrderCycleWebhookService do +describe OrderCycles::WebhookService do let(:order_cycle) { create( :simple_order_cycle, @@ -21,8 +21,8 @@ describe OrderCycleWebhookService do coordinator_user = create(:user, enterprises: [coordinator]) coordinator_user.webhook_endpoints.create!(url: "http://coordinator_user_url") - expect{ OrderCycleWebhookService.create_webhook_job(order_cycle, "order_cycle.opened") } - .to_not enqueue_job(WebhookDeliveryJob).with("http://coordinator_user_url", any_args) + expect{ OrderCycles::WebhookService.create_webhook_job(order_cycle, "order_cycle.opened") } + .not_to enqueue_job(WebhookDeliveryJob).with("http://coordinator_user_url", any_args) end context "coordinator owner has endpoint configured" do @@ -31,7 +31,7 @@ describe OrderCycleWebhookService do end it "creates webhook payload for order cycle coordinator" do - expect{ OrderCycleWebhookService.create_webhook_job(order_cycle, "order_cycle.opened") } + expect{ OrderCycles::WebhookService.create_webhook_job(order_cycle, "order_cycle.opened") } .to enqueue_job(WebhookDeliveryJob).with("http://coordinator_owner_url", any_args) end @@ -48,7 +48,7 @@ describe OrderCycleWebhookService do coordinator_name: "Starship Enterprise", } - expect{ OrderCycleWebhookService.create_webhook_job(order_cycle, "order_cycle.opened") } + expect{ OrderCycles::WebhookService.create_webhook_job(order_cycle, "order_cycle.opened") } .to enqueue_job(WebhookDeliveryJob).exactly(1).times .with("http://coordinator_owner_url", "order_cycle.opened", hash_including(data)) end @@ -56,7 +56,7 @@ describe OrderCycleWebhookService do context "coordinator owner doesn't have endpoint configured" do it "doesn't create webhook payload" do - expect{ OrderCycleWebhookService.create_webhook_job(order_cycle, "order_cycle.opened") } + expect{ OrderCycles::WebhookService.create_webhook_job(order_cycle, "order_cycle.opened") } .not_to enqueue_job(WebhookDeliveryJob) end end @@ -84,7 +84,9 @@ describe OrderCycleWebhookService do coordinator_name: "Starship Enterprise", } - expect{ OrderCycleWebhookService.create_webhook_job(order_cycle, "order_cycle.opened") } + expect{ + OrderCycles::WebhookService.create_webhook_job(order_cycle, "order_cycle.opened") + } .to enqueue_job(WebhookDeliveryJob).with("http://distributor1_owner_url", "order_cycle.opened", hash_including(data)) .and enqueue_job(WebhookDeliveryJob).with("http://distributor2_owner_url", @@ -105,7 +107,9 @@ describe OrderCycleWebhookService do it "creates only one webhook payload for the user's endpoint" do user.webhook_endpoints.create! url: "http://coordinator_owner_url" - expect{ OrderCycleWebhookService.create_webhook_job(order_cycle, "order_cycle.opened") } + expect{ + OrderCycles::WebhookService.create_webhook_job(order_cycle, "order_cycle.opened") + } .to enqueue_job(WebhookDeliveryJob).with("http://coordinator_owner_url", any_args) end end @@ -127,8 +131,10 @@ describe OrderCycleWebhookService do } it "doesn't create a webhook payload for supplier owner" do - expect{ OrderCycleWebhookService.create_webhook_job(order_cycle, "order_cycle.opened") } - .to_not enqueue_job(WebhookDeliveryJob).with("http://supplier_owner_url", any_args) + expect{ + OrderCycles::WebhookService.create_webhook_job(order_cycle, "order_cycle.opened") + } + .not_to enqueue_job(WebhookDeliveryJob).with("http://supplier_owner_url", any_args) end end end @@ -136,7 +142,7 @@ describe OrderCycleWebhookService do context "without webhook subscribed to enterprise" do it "doesn't create webhook payload" do - expect{ OrderCycleWebhookService.create_webhook_job(order_cycle, "order_cycle.opened") } + expect{ OrderCycles::WebhookService.create_webhook_job(order_cycle, "order_cycle.opened") } .not_to enqueue_job(WebhookDeliveryJob) end end diff --git a/spec/services/order_available_payment_methods_spec.rb b/spec/services/orders/available_payment_methods_service_spec.rb similarity index 87% rename from spec/services/order_available_payment_methods_spec.rb rename to spec/services/orders/available_payment_methods_service_spec.rb index 190a1afcc8..b31d3af5f6 100644 --- a/spec/services/order_available_payment_methods_spec.rb +++ b/spec/services/orders/available_payment_methods_service_spec.rb @@ -2,13 +2,13 @@ require 'spec_helper' -describe OrderAvailablePaymentMethods do +describe Orders::AvailablePaymentMethodsService do context "when the order has no current_distributor" do it "returns an empty array" do order_cycle = create(:sells_own_order_cycle) order = build(:order, distributor: nil, order_cycle:) - expect(OrderAvailablePaymentMethods.new(order).to_a).to eq [] + expect(Orders::AvailablePaymentMethodsService.new(order).to_a).to eq [] end end @@ -21,7 +21,7 @@ describe OrderAvailablePaymentMethods do order_cycle = create(:sells_own_order_cycle) order = build(:order, distributor:, order_cycle:) - available_payment_methods = OrderAvailablePaymentMethods.new(order).to_a + available_payment_methods = Orders::AvailablePaymentMethodsService.new(order).to_a expect(available_payment_methods).to eq [frontend_payment_method] end @@ -35,7 +35,7 @@ describe OrderAvailablePaymentMethods do order_cycle = create(:sells_own_order_cycle) order = build(:order, distributor:, order_cycle:) - available_payment_methods = OrderAvailablePaymentMethods.new(order).to_a + available_payment_methods = Orders::AvailablePaymentMethodsService.new(order).to_a expect(available_payment_methods).to eq [frontend_payment_method] end @@ -53,7 +53,7 @@ describe OrderAvailablePaymentMethods do order_cycle = create(:sells_own_order_cycle, distributors: [distributor_i, distributor_ii]) order = build(:order, distributor: distributor_i, order_cycle:) - available_payment_methods = OrderAvailablePaymentMethods.new(order).to_a + available_payment_methods = Orders::AvailablePaymentMethodsService.new(order).to_a expect(available_payment_methods).to eq [payment_method_i] end @@ -76,7 +76,7 @@ describe OrderAvailablePaymentMethods do ] order = build(:order, distributor: distributor_i, order_cycle:) - available_payment_methods = OrderAvailablePaymentMethods.new(order).to_a + available_payment_methods = Orders::AvailablePaymentMethodsService.new(order).to_a expect(available_payment_methods).to eq [payment_method_i] end @@ -125,16 +125,18 @@ describe OrderAvailablePaymentMethods do let(:order) { build(:order, distributor:, order_cycle:) } context "when the customer is nil" do - let(:available_payment_methods) { OrderAvailablePaymentMethods.new(order).to_a } + let(:available_payment_methods) { Orders::AvailablePaymentMethodsService.new(order).to_a } it "applies default action (hide)" do expect(available_payment_methods).to include untagged_payment_method - expect(available_payment_methods).to_not include tagged_payment_method + expect(available_payment_methods).not_to include tagged_payment_method end end context "when a customer is present" do - let(:available_payment_methods) { OrderAvailablePaymentMethods.new(order, customer).to_a } + let(:available_payment_methods) { + Orders::AvailablePaymentMethodsService.new(order, customer).to_a + } context "and the customer's tags match" do before do @@ -156,7 +158,7 @@ describe OrderAvailablePaymentMethods do it "applies the default action (hide)" do expect(available_payment_methods).to include untagged_payment_method - expect(available_payment_methods).to_not include tagged_payment_method + expect(available_payment_methods).not_to include tagged_payment_method end end end @@ -175,7 +177,7 @@ describe OrderAvailablePaymentMethods do let(:order) { build(:order, distributor:, order_cycle:) } context "when the customer is nil" do - let(:available_payment_methods) { OrderAvailablePaymentMethods.new(order).to_a } + let(:available_payment_methods) { Orders::AvailablePaymentMethodsService.new(order).to_a } it "applies default action (show)" do expect(available_payment_methods).to include( @@ -186,7 +188,9 @@ describe OrderAvailablePaymentMethods do end context "when a customer is present" do - let(:available_payment_methods) { OrderAvailablePaymentMethods.new(order, customer).to_a } + let(:available_payment_methods) { + Orders::AvailablePaymentMethodsService.new(order, customer).to_a + } context "and the customer's tags match" do before do @@ -195,7 +199,7 @@ describe OrderAvailablePaymentMethods do it "applies the action (hide)" do expect(available_payment_methods).to include untagged_payment_method - expect(available_payment_methods).to_not include tagged_payment_method + expect(available_payment_methods).not_to include tagged_payment_method end end @@ -233,7 +237,7 @@ describe OrderAvailablePaymentMethods do } it do order = build(:order, distributor: d2, order_cycle: oc) - order_available_payment_methods = OrderAvailablePaymentMethods.new(order).to_a + order_available_payment_methods = Orders::AvailablePaymentMethodsService.new(order).to_a expect(order_available_payment_methods).to eq([d2.payment_methods.first]) end end diff --git a/spec/services/order_available_shipping_methods_spec.rb b/spec/services/orders/available_shipping_methods_service_spec.rb similarity index 88% rename from spec/services/order_available_shipping_methods_spec.rb rename to spec/services/orders/available_shipping_methods_service_spec.rb index 57b2ff3535..9ee26ca804 100644 --- a/spec/services/order_available_shipping_methods_spec.rb +++ b/spec/services/orders/available_shipping_methods_service_spec.rb @@ -2,13 +2,13 @@ require 'spec_helper' -describe OrderAvailableShippingMethods do +describe Orders::AvailableShippingMethodsService do context "when the order has no current_distributor" do it "returns an empty array" do order_cycle = create(:sells_own_order_cycle) order = build(:order, distributor: nil, order_cycle:) - expect(OrderAvailableShippingMethods.new(order).to_a).to eq [] + expect(Orders::AvailableShippingMethodsService.new(order).to_a).to eq [] end end @@ -20,7 +20,7 @@ describe OrderAvailableShippingMethods do order_cycle = create(:sells_own_order_cycle) order = build(:order, distributor:, order_cycle:) - available_shipping_methods = OrderAvailableShippingMethods.new(order).to_a + available_shipping_methods = Orders::AvailableShippingMethodsService.new(order).to_a expect(available_shipping_methods).to eq [frontend_shipping_method] end @@ -38,7 +38,7 @@ describe OrderAvailableShippingMethods do order_cycle = create(:sells_own_order_cycle, distributors: [distributor_i, distributor_ii]) order = build(:order, distributor: distributor_i, order_cycle:) - available_shipping_methods = OrderAvailableShippingMethods.new(order).to_a + available_shipping_methods = Orders::AvailableShippingMethodsService.new(order).to_a expect(available_shipping_methods).to eq [shipping_method_i] end @@ -61,7 +61,7 @@ describe OrderAvailableShippingMethods do ] order = build(:order, distributor: distributor_i, order_cycle:) - available_shipping_methods = OrderAvailableShippingMethods.new(order).to_a + available_shipping_methods = Orders::AvailableShippingMethodsService.new(order).to_a expect(available_shipping_methods).to eq [shipping_method_i] end @@ -110,16 +110,18 @@ describe OrderAvailableShippingMethods do let(:order) { build(:order, distributor:, order_cycle:) } context "when the customer is nil" do - let(:available_shipping_methods) { OrderAvailableShippingMethods.new(order).to_a } + let(:available_shipping_methods) { Orders::AvailableShippingMethodsService.new(order).to_a } it "applies default action (hide)" do expect(available_shipping_methods).to include untagged_sm - expect(available_shipping_methods).to_not include tagged_sm + expect(available_shipping_methods).not_to include tagged_sm end end context "when a customer is present" do - let(:available_shipping_methods) { OrderAvailableShippingMethods.new(order, customer).to_a } + let(:available_shipping_methods) { + Orders::AvailableShippingMethodsService.new(order, customer).to_a + } context "and the customer's tags match" do before do @@ -138,7 +140,7 @@ describe OrderAvailableShippingMethods do it "applies the default action (hide)" do expect(available_shipping_methods).to include untagged_sm - expect(available_shipping_methods).to_not include tagged_sm + expect(available_shipping_methods).not_to include tagged_sm end end end @@ -157,7 +159,7 @@ describe OrderAvailableShippingMethods do let(:order) { build(:order, distributor:, order_cycle:) } context "when the customer is nil" do - let(:available_shipping_methods) { OrderAvailableShippingMethods.new(order).to_a } + let(:available_shipping_methods) { Orders::AvailableShippingMethodsService.new(order).to_a } it "applies default action (show)" do expect(available_shipping_methods).to include tagged_sm, untagged_sm @@ -165,7 +167,9 @@ describe OrderAvailableShippingMethods do end context "when a customer is present" do - let(:available_shipping_methods) { OrderAvailableShippingMethods.new(order, customer).to_a } + let(:available_shipping_methods) { + Orders::AvailableShippingMethodsService.new(order, customer).to_a + } context "and the customer's tags match" do before do @@ -174,7 +178,7 @@ describe OrderAvailableShippingMethods do it "applies the action (hide)" do expect(available_shipping_methods).to include untagged_sm - expect(available_shipping_methods).to_not include tagged_sm + expect(available_shipping_methods).not_to include tagged_sm end end @@ -209,14 +213,14 @@ describe OrderAvailableShippingMethods do } it do order = build(:order, distributor: d2, order_cycle: oc) - order_available_shipping_methods = OrderAvailableShippingMethods.new(order).to_a + order_available_shipping_methods = Orders::AvailableShippingMethodsService.new(order).to_a expect(order_available_shipping_methods).to eq([d2.shipping_methods.first]) end end end context "when certain shipping categories are required", feature: :match_shipping_categories do - subject { OrderAvailableShippingMethods.new(order) } + subject { Orders::AvailableShippingMethodsService.new(order) } let(:order) { build(:order, distributor:, order_cycle: oc) } let(:oc) { create(:order_cycle) } let(:distributor) { oc.distributors.first } diff --git a/spec/services/order_cart_reset_spec.rb b/spec/services/orders/cart_reset_service_spec.rb similarity index 81% rename from spec/services/order_cart_reset_spec.rb rename to spec/services/orders/cart_reset_service_spec.rb index c8a1b4c3c8..05e2ea4387 100644 --- a/spec/services/order_cart_reset_spec.rb +++ b/spec/services/orders/cart_reset_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe OrderCartReset do +describe Orders::CartResetService do let(:distributor) { create(:distributor_enterprise) } let(:order) { create(:order, :with_line_item, distributor:) } @@ -10,7 +10,7 @@ describe OrderCartReset do let(:new_distributor) { create(:distributor_enterprise) } it "empties order" do - OrderCartReset.new(order, new_distributor.id.to_s).reset_distributor + Orders::CartResetService.new(order, new_distributor.id.to_s).reset_distributor expect(order.line_items).to be_empty end @@ -28,7 +28,7 @@ describe OrderCartReset do it "empties order and makes order cycle nil" do expect(order_cycle_list).to receive(:call).and_return([]) - OrderCartReset.new(order, distributor.id.to_s).reset_other!(nil, nil) + Orders::CartResetService.new(order, distributor.id.to_s).reset_other!(nil, nil) expect(order.line_items).to be_empty expect(order.order_cycle).to be_nil @@ -38,7 +38,7 @@ describe OrderCartReset do other_order_cycle = create(:simple_order_cycle, distributors: [distributor]) expect(order_cycle_list).to receive(:call).and_return([other_order_cycle]) - OrderCartReset.new(order, distributor.id.to_s).reset_other!(nil, nil) + Orders::CartResetService.new(order, distributor.id.to_s).reset_other!(nil, nil) expect(order.order_cycle).to eq other_order_cycle end diff --git a/spec/services/order_checkout_restart_spec.rb b/spec/services/orders/checkout_restart_service_spec.rb similarity index 86% rename from spec/services/order_checkout_restart_spec.rb rename to spec/services/orders/checkout_restart_service_spec.rb index 2cc47923bc..414838e31b 100644 --- a/spec/services/order_checkout_restart_spec.rb +++ b/spec/services/orders/checkout_restart_service_spec.rb @@ -2,14 +2,14 @@ require 'spec_helper' -describe OrderCheckoutRestart do +describe Orders::CheckoutRestartService do let(:order) { create(:order_with_distributor) } describe "#call" do context "when the order is already in the 'cart' state" do it "does nothing" do - expect(order).to_not receive(:restart_checkout!) - OrderCheckoutRestart.new(order).call + expect(order).not_to receive(:restart_checkout!) + Orders::CheckoutRestartService.new(order).call end end @@ -27,7 +27,7 @@ describe OrderCheckoutRestart do before { order.ship_address = nil } it "resets the order state, and clears incomplete shipments and payments" do - OrderCheckoutRestart.new(order).call + Orders::CheckoutRestartService.new(order).call expect_cart_state_and_reset_adjustments end @@ -37,7 +37,7 @@ describe OrderCheckoutRestart do before { order.ship_address = order.address_from_distributor } it "resets the order state, and clears incomplete shipments and payments" do - OrderCheckoutRestart.new(order).call + Orders::CheckoutRestartService.new(order).call expect_cart_state_and_reset_adjustments end @@ -48,7 +48,7 @@ describe OrderCheckoutRestart do it "does not reset the order state nor clears incomplete shipments and payments" do expect do - OrderCheckoutRestart.new(order).call + Orders::CheckoutRestartService.new(order).call end.to raise_error(StateMachines::InvalidTransition) expect(order.state).to eq 'payment' diff --git a/spec/services/order_invoice_comparator_spec.rb b/spec/services/orders/compare_invoice_service_spec.rb similarity index 98% rename from spec/services/order_invoice_comparator_spec.rb rename to spec/services/orders/compare_invoice_service_spec.rb index 870c5866e3..932e5b54b6 100644 --- a/spec/services/order_invoice_comparator_spec.rb +++ b/spec/services/orders/compare_invoice_service_spec.rb @@ -299,7 +299,7 @@ shared_examples "attribute changes - payment state" do |boolean, type| end end -describe OrderInvoiceComparator do +describe Orders::CompareInvoiceService do let!(:invoice){ create(:invoice, order:, @@ -311,7 +311,7 @@ describe OrderInvoiceComparator do let(:order) { create(:completed_order_with_fees) } let!(:invoice_data_generator){ InvoiceDataGenerator.new(order) } let(:subject) { - OrderInvoiceComparator.new(order).can_generate_new_invoice? + Orders::CompareInvoiceService.new(order).can_generate_new_invoice? } context "changes on the order object" do @@ -351,7 +351,7 @@ describe OrderInvoiceComparator do let!(:order) { create(:completed_order_with_fees) } let!(:invoice_data_generator){ InvoiceDataGenerator.new(order) } let(:subject) { - OrderInvoiceComparator.new(order).can_update_latest_invoice? + Orders::CompareInvoiceService.new(order).can_update_latest_invoice? } context "changes on the order object" do diff --git a/spec/services/customer_order_cancellation_spec.rb b/spec/services/orders/customer_cancellation_service_spec.rb similarity index 76% rename from spec/services/customer_order_cancellation_spec.rb rename to spec/services/orders/customer_cancellation_service_spec.rb index 8801aee5f5..624ea08fd3 100644 --- a/spec/services/customer_order_cancellation_spec.rb +++ b/spec/services/orders/customer_cancellation_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe CustomerOrderCancellation do +describe Orders::CustomerCancellationService do let(:mail_mock) { double(:mailer_mock, deliver_later: true) } before do allow(Spree::OrderMailer).to receive(:cancel_email_for_shop) { mail_mock } @@ -12,7 +12,7 @@ describe CustomerOrderCancellation do it "notifies the distributor by email" do order = create(:order, completed_at: Time.now, state: 'complete') - CustomerOrderCancellation.new(order).call + Orders::CustomerCancellationService.new(order).call expect(Spree::OrderMailer).to have_received(:cancel_email_for_shop).with(order) expect(mail_mock).to have_received(:deliver_later) @@ -23,9 +23,9 @@ describe CustomerOrderCancellation do it "doesn't notify the distributor by email" do order = create(:order, state: 'canceled') - CustomerOrderCancellation.new(order).call + Orders::CustomerCancellationService.new(order).call - expect(Spree::OrderMailer).to_not have_received(:cancel_email_for_shop) + expect(Spree::OrderMailer).not_to have_received(:cancel_email_for_shop) end end end diff --git a/spec/services/order_factory_spec.rb b/spec/services/orders/factory_service_spec.rb similarity index 97% rename from spec/services/order_factory_spec.rb rename to spec/services/orders/factory_service_spec.rb index 5a346ff810..26c8ec2564 100644 --- a/spec/services/order_factory_spec.rb +++ b/spec/services/orders/factory_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe OrderFactory do +describe Orders::FactoryService do let(:variant1) { create(:variant, price: 5.0) } let(:variant2) { create(:variant, price: 7.0) } let(:user) { create(:user) } @@ -16,7 +16,7 @@ describe OrderFactory do let(:ship_address) { create(:address) } let(:bill_address) { create(:address) } let(:opts) { {} } - let(:factory) { OrderFactory.new(attrs, opts) } + let(:factory) { Orders::FactoryService.new(attrs, opts) } let(:order) { factory.create } describe "create" do @@ -50,7 +50,7 @@ describe OrderFactory do end it "retains address, delivery, and payment attributes until completion of the order" do - OrderWorkflow.new(order).complete + Orders::WorkflowService.new(order).complete order.reload diff --git a/spec/services/order_payment_finder_spec.rb b/spec/services/orders/find_payment_service_spec.rb similarity index 93% rename from spec/services/order_payment_finder_spec.rb rename to spec/services/orders/find_payment_service_spec.rb index ff90369fb8..0777d5ed2c 100644 --- a/spec/services/order_payment_finder_spec.rb +++ b/spec/services/orders/find_payment_service_spec.rb @@ -2,9 +2,9 @@ require 'spec_helper' -describe OrderPaymentFinder do +describe Orders::FindPaymentService do let(:order) { create(:order_with_distributor) } - let(:finder) { OrderPaymentFinder.new(order) } + let(:finder) { Orders::FindPaymentService.new(order) } context "when order has several non pending payments" do let!(:failed_payment) { create(:payment, order:, state: 'failed') } diff --git a/spec/services/order_invoice_generator_spec.rb b/spec/services/orders/generate_invoice_service_spec.rb similarity index 95% rename from spec/services/order_invoice_generator_spec.rb rename to spec/services/orders/generate_invoice_service_spec.rb index 24b83143de..50fb5350d5 100644 --- a/spec/services/order_invoice_generator_spec.rb +++ b/spec/services/orders/generate_invoice_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe OrderInvoiceGenerator do +describe Orders::GenerateInvoiceService do let!(:order) { create(:completed_order_with_fees) } let!(:invoice_data_generator){ InvoiceDataGenerator.new(order) } let!(:latest_invoice){ @@ -12,7 +12,7 @@ describe OrderInvoiceGenerator do } let(:instance) { described_class.new(order) } - let(:comparator){ double("OrderInvoiceComparator") } + let(:comparator){ double("Orders::CompareInvoiceService") } before do allow(instance).to receive(:comparator).and_return(comparator) diff --git a/spec/services/order_fees_handler_spec.rb b/spec/services/orders/handle_fees_service_spec.rb similarity index 92% rename from spec/services/order_fees_handler_spec.rb rename to spec/services/orders/handle_fees_service_spec.rb index 4279d02f00..6b92683331 100644 --- a/spec/services/order_fees_handler_spec.rb +++ b/spec/services/orders/handle_fees_service_spec.rb @@ -2,12 +2,12 @@ require 'spec_helper' -describe OrderFeesHandler do +describe Orders::HandleFeesService do let(:order_cycle) { create(:order_cycle) } let(:order) { create(:order_with_line_items, line_items_count: 1, order_cycle:) } let(:line_item) { order.line_items.first } - let(:service) { OrderFeesHandler.new(order) } + let(:service) { Orders::HandleFeesService.new(order) } let(:calculator) { double(OpenFoodNetwork::EnterpriseFeeCalculator, create_order_adjustments_for: true) } @@ -33,7 +33,7 @@ describe OrderFeesHandler do it "skips per-order fee adjustments for orders that don't have an order cycle" do allow(service).to receive(:order_cycle) { nil } - expect(calculator).to_not receive(:create_order_adjustments_for) + expect(calculator).not_to receive(:create_order_adjustments_for) service.create_order_fees! end diff --git a/spec/services/order_data_masker_spec.rb b/spec/services/orders/mask_data_service_spec.rb similarity index 98% rename from spec/services/order_data_masker_spec.rb rename to spec/services/orders/mask_data_service_spec.rb index d68e90ff86..f23141922c 100644 --- a/spec/services/order_data_masker_spec.rb +++ b/spec/services/orders/mask_data_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe OrderDataMasker do +describe Orders::MaskDataService do describe '#call' do let(:distributor) { create(:enterprise) } let(:order) { create(:order, distributor:, ship_address: create(:address)) } diff --git a/spec/services/order_tax_adjustments_fetcher_spec.rb b/spec/services/orders/order_tax_adjustments_fetcher_spec.rb similarity index 97% rename from spec/services/order_tax_adjustments_fetcher_spec.rb rename to spec/services/orders/order_tax_adjustments_fetcher_spec.rb index 31f71b80b5..f45280c27a 100644 --- a/spec/services/order_tax_adjustments_fetcher_spec.rb +++ b/spec/services/orders/order_tax_adjustments_fetcher_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe OrderTaxAdjustmentsFetcher do +describe Orders::FetchTaxAdjustmentsService do describe "#totals" do let(:zone) { create(:zone_with_member) } let(:coordinator) { create(:distributor_enterprise, charges_sales_tax: true) } @@ -94,7 +94,7 @@ describe OrderTaxAdjustmentsFetcher do legacy_tax_adjustment end - subject { OrderTaxAdjustmentsFetcher.new(order).totals } + subject { Orders::FetchTaxAdjustmentsService.new(order).totals } it "returns a hash with all 5 taxes" do expect(subject.size).to eq(5) diff --git a/spec/services/order_syncer_spec.rb b/spec/services/orders/sync_service_spec.rb similarity index 96% rename from spec/services/order_syncer_spec.rb rename to spec/services/orders/sync_service_spec.rb index 1c431eb9d2..f45a009a9c 100644 --- a/spec/services/order_syncer_spec.rb +++ b/spec/services/orders/sync_service_spec.rb @@ -2,14 +2,14 @@ require "spec_helper" -describe OrderSyncer do +describe Orders::SyncService do describe "updating the shipping method" do let!(:subscription) { create(:subscription, with_items: true, with_proxy_orders: true) } let!(:order) { subscription.proxy_orders.first.initialise_order! } let!(:shipping_method) { subscription.shipping_method } let!(:new_shipping_method) { create(:shipping_method, distributors: [subscription.shop]) } - let(:syncer) { OrderSyncer.new(subscription) } + let(:syncer) { Orders::SyncService.new(subscription) } context "when the shipping method on an order is the same as the subscription" do let(:params) { { shipping_method_id: new_shipping_method.id } } @@ -88,7 +88,7 @@ describe OrderSyncer do let(:payment_method) { subscription.payment_method } let(:new_payment_method) { create(:payment_method, distributors: [subscription.shop]) } let(:invalid_payment_method) { create(:payment_method, distributors: [create(:enterprise)]) } - let(:syncer) { OrderSyncer.new(subscription) } + let(:syncer) { Orders::SyncService.new(subscription) } context "when the payment method on an order is the same as the subscription" do let(:params) { { payment_method_id: new_payment_method.id } } @@ -160,7 +160,7 @@ describe OrderSyncer do { bill_address_attributes: { id: bill_address_attrs["id"], firstname: "Bill", address1: "123 abc st", phone: "1123581321" } } } - let(:syncer) { OrderSyncer.new(subscription) } + let(:syncer) { Orders::SyncService.new(subscription) } context "when a ship address is not required" do let!(:shipping_method) do @@ -171,7 +171,7 @@ describe OrderSyncer do it "updates all bill_address attrs and ship_address names + phone" do subscription.assign_attributes(params) expect(syncer.sync!).to be true - expect(syncer.order_update_issues.keys).to_not include order.id + expect(syncer.order_update_issues.keys).not_to include order.id order.reload; expect(order.bill_address.firstname).to eq "Bill" expect(order.bill_address.lastname).to eq bill_address_attrs["lastname"] @@ -216,7 +216,7 @@ describe OrderSyncer do it "only updates bill_address attrs" do subscription.assign_attributes(params) expect(syncer.sync!).to be true - expect(syncer.order_update_issues.keys).to_not include order.id + expect(syncer.order_update_issues.keys).not_to include order.id order.reload; expect(order.bill_address.firstname).to eq "Bill" expect(order.bill_address.lastname).to eq bill_address_attrs["lastname"] @@ -268,7 +268,7 @@ describe OrderSyncer do { ship_address_attributes: { id: ship_address_attrs["id"], firstname: "Ship", address1: "123 abc st", phone: "1123581321" } } } - let(:syncer) { OrderSyncer.new(subscription) } + let(:syncer) { Orders::SyncService.new(subscription) } context "when a ship address is not required" do let!(:shipping_method) do @@ -278,7 +278,7 @@ describe OrderSyncer do it "does not change the ship address" do subscription.assign_attributes(params) expect(syncer.sync!).to be true - expect(syncer.order_update_issues.keys).to_not include order.id + expect(syncer.order_update_issues.keys).not_to include order.id order.reload; expect(order.ship_address.firstname).to eq bill_address_attrs["firstname"] expect(order.ship_address.lastname).to eq bill_address_attrs["lastname"] @@ -355,7 +355,7 @@ describe OrderSyncer do it "updates ship_address attrs" do subscription.assign_attributes(params) expect(syncer.sync!).to be true - expect(syncer.order_update_issues.keys).to_not include order.id + expect(syncer.order_update_issues.keys).not_to include order.id order.reload; expect(order.ship_address.firstname).to eq "Ship" expect(order.ship_address.lastname).to eq ship_address_attrs["lastname"] @@ -394,7 +394,7 @@ describe OrderSyncer do context "when quantity is within available stock" do let(:params) { { subscription_line_items_attributes: [{ id: sli.id, quantity: 2 }] } } - let(:syncer) { OrderSyncer.new(subscription) } + let(:syncer) { Orders::SyncService.new(subscription) } it "updates the line_item quantities and totals on all orders" do expect(order.reload.total.to_f).to eq 59.97 @@ -409,7 +409,7 @@ describe OrderSyncer do context "when quantity is greater than available stock" do let(:params) { { subscription_line_items_attributes: [{ id: sli.id, quantity: 3 }] } } - let(:syncer) { OrderSyncer.new(subscription) } + let(:syncer) { Orders::SyncService.new(subscription) } before do expect(order.reload.total.to_f).to eq 59.97 @@ -430,7 +430,7 @@ describe OrderSyncer do context "when order is complete" do it "does not update the line_item quantities and adds the order " \ "to order_update_issues with insufficient stock" do - OrderWorkflow.new(order).complete + Orders::WorkflowService.new(order).complete expect(syncer.sync!).to be true @@ -449,7 +449,7 @@ describe OrderSyncer do # this single item available is used when the order is completed below, # making the item out of stock variant.update_attribute(:on_hand, 1) - OrderWorkflow.new(order).complete + Orders::WorkflowService.new(order).complete expect(syncer.sync!).to be true @@ -462,7 +462,7 @@ describe OrderSyncer do context "where the quantity of the item on an initialised order has already been changed" do let(:params) { { subscription_line_items_attributes: [{ id: sli.id, quantity: 3 }] } } - let(:syncer) { OrderSyncer.new(subscription) } + let(:syncer) { Orders::SyncService.new(subscription) } let(:changed_line_item) { order.line_items.find_by(variant_id: sli.variant_id) } before { variant.update_attribute(:on_hand, 3) } @@ -510,7 +510,7 @@ describe OrderSyncer do let(:subscription) { create(:subscription, with_items: true, with_proxy_orders: true) } let(:order) { subscription.proxy_orders.first.initialise_order! } let(:variant) { create(:variant) } - let(:syncer) { OrderSyncer.new(subscription) } + let(:syncer) { Orders::SyncService.new(subscription) } before do expect(order.reload.total.to_f).to eq 59.97 @@ -547,7 +547,7 @@ describe OrderSyncer do end context "when order is complete" do - before { OrderWorkflow.new(order).complete } + before { Orders::WorkflowService.new(order).complete } it "does not add line_item and adds the order to order_update_issues" do expect(syncer.sync!).to be true @@ -593,7 +593,7 @@ describe OrderSyncer do let(:sli) { subscription.subscription_line_items.first } let(:variant) { sli.variant } let(:params) { { subscription_line_items_attributes: [{ id: sli.id, _destroy: true }] } } - let(:syncer) { OrderSyncer.new(subscription) } + let(:syncer) { Orders::SyncService.new(subscription) } it "removes the line item and updates totals on all orders" do expect(order.reload.total.to_f).to eq 59.97 diff --git a/spec/services/order_workflow_spec.rb b/spec/services/orders/workflow_service_spec.rb similarity index 98% rename from spec/services/order_workflow_spec.rb rename to spec/services/orders/workflow_service_spec.rb index 3aa715aa4f..08e48fa0cd 100644 --- a/spec/services/order_workflow_spec.rb +++ b/spec/services/orders/workflow_service_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe OrderWorkflow do +describe Orders::WorkflowService do let!(:distributor) { create(:distributor_enterprise) } let!(:order) do create(:order_with_totals_and_distribution, distributor:, diff --git a/spec/services/permissions/order_spec.rb b/spec/services/permissions/order_spec.rb index 0bad56530c..2e3ba313ee 100644 --- a/spec/services/permissions/order_spec.rb +++ b/spec/services/permissions/order_spec.rb @@ -70,9 +70,9 @@ module Permissions it "only returns completed, non-cancelled orders within search filter range" do expect(permissions.visible_orders).to include order_completed - expect(permissions.visible_orders).to_not include order_cancelled - expect(permissions.visible_orders).to_not include order_cart - expect(permissions.visible_orders).to_not include order_from_last_year + expect(permissions.visible_orders).not_to include order_cancelled + expect(permissions.visible_orders).not_to include order_cart + expect(permissions.visible_orders).not_to include order_from_last_year end end end @@ -99,7 +99,7 @@ module Permissions context "which does not contain my products" do it "should not let me see the order" do - expect(permissions.visible_orders).to_not include order + expect(permissions.visible_orders).not_to include order end end end @@ -113,7 +113,7 @@ module Permissions end it "should not let me see the order" do - expect(permissions.visible_orders).to_not include order + expect(permissions.visible_orders).not_to include order end end end @@ -172,7 +172,7 @@ module Permissions it "should let me see the line_items pertaining to variants I produce" do ps = permissions.visible_line_items expect(ps).to include line_item1 - expect(ps).to_not include line_item2 + expect(ps).not_to include line_item2 end end @@ -185,7 +185,7 @@ module Permissions end it "should not let me see the line_items" do - expect(permissions.visible_line_items).to_not include line_item1, line_item2 + expect(permissions.visible_line_items).not_to include line_item1, line_item2 end end @@ -205,10 +205,10 @@ module Permissions it "only returns line items from completed, " \ "non-cancelled orders within search filter range" do expect(permissions.visible_line_items).to include order_completed.line_items.first - expect(permissions.visible_line_items).to_not include order_cancelled.line_items.first - expect(permissions.visible_line_items).to_not include order_cart.line_items.first + expect(permissions.visible_line_items).not_to include order_cancelled.line_items.first + expect(permissions.visible_line_items).not_to include order_cart.line_items.first expect(permissions.visible_line_items) - .to_not include order_from_last_year.line_items.first + .not_to include order_from_last_year.line_items.first end end end diff --git a/spec/services/place_proxy_order_spec.rb b/spec/services/place_proxy_order_spec.rb index 0b83120734..2fc895ec53 100644 --- a/spec/services/place_proxy_order_spec.rb +++ b/spec/services/place_proxy_order_spec.rb @@ -57,7 +57,7 @@ describe PlaceProxyOrder do it "records an issue and ignores it" do expect(summarizer).to receive(:record_issue).with(:complete, order).once - expect { subject.call }.to_not change { order.reload.state } + expect { subject.call }.not_to change { order.reload.state } expect(order.payments.first.state).to eq "checkout" expect(ActionMailer::Base.deliveries.count).to be 0 end @@ -114,8 +114,8 @@ describe PlaceProxyOrder do order.line_items << build(:line_item) - order_workflow = instance_double(OrderWorkflow, complete!: true) - allow(OrderWorkflow).to receive(:new).with(order).and_return(order_workflow) + order_workflow = instance_double(Orders::WorkflowService, complete!: true) + allow(Orders::WorkflowService).to receive(:new).with(order).and_return(order_workflow) end context "when no changes are present" do diff --git a/spec/services/product_tag_rules_filterer_spec.rb b/spec/services/product_tag_rules_filterer_spec.rb index 804e4933a5..1302788381 100644 --- a/spec/services/product_tag_rules_filterer_spec.rb +++ b/spec/services/product_tag_rules_filterer_spec.rb @@ -18,7 +18,7 @@ describe ProductTagRulesFilterer do } let(:customer) { create(:customer, enterprise: distributor) } let(:variants_relation) { - Spree::Variant.joins(:product).where("spree_products.supplier_id = ?", distributor.id) + Spree::Variant.joins(:product).where(spree_products: { supplier_id: distributor.id }) } let(:default_hide_rule) { create(:filter_products_tag_rule, diff --git a/spec/services/products_renderer_spec.rb b/spec/services/products_renderer_spec.rb index 669f42c896..179233fe2d 100644 --- a/spec/services/products_renderer_spec.rb +++ b/spec/services/products_renderer_spec.rb @@ -162,12 +162,6 @@ describe ProductsRenderer do expect(products_renderer.products_json).to include "998.0" end - it "includes the primary taxon" do - taxon = create(:taxon) - allow_any_instance_of(Spree::Product).to receive(:primary_taxon).and_return taxon - expect(products_renderer.products_json).to include taxon.name - end - it "loads tag_list for variants" do VariantOverride.create(variant:, hub: distributor, tag_list: 'lalala') expect(products_renderer.products_json).to include "[\"lalala\"]" @@ -195,13 +189,13 @@ describe ProductsRenderer do it "scopes variants to distribution" do expect(variants[p.id]).to include v1 - expect(variants[p.id]).to_not include v2 + expect(variants[p.id]).not_to include v2 end it "does not render variants that have been hidden by the hub" do # but does render 'new' variants, ie. v1 expect(variants[p.id]).to include v1, v3 - expect(variants[p.id]).to_not include v4 + expect(variants[p.id]).not_to include v4 end context "when hub opts to only see variants in its inventory" do @@ -212,7 +206,7 @@ describe ProductsRenderer do it "doesn't render variants that haven't been explicitly added to inventory for the hub" do # but does render 'new' variants, ie. v1 expect(variants[p.id]).to include v3 - expect(variants[p.id]).to_not include v1, v4 + expect(variants[p.id]).not_to include v1, v4 end end end diff --git a/spec/services/sets/model_set_spec.rb b/spec/services/sets/model_set_spec.rb index c8b22866ce..b783872f9e 100644 --- a/spec/services/sets/model_set_spec.rb +++ b/spec/services/sets/model_set_spec.rb @@ -79,7 +79,7 @@ describe Sets::ModelSet do expect(subject.errors.full_messages).to eq ["Product Name can't be blank"] expect(subject.invalid).to include product_a - expect(subject.invalid).to_not include product_b + expect(subject.invalid).not_to include product_b end end end diff --git a/spec/services/sets/product_set_spec.rb b/spec/services/sets/product_set_spec.rb index e35dfa6d17..88eb990e9d 100644 --- a/spec/services/sets/product_set_spec.rb +++ b/spec/services/sets/product_set_spec.rb @@ -130,7 +130,7 @@ describe Sets::ProductSet do }.to change { product.supplier }.to(producer). and change { order_cycle.distributed_variants.count }.by(-1) - expect(order_cycle.distributed_variants).to_not include product.variants.first + expect(order_cycle.distributed_variants).not_to include product.variants.first end end end @@ -163,7 +163,7 @@ describe Sets::ProductSet do expect { product_set.save product.reload - }.to_not change { product.sku } + }.not_to change { product.sku } expect(product_set.saved_count).to be_zero expect(product_set.invalid.count).to be_positive @@ -173,7 +173,7 @@ describe Sets::ProductSet do expect { product_set.save variant.reload - }.to_not change { variant.sku } + }.not_to change { variant.sku } end it 'assigns the in-memory attributes of the variant' do @@ -239,7 +239,7 @@ describe Sets::ProductSet do let(:variant_attributes) { { sku: "var_sku", display_name: "A" * 256 } } # maximum length include_examples "nothing saved" do - after { expect(variant2.reload.sku).to_not eq "var_sku2" } + after { expect(variant2.reload.sku).not_to eq "var_sku2" } end end end diff --git a/spec/services/tax_rate_updater_spec.rb b/spec/services/tax_rate_updater_spec.rb index 6f030f9108..baa3b6d4a6 100644 --- a/spec/services/tax_rate_updater_spec.rb +++ b/spec/services/tax_rate_updater_spec.rb @@ -12,7 +12,7 @@ describe TaxRateUpdater do describe "#updated_rate" do it "returns a cloned (unsaved) tax rate with the new attributes assigned" do - expect(new_tax_rate).to_not be old_tax_rate + expect(new_tax_rate).not_to be old_tax_rate expect(new_tax_rate.amount).to eq params[:amount] expect(new_tax_rate.id).to be_nil expect(new_tax_rate.calculator.class).to eq old_tax_rate.calculator.class @@ -34,9 +34,9 @@ describe TaxRateUpdater do context "when saving the new tax_rate fails" do it "does not delete the old tax_rate and returns a falsey value" do expect(new_tax_rate).to receive(:save) { false } - expect(old_tax_rate).to_not receive(:destroy) + expect(old_tax_rate).not_to receive(:destroy) - expect(service.transition_rate!).to_not be_truthy + expect(service.transition_rate!).not_to be_truthy end end end diff --git a/spec/services/terms_of_service_spec.rb b/spec/services/terms_of_service_spec.rb index 28ed199546..22151ee0bc 100644 --- a/spec/services/terms_of_service_spec.rb +++ b/spec/services/terms_of_service_spec.rb @@ -37,7 +37,7 @@ describe TermsOfService do it "should always return true" do expect { allow(TermsOfServiceFile).to receive(:exists?) { false } - }.to_not change { + }.not_to change { TermsOfService.tos_accepted?(customer) }.from(true) end diff --git a/spec/services/voucher_adjustments_service_spec.rb b/spec/services/voucher_adjustments_service_spec.rb index 18cd4baa55..87df60558e 100644 --- a/spec/services/voucher_adjustments_service_spec.rb +++ b/spec/services/voucher_adjustments_service_spec.rb @@ -264,7 +264,7 @@ describe VoucherAdjustmentsService do context 'when no order given' do it "doesn't blow up" do - expect { VoucherAdjustmentsService.new(nil).update }.to_not raise_error + expect { VoucherAdjustmentsService.new(nil).update }.not_to raise_error end end @@ -272,7 +272,7 @@ describe VoucherAdjustmentsService do let(:order) { create(:order_with_line_items, line_items_count: 1, distributor: enterprise) } it "doesn't blow up" do - expect { VoucherAdjustmentsService.new(order).update }.to_not raise_error + expect { VoucherAdjustmentsService.new(order).update }.not_to raise_error end end end diff --git a/spec/services/weights_and_measures_spec.rb b/spec/services/weights_and_measures_spec.rb index d84c2c5b66..59877062ec 100644 --- a/spec/services/weights_and_measures_spec.rb +++ b/spec/services/weights_and_measures_spec.rb @@ -30,6 +30,11 @@ describe WeightsAndMeasures do allow(product).to receive(:variant_unit_scale) { 28.35 } expect(subject.system).to eq("imperial") end + + it "when precise scale is for an imperial unit" do + allow(product).to receive(:variant_unit_scale) { 28.349523125 } + expect(subject.system).to eq("imperial") + end end context "volume" do @@ -55,7 +60,54 @@ describe WeightsAndMeasures do end end - describe "#scale_for_unit_value" do + describe "#variant_unit_options" do + let(:available_units) { "mg,g,kg,T,mL,cL,dL,L,kL,lb,oz,gal" } + subject { WeightsAndMeasures.variant_unit_options } + + before do + allow(Spree::Config).to receive(:available_units).and_return(available_units) + end + + it "returns options for each unit" do + expected_array = [ + ["Weight (mg)", "weight_0.001"], + ["Weight (g)", "weight_1"], + ["Weight (oz)", "weight_28.35"], + ["Weight (lb)", "weight_453.6"], + ["Weight (kg)", "weight_1000"], + ["Weight (T)", "weight_1000000"], + ["Volume (mL)", "volume_0.001"], + ["Volume (cL)", "volume_0.01"], + ["Volume (dL)", "volume_0.1"], + ["Volume (L)", "volume_1"], + ["Volume (gal)", "volume_4.54609"], + ["Volume (kL)", "volume_1000"], + ["Items", "items"], + ] + expect(subject).to match_array expected_array # diff each element + expect(subject).to eq expected_array # test ordering also + end + + describe "filtering available units" do + let(:available_units) { "g,kg,mL,L,lb,oz" } + + it "returns options for available units only" do + expected_array = [ + ["Weight (g)", "weight_1"], + ["Weight (oz)", "weight_28.35"], + ["Weight (lb)", "weight_453.6"], + ["Weight (kg)", "weight_1000"], + ["Volume (mL)", "volume_0.001"], + ["Volume (L)", "volume_1"], + ["Items", "items"], + ] + expect(subject).to match_array expected_array # diff each element + expect(subject).to eq expected_array # test ordering also + end + end + end + + describe "#scales_for_unit_value" do context "weight" do before do allow(product).to receive(:variant_unit) { "weight" } diff --git a/spec/support/ability_helpers.rb b/spec/support/ability_helpers.rb index c474c8363d..9614525917 100644 --- a/spec/support/ability_helpers.rb +++ b/spec/support/ability_helpers.rb @@ -19,15 +19,15 @@ end shared_examples_for 'access denied' do it 'should not allow read' do - expect(subject).to_not be_able_to(:read, resource) + expect(subject).not_to be_able_to(:read, resource) end it 'should not allow create' do - expect(subject).to_not be_able_to(:create, resource) + expect(subject).not_to be_able_to(:create, resource) end it 'should not allow update' do - expect(subject).to_not be_able_to(:update, resource) + expect(subject).not_to be_able_to(:update, resource) end end @@ -40,7 +40,7 @@ end shared_examples_for 'admin denied' do it 'should not allow admin' do - expect(subject).to_not be_able_to(:admin, resource) + expect(subject).not_to be_able_to(:admin, resource) end end @@ -52,7 +52,7 @@ end shared_examples_for 'no index allowed' do it 'should not allow index' do - expect(subject).to_not be_able_to(:index, resource) + expect(subject).not_to be_able_to(:index, resource) end end @@ -62,25 +62,25 @@ shared_examples_for 'create only' do end it 'should not allow read' do - expect(subject).to_not be_able_to(:read, resource) + expect(subject).not_to be_able_to(:read, resource) end it 'should not allow update' do - expect(subject).to_not be_able_to(:update, resource) + expect(subject).not_to be_able_to(:update, resource) end it 'should not allow index' do - expect(subject).to_not be_able_to(:index, resource) + expect(subject).not_to be_able_to(:index, resource) end end shared_examples_for 'read only' do it 'should not allow create' do - expect(subject).to_not be_able_to(:create, resource) + expect(subject).not_to be_able_to(:create, resource) end it 'should not allow update' do - expect(subject).to_not be_able_to(:update, resource) + expect(subject).not_to be_able_to(:update, resource) end it 'should allow index' do @@ -90,11 +90,11 @@ end shared_examples_for 'update only' do it 'should not allow create' do - expect(subject).to_not be_able_to(:create, resource) + expect(subject).not_to be_able_to(:create, resource) end it 'should not allow read' do - expect(subject).to_not be_able_to(:read, resource) + expect(subject).not_to be_able_to(:read, resource) end it 'should allow update' do @@ -102,7 +102,7 @@ shared_examples_for 'update only' do end it 'should not allow index' do - expect(subject).to_not be_able_to(:index, resource) + expect(subject).not_to be_able_to(:index, resource) end end diff --git a/spec/support/matchers/table_matchers.rb b/spec/support/matchers/table_matchers.rb index aaee09ed83..1cf1f0deba 100644 --- a/spec/support/matchers/table_matchers.rb +++ b/spec/support/matchers/table_matchers.rb @@ -8,7 +8,7 @@ RSpec::Matchers.define :have_table_row do |row| match_when_negated do |node| @row = row - !rows_under(node).include? row # Robust check of columns + rows_under(node).exclude? row # Robust check of columns end failure_message do |text| diff --git a/spec/support/query_counter.rb b/spec/support/query_counter.rb deleted file mode 100644 index 009c648d03..0000000000 --- a/spec/support/query_counter.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -class QueryCounter - QUERY_TYPES = [:delete, :insert, :select, :update].freeze - - attr_reader :queries - - def initialize - @queries = {} - @subscriber = ActiveSupport::Notifications. - subscribe("sql.active_record") do |_name, _started, _finished, _unique_id, payload| - type = get_type(payload[:sql]) - next if QUERY_TYPES.exclude?(type) || pg_query?(payload[:sql]) - - table = get_table(payload[:sql]) - @queries[type] ||= {} - @queries[type][table] ||= 0 - @queries[type][table] += 1 - end - end - - def stop - ActiveSupport::Notifications.unsubscribe("sql.active_record") - end - - private - - def get_table(sql) - sql_parts = sql.split(" ") - case get_type(sql) - when :insert - sql_parts[3] - when :update - sql_parts[1] - else - table_index = sql_parts.index("FROM") - sql_parts[table_index + 1] - end.gsub(/(\\|")/, "").to_sym - end - - def get_type(sql) - sql.split(" ")[0].downcase.to_sym - end - - def pg_query?(sql) - sql.include?("SELECT a.attname") || sql.include?("pg_attribute") - end -end diff --git a/spec/support/reports_helper.rb b/spec/support/reports_helper.rb index 7e5b2db003..7bcfbbf5b6 100644 --- a/spec/support/reports_helper.rb +++ b/spec/support/reports_helper.rb @@ -5,6 +5,6 @@ module ReportsHelper click_on "Go" expect(page).to have_selector ".loading" perform_enqueued_jobs(only: ReportJob) - expect(page).to have_no_selector ".loading" + expect(page).not_to have_selector ".loading" end end diff --git a/spec/support/request/authentication_helper.rb b/spec/support/request/authentication_helper.rb index cd76c527c6..804551bbb3 100644 --- a/spec/support/request/authentication_helper.rb +++ b/spec/support/request/authentication_helper.rb @@ -20,7 +20,7 @@ module AuthenticationHelper def expect_logged_in # Ensure page has been reloaded after submitting login form - expect(page).to_not have_selector ".menu #login-link" - expect(page).to_not have_content "Login" + expect(page).not_to have_selector ".menu #login-link" + expect(page).not_to have_content "Login" end end diff --git a/spec/support/request/shop_workflow.rb b/spec/support/request/shop_workflow.rb index 81a3ebdab2..1b34f6ab23 100644 --- a/spec/support/request/shop_workflow.rb +++ b/spec/support/request/shop_workflow.rb @@ -11,7 +11,7 @@ module ShopWorkflow within find_body do # We ignore visibility in case the cart dropdown is not open. within '.cart-sidebar', visible: false do - expect(page).to_not have_link "Updating cart...", visible: false + expect(page).not_to have_link "Updating cart...", visible: false end end end diff --git a/spec/support/request/web_helper.rb b/spec/support/request/web_helper.rb index 01a4796f4e..42d7cb65b6 100644 --- a/spec/support/request/web_helper.rb +++ b/spec/support/request/web_helper.rb @@ -91,14 +91,14 @@ module WebHelper end def tomselect_multiselect(value, options) - tomselect_wrapper = page.find("[name='#{options[:from]}']").sibling(".ts-wrapper") + tomselect_wrapper = page.find_field(options[:from]).sibling(".ts-wrapper") tomselect_wrapper.find(".ts-control").click tomselect_wrapper.find(:css, '.ts-dropdown.multi .ts-dropdown-content .option', text: value).click end def tomselect_search_and_select(value, options) - tomselect_wrapper = page.find("[name='#{options[:from]}']").sibling(".ts-wrapper") + tomselect_wrapper = page.find_field(options[:from]).sibling(".ts-wrapper") tomselect_wrapper.find(".ts-control").click # Use send_keys as setting the value directly doesn't trigger the search tomselect_wrapper.find(:css, '.ts-dropdown input.dropdown-input').send_keys(value) @@ -106,7 +106,7 @@ module WebHelper end def tomselect_select(value, options) - tomselect_wrapper = page.find("[name='#{options[:from]}']").sibling(".ts-wrapper") + tomselect_wrapper = page.find_field(options[:from]).sibling(".ts-wrapper") tomselect_wrapper.find(".ts-control").click tomselect_wrapper.find(:css, '.ts-dropdown .ts-dropdown-content .option', text: value).click diff --git a/spec/support/vcr_setup.rb b/spec/support/vcr_setup.rb index a856eab5d7..1b554f52f2 100644 --- a/spec/support/vcr_setup.rb +++ b/spec/support/vcr_setup.rb @@ -16,7 +16,28 @@ VCR.configure do |config| STRIPE_ACCOUNT STRIPE_CLIENT_ID STRIPE_ENDPOINT_SECRET + OPENID_APP_ID + OPENID_APP_SECRET + OPENID_REFRESH_TOKEN ].each do |env_var| config.filter_sensitive_data("") { ENV.fetch(env_var, nil) } end + config.filter_sensitive_data('') { |interaction| + interaction.request.headers['X-Stripe-Client-User-Agent']&.public_send(:[], 0) + } + config.filter_sensitive_data('') { |interaction| + interaction.response.body.match(/"client_secret": "(pi_.+)"/)&.public_send(:[], 1) + } + config.filter_sensitive_data('') { |interaction| + interaction.request.headers['Authorization']&.public_send(:[], 0) + } + config.filter_sensitive_data('') { |interaction| + interaction.response.body.match(/"access_token":"([^"]+)"/)&.public_send(:[], 1) + } + config.filter_sensitive_data('') { |interaction| + interaction.response.body.match(/"id_token":"([^"]+)"/)&.public_send(:[], 1) + } + config.filter_sensitive_data('') { |interaction| + interaction.response.body.match(/"refresh_token":"([^"]+)"/)&.public_send(:[], 1) + } end diff --git a/spec/system/admin/adjustments_spec.rb b/spec/system/admin/adjustments_spec.rb index 9f5a3b1f67..cbe5f8f7d5 100644 --- a/spec/system/admin/adjustments_spec.rb +++ b/spec/system/admin/adjustments_spec.rb @@ -178,8 +178,8 @@ describe ' it "displays adjustments" do click_link 'Adjustments' - expect(page).to_not have_selector 'tr a.icon-edit' - expect(page).to_not have_selector 'a.icon-plus', text: 'New Adjustment' + expect(page).not_to have_selector 'tr a.icon-edit' + expect(page).not_to have_selector 'a.icon-plus', text: 'New Adjustment' end end end diff --git a/spec/system/admin/authentication_spec.rb b/spec/system/admin/authentication_spec.rb index d83e2a3f7d..426ac758a8 100644 --- a/spec/system/admin/authentication_spec.rb +++ b/spec/system/admin/authentication_spec.rb @@ -18,7 +18,7 @@ describe "Authentication" do click_login_button expect(page).to have_content "DASHBOARD" expect(page).to have_current_path spree.admin_dashboard_path - expect(page).to have_no_content "CONFIGURATION" + expect(page).not_to have_content "CONFIGURATION" end it "viewing my account" do diff --git a/spec/system/admin/bulk_order_management_spec.rb b/spec/system/admin/bulk_order_management_spec.rb index b9b8e2c635..ccf0141afd 100644 --- a/spec/system/admin/bulk_order_management_spec.rb +++ b/spec/system/admin/bulk_order_management_spec.rb @@ -58,14 +58,14 @@ describe ' it "displays a list of line items" do expect(page).to have_selector "tr#li_#{li1.id}" expect(page).to have_selector "tr#li_#{li2.id}" - expect(page).to have_no_selector "tr#li_#{li3.id}" + expect(page).not_to have_selector "tr#li_#{li3.id}" end it "displays only line items that are not shipped" do expect(page).to have_selector "tr#li_#{li1.id}" expect(page).to have_selector "tr#li_#{li2.id}" - expect(page).to have_no_selector "tr#li_#{li4.id}" - expect(page).to have_no_selector "tr#li_#{li5.id}" + expect(page).not_to have_selector "tr#li_#{li4.id}" + expect(page).not_to have_selector "tr#li_#{li5.id}" end it "orders by completion date" do @@ -139,7 +139,7 @@ describe ' expect(page).to have_button("« First", disabled: true) expect(page).to have_button("Previous", disabled: true) expect(page).to have_button("1", disabled: true) - expect(page).to_not have_button("2") + expect(page).not_to have_button("2") expect(page).to have_button("Next", disabled: true) expect(page).to have_button("Last »", disabled: true) select2_select "100 per page", from: "autogen4" # should display all 20 line items @@ -437,7 +437,7 @@ describe ' end it "adds the class 'ng-dirty' to input elements when value is altered" do - expect(page).to have_no_css "input[name='quantity'].ng-dirty" + expect(page).not_to have_css "input[name='quantity'].ng-dirty" fill_in "quantity", with: 2 expect(page).to have_css "input[name='quantity'].ng-dirty" end @@ -453,19 +453,19 @@ describe ' context "when acceptable data is sent to the server" do it "displays an update button which submits pending changes" do - expect(page).to have_no_selector "#save-bar" + expect(page).not_to have_selector "#save-bar" fill_in "quantity", with: 2 expect(page).to have_selector "input[name='quantity'].ng-dirty" expect(page).to have_selector "#save-bar", text: "You have unsaved changes" click_button "Save Changes" expect(page).to have_selector "#save-bar", text: "All changes saved" - expect(page).to have_no_selector "input[name='quantity'].ng-dirty" + expect(page).not_to have_selector "input[name='quantity'].ng-dirty" end end context "when unacceptable data is sent to the server" do it "displays an update button which submits pending changes" do - expect(page).to have_no_selector "#save-bar" + expect(page).not_to have_selector "#save-bar" line_item = order.line_items.first fill_in "quantity", with: line_item.variant.on_hand + line_item.quantity + 10 expect(page).to have_selector "input[name='quantity'].ng-dirty" @@ -565,7 +565,7 @@ describe ' end it "shows all default columns, except the de-selected column" do - expect(page).to have_no_selector "th", text: "PRODUCER" + expect(page).not_to have_selector "th", text: "PRODUCER" expect(page).to have_selector "th", text: "NAME" expect(page).to have_selector "th", text: 'Completed at'.upcase @@ -608,7 +608,7 @@ describe ' select2_select s1.name, from: "supplier_filter" page.find('.filter-actions .button.icon-search').click expect(page).to have_selector "tr#li_#{li1.id}" - expect(page).to have_no_selector "tr#li_#{li2.id}" + expect(page).not_to have_selector "tr#li_#{li2.id}" end it "displays all line items when 'All' is selected from supplier filter" do @@ -617,7 +617,7 @@ describe ' select2_select s1.name, from: "supplier_filter" page.find('.filter-actions .button.icon-search').click expect(page).to have_selector "tr#li_#{li1.id}" - expect(page).to have_no_selector "tr#li_#{li2.id}" + expect(page).not_to have_selector "tr#li_#{li2.id}" select2_select "All", from: "supplier_filter" page.find('.filter-actions .button.icon-search').click expect(page).to have_selector "tr#li_#{li1.id}" @@ -657,7 +657,7 @@ describe ' find(".select2-result-label", text: d1.name.to_s).click page.find('.filter-actions .button.icon-search').click expect(page).to have_selector "tr#li_#{li1.id}" - expect(page).to have_no_selector "tr#li_#{li2.id}" + expect(page).not_to have_selector "tr#li_#{li2.id}" end it "displays all line items when 'All' is selected from distributor filter", retry: 3 do @@ -666,7 +666,7 @@ describe ' find("#s2id_distributor_filter .select2-chosen").click find(".select2-result-label", text: d1.name.to_s).click page.find('.filter-actions .button.icon-search').click - expect(page).to have_no_selector "tr#li_#{li2.id}" + expect(page).not_to have_selector "tr#li_#{li2.id}" # displays orders from all enterprises find("#s2id_distributor_filter .select2-chosen").click find(".select2-result-label", text: "All").click @@ -719,9 +719,9 @@ describe ' with_options: OrderCycle.pluck(:name).unshift("All") select2_select oc1.name, from: "order_cycle_filter" page.find('.filter-actions .button.icon-search').click - expect(page).to have_no_selector "#loading i" + expect(page).not_to have_selector "#loading i" expect(page).to have_selector "tr#li_#{li1.id}" - expect(page).to have_no_selector "tr#li_#{li2.id}" + expect(page).not_to have_selector "tr#li_#{li2.id}" end it "displays all line items when 'All' is selected from order_cycle filter", retry: 3 do @@ -729,7 +729,7 @@ describe ' select2_select oc1.name, from: "order_cycle_filter" page.find('.filter-actions .button.icon-search').click expect(page).to have_selector "tr#li_#{li1.id}" - expect(page).to have_no_selector "tr#li_#{li2.id}" + expect(page).not_to have_selector "tr#li_#{li2.id}" select2_select "All", from: "order_cycle_filter" page.find('.filter-actions .button.icon-search').click displays_default_orders @@ -768,20 +768,20 @@ describe ' click_on_select2 oc1.name, from: "order_cycle_filter" page.find('.filter-actions .button.icon-search').click expect(page).to have_selector "tr#li_#{li1.id}" - expect(page).to have_no_selector "tr#li_#{li2.id}" + expect(page).not_to have_selector "tr#li_#{li2.id}" click_on_select2 d1.name, from: "distributor_filter" click_on_select2 s1.name, from: "supplier_filter" page.find('.filter-actions .button.icon-search').click expect(page).to have_selector "tr#li_#{li1.id}" - expect(page).to have_no_selector "tr#li_#{li2.id}" + expect(page).not_to have_selector "tr#li_#{li2.id}" click_on_select2 d2.name, from: "distributor_filter" click_on_select2 s2.name, from: "supplier_filter" page.find('.filter-actions .button.icon-search').click - expect(page).to have_no_selector "tr#li_#{li1.id}" - expect(page).to have_no_selector "tr#li_#{li2.id}" + expect(page).not_to have_selector "tr#li_#{li1.id}" + expect(page).not_to have_selector "tr#li_#{li2.id}" click_on_select2 oc2.name, from: "order_cycle_filter" page.find('.filter-actions .button.icon-search').click - expect(page).to have_no_selector "tr#li_#{li1.id}" + expect(page).not_to have_selector "tr#li_#{li1.id}" expect(page).to have_selector "tr#li_#{li2.id}" end @@ -793,7 +793,7 @@ describe ' click_on_select2 s1.name, from: "supplier_filter" page.find('.filter-actions .button.icon-search').click expect(page).to have_selector "tr#li_#{li1.id}" - expect(page).to have_no_selector "tr#li_#{li2.id}" + expect(page).not_to have_selector "tr#li_#{li2.id}" page.find('.filter-actions #clear_filters_button').click expect(page).to have_selector "div#s2id_order_cycle_filter a.select2-choice", text: "All" expect(page).to have_selector "div#s2id_supplier_filter a.select2-choice", text: "All" @@ -850,7 +850,7 @@ describe ' expect(page).to have_selector "tr#li_#{li1.id}" expect(page).to have_selector "tr#li_#{li2.id}" expect(page).to have_selector "tr#li_#{li3.id}" - expect(page).to have_no_selector "tr#li_#{li4.id}" + expect(page).not_to have_selector "tr#li_#{li4.id}" find("input.datepicker").click select_dates_from_daterangepicker(from, to) @@ -878,9 +878,9 @@ describe ' # daterange picker should have changed expect(find("input.datepicker").value) .to eq "#{today.prev_day(9).strftime('%F')} to #{today.strftime('%F')}" - expect(page).to have_no_selector "#save-bar" + expect(page).not_to have_selector "#save-bar" within("tr#li_#{li2.id} td.quantity") do - expect(page).to have_no_selector "input[name=quantity].ng-dirty" + expect(page).not_to have_selector "input[name=quantity].ng-dirty" end end @@ -921,6 +921,7 @@ describe ' expect(page).to have_selector "tr#li_#{li2.id} input[type='checkbox'][name='bulk']" end + # rubocop:disable Rails/FindEach. # These are Capybara finders it "displays a checkbox to which toggles the 'checked' state of all checkboxes" do check "toggle_bulk" page.all("input[type='checkbox'][name='bulk']").each{ |checkbox| @@ -931,6 +932,7 @@ describe ' expect(checkbox.checked?).to be false } end + # rubocop:enable Rails/FindEach it "displays a bulk action select box with a list of actions" do list_of_actions = ['Delete Selected'] @@ -967,8 +969,8 @@ describe ' click_on("OK") end # order 1 should be canceled - expect(page).to have_no_selector "tr#li_#{li1.id}" - expect(page).to have_no_selector "tr#li_#{li11.id}" + expect(page).not_to have_selector "tr#li_#{li1.id}" + expect(page).not_to have_selector "tr#li_#{li11.id}" expect(o1.reload.state).to eq("canceled") # order 2 should not be canceled expect(page).to have_selector "tr#li_#{li2.id}" @@ -992,8 +994,8 @@ describe ' click_on "OK" end - expect(page).to have_no_selector ".modal" - expect(page).to have_no_selector "tr#li_#{li1.id}" + expect(page).not_to have_selector ".modal" + expect(page).not_to have_selector "tr#li_#{li1.id}" expect(page).to have_selector "tr#li_#{li11.id}" expect(o1.reload.state).to eq("complete") end @@ -1105,7 +1107,7 @@ describe ' end expect(page).to have_selector "a.delete-line-item", count: 1 expect(o2.reload.state).to eq("canceled") - end.to_not have_enqueued_mail(Spree::OrderMailer, :cancel_email) + end.not_to have_enqueued_mail(Spree::OrderMailer, :cancel_email) end it "the user can confirm + wants to send email confirmation : line item is " \ @@ -1123,7 +1125,7 @@ describe ' it "the user can confirm + uncheck the restock option: line item is then deleted and " \ "order is canceled without retocking" do - expect_any_instance_of(Spree::StockLocation).to_not receive(:restock) + expect_any_instance_of(Spree::StockLocation).not_to receive(:restock) expect do within(".modal") do uncheck("Restock Items: return all items to stock") @@ -1195,8 +1197,8 @@ describe ' end it "all line items of the same variant" do - expect(page).to have_no_selector "tr#li_#{li1.id}" - expect(page).to have_no_selector "tr#li_#{li2.id}" + expect(page).not_to have_selector "tr#li_#{li1.id}" + expect(page).not_to have_selector "tr#li_#{li2.id}" expect(page).to have_selector "tr#li_#{li3.id}" expect(page).to have_selector "tr#li_#{li4.id}" expect(page).to have_css("table#listing_orders tbody tr", count: 2) @@ -1211,7 +1213,7 @@ describe ' end it "shows all products and clears group buy box" do - expect(page).to have_no_selector "div#group_buy_calculation" + expect(page).not_to have_selector "div#group_buy_calculation" expect(page).to have_selector "tr#li_#{li1.id}" expect(page).to have_selector "tr#li_#{li2.id}" expect(page).to have_selector "tr#li_#{li3.id}" @@ -1226,10 +1228,10 @@ describe ' end it "shows only variant filtering by email" do - expect(page).to have_no_selector "tr#li_#{li1.id}" - expect(page).to have_no_selector "tr#li_#{li2.id}" + expect(page).not_to have_selector "tr#li_#{li1.id}" + expect(page).not_to have_selector "tr#li_#{li2.id}" expect(page).to have_selector "tr#li_#{li3.id}" - expect(page).to have_no_selector "tr#li_#{li4.id}" + expect(page).not_to have_selector "tr#li_#{li4.id}" end context "clicking 'Clear Filters' button" do @@ -1285,13 +1287,13 @@ describe ' visit_bulk_order_management expect(page).to have_selector "tr#li_#{line_item_distributed.id}" - expect(page).to have_no_selector "tr#li_#{line_item_not_distributed.id}" + expect(page).not_to have_selector "tr#li_#{line_item_not_distributed.id}" end end def visit_bulk_order_management visit spree.admin_bulk_order_management_path - expect(page).to have_no_text 'Loading orders' + expect(page).not_to have_text 'Loading orders' end def displays_default_orders @@ -1304,7 +1306,7 @@ describe ' expect(page).to have_selector "tr#li_#{li.id}" end excluded_line_items.each do |li| - expect(page).to have_no_selector "tr#li_#{li.id}" + expect(page).not_to have_selector "tr#li_#{li.id}" end end end diff --git a/spec/system/admin/bulk_product_update_spec.rb b/spec/system/admin/bulk_product_update_spec.rb index a15d7621b4..1f954dc142 100644 --- a/spec/system/admin/bulk_product_update_spec.rb +++ b/spec/system/admin/bulk_product_update_spec.rb @@ -68,9 +68,9 @@ describe ' expect(page).to have_selector "a.view-variants", count: 1 find("a.view-variants").click - expect(page).to have_no_selector "span[name='on_hand']", text: "On demand" + expect(page).not_to have_selector "span[name='on_hand']", text: "On demand" expect(page).to have_field "variant_on_hand", with: "4" - expect(page).to have_no_field "variant_on_hand", with: "" + expect(page).not_to have_field "variant_on_hand", with: "" expect(page).to have_selector "span[name='variant_on_hand']", text: "On demand" end @@ -344,7 +344,6 @@ describe ' within "tr#p_#{p.id}" do expect(page).to have_field "product_name", with: p.name expect(page).to have_select "producer_id", selected: s1.name - expect(page).to have_select2 "p#{p.id}_category_id", selected: t2.name expect(page).to have_select "variant_unit_with_scale", selected: "Volume (L)" expect(page).to have_checked_field "inherits_properties" expect(page).to have_field "product_sku", with: p.sku @@ -352,7 +351,6 @@ describe ' fill_in "product_name", with: "Big Bag Of Potatoes" select s2.name, from: 'producer_id' select "Weight (kg)", from: "variant_unit_with_scale" - select2_select t1.name, from: "p#{p.id}_category_id" uncheck "inherits_properties" fill_in "product_sku", with: "NEW SKU" end @@ -365,7 +363,6 @@ describe ' expect(p.supplier).to eq s2 expect(p.variant_unit).to eq "weight" expect(p.variant_unit_scale).to eq 1000 # Kg - expect(p.primary_taxon.permalink).to eq t1.permalink expect(p.inherits_properties).to be false expect(p.sku).to eq "NEW SKU" end @@ -527,7 +524,7 @@ describe ' sleep 2 # wait for page to initialise - expect(page).to have_no_field "product_name", with: p2.name + expect(page).not_to have_field "product_name", with: p2.name fill_in "product_name", with: "new product1" within "#save-bar" do @@ -708,7 +705,7 @@ describe ' toggle_columns /^.{0,1}Producer$/i - expect(page).to have_no_selector "th", text: "PRODUCER" + expect(page).not_to have_selector "th", text: "PRODUCER" expect(page).to have_selector "th", text: "NAME" expect(page).to have_selector "th", text: "PRICE" expect(page).to have_selector "th", text: "ON HAND" @@ -739,7 +736,7 @@ describe ' # Products are hidden when filtered out expect(page).to have_field "product_name", with: p1.name - expect(page).to have_no_field "product_name", with: p2.name + expect(page).not_to have_field "product_name", with: p2.name # Clearing filters click_button "Clear Filters" @@ -787,7 +784,7 @@ describe ' expect(page).to have_field 'product_name', with: product_supplied.name expect(page).to have_field 'product_name', with: product_supplied_permitted.name - expect(page).to have_no_field 'product_name', with: product_not_supplied.name + expect(page).not_to have_field 'product_name', with: product_not_supplied.name end it "shows only suppliers that I manage or have permission to" do @@ -799,7 +796,7 @@ describe ' with_options: [supplier_managed1.name, supplier_managed2.name, supplier_permitted.name], selected: supplier_managed1.name, ) - expect(page).to have_no_select 'producer_id', with_options: [supplier_unmanaged.name] + expect(page).not_to have_select 'producer_id', with_options: [supplier_unmanaged.name] end it "shows inactive products that I supply" do @@ -910,8 +907,8 @@ describe ' expect(page).to have_css ".spinner" end - expect(page).to have_no_css ".spinner" - expect(page).to have_no_selector "div.reveal-modal" + expect(page).not_to have_css ".spinner" + expect(page).not_to have_selector "div.reveal-modal" within "table#listing_products tr#p_#{product.id}" do # New thumbnail is shown in image column diff --git a/spec/system/admin/customers_spec.rb b/spec/system/admin/customers_spec.rb index 8c82778f86..b8ab97768e 100644 --- a/spec/system/admin/customers_spec.rb +++ b/spec/system/admin/customers_spec.rb @@ -45,9 +45,9 @@ describe 'Customers' do # Loads the right customers; positive assertion first, so DOM content is loaded expect(page).to have_selector "tr#c_#{customer4.id}" - expect(page).to have_no_selector "tr#c_#{customer1.id}" - expect(page).to have_no_selector "tr#c_#{customer2.id}" - expect(page).to have_no_selector "tr#c_#{customer3.id}" + expect(page).not_to have_selector "tr#c_#{customer1.id}" + expect(page).not_to have_selector "tr#c_#{customer2.id}" + expect(page).not_to have_selector "tr#c_#{customer3.id}" # Changing Shops select2_select managed_distributor1.name, from: "shop_id" @@ -55,12 +55,12 @@ describe 'Customers' do # Loads the right customers expect(page).to have_selector "tr#c_#{customer1.id}" expect(page).to have_selector "tr#c_#{customer2.id}" - expect(page).to have_no_selector "tr#c_#{customer3.id}" - expect(page).to have_no_selector "tr#c_#{customer4.id}" + expect(page).not_to have_selector "tr#c_#{customer3.id}" + expect(page).not_to have_selector "tr#c_#{customer4.id}" # Searching fill_in "quick_search", with: customer2.email - expect(page).to have_no_selector "tr#c_#{customer1.id}" + expect(page).not_to have_selector "tr#c_#{customer1.id}" expect(page).to have_selector "tr#c_#{customer2.id}" fill_in "quick_search", with: "" @@ -87,8 +87,8 @@ describe 'Customers' do expect(page).to have_selector "th.email" expect(page).to have_content customer1.email toggle_columns "Email" - expect(page).to have_no_selector "th.email" - expect(page).to have_no_content customer1.email + expect(page).not_to have_selector "th.email" + expect(page).not_to have_content customer1.email # Deleting create(:subscription, customer: customer1) @@ -102,7 +102,7 @@ describe 'Customers' do text: 'Delete failed: This customer has ' \ 'active subscriptions. Cancel them first.' click_button "OK" - }.to_not change{ Customer.count } + }.not_to change{ Customer.count } expect{ within "tr#c_#{customer2.id}" do @@ -110,7 +110,7 @@ describe 'Customers' do find("a.delete-customer").click end end - expect(page).to have_no_selector "tr#c_#{customer2.id}" + expect(page).not_to have_selector "tr#c_#{customer2.id}" }.to change{ Customer.count }.by(-1) end @@ -153,8 +153,8 @@ describe 'Customers' do expect(page).to have_content "$-99.00" end within "tr#c_#{customer4.id}" do - expect(page).to_not have_content "CREDIT OWED" - expect(page).to_not have_content "BALANCE DUE" + expect(page).not_to have_content "CREDIT OWED" + expect(page).not_to have_content "BALANCE DUE" expect(page).to have_content "$0.00" end end @@ -370,7 +370,7 @@ describe 'Customers' do first('#bill-address-link').click expect(page).to have_content 'Edit Billing Address' - expect(page).to_not have_content 'Please input all of the required fields' + expect(page).not_to have_content 'Please input all of the required fields' end it 'creates a new shipping address' do @@ -436,7 +436,7 @@ describe 'Customers' do click_button 'Add Customer' expect(page).to have_selector "#new-customer-dialog .error", text: "Please enter a valid email address" - }.to_not change{ Customer.of(managed_distributor1).count } + }.not_to change{ Customer.of(managed_distributor1).count } # When an invalid email with domain is used it's checked by "valid_email2" gem #7886 expect{ @@ -444,7 +444,7 @@ describe 'Customers' do click_button 'Add Customer' expect(page).to have_selector "#new-customer-dialog .error", text: "Email is invalid" - }.to_not change{ Customer.of(managed_distributor1).count } + }.not_to change{ Customer.of(managed_distributor1).count } # When a new valid email is used expect{ diff --git a/spec/system/admin/dfc_product_import_spec.rb b/spec/system/admin/dfc_product_import_spec.rb new file mode 100644 index 0000000000..195c8370c5 --- /dev/null +++ b/spec/system/admin/dfc_product_import_spec.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: false + +require 'system_helper' +require_relative '../../../engines/dfc_provider/spec/support/authorization_helper' + +describe "DFC Product Import" do + include AuthorizationHelper + + let(:user) { create(:oidc_user, owned_enterprises: [enterprise]) } + let(:enterprise) { create(:supplier_enterprise) } + let(:source_product) { create(:product, supplier: enterprise) } + + before do + login_as user + source_product # to be imported + allow(PrivateAddressCheck).to receive(:private_address?).and_return(false) + user.oidc_account.update!(token: allow_token_for(email: user.email)) + end + + it "imports from given catalog" do + visit admin_product_import_path + + select enterprise.name, from: "Enterprise" + + # We are testing against our own catalog for now but we want to replace + # this with the URL of another app when available. + host = Rails.application.default_url_options[:host] + url = "http://#{host}/api/dfc/enterprises/#{enterprise.id}/catalog_items" + fill_in "catalog_url", with: url + + # By feeding our own catalog to the import, we are effectively cloning the + # products. But the DFC product references the spree_product_id which + # make the importer create a variant for that product instead of creating + # a new independent product. + expect { + click_button "Import" + }.to change { + source_product.variants.count + }.by(1) + + expect(page).to have_content "Importing a DFC product catalog" + expect(page).to have_content "Imported products: 1" + end +end diff --git a/spec/system/admin/enterprise_fees_spec.rb b/spec/system/admin/enterprise_fees_spec.rb index a227c0e49e..53dbaf2e33 100644 --- a/spec/system/admin/enterprise_fees_spec.rb +++ b/spec/system/admin/enterprise_fees_spec.rb @@ -153,7 +153,7 @@ describe ' # editing to an invalid combination select 'Flat Rate (per order)', from: "#{prefix}_calculator_type" - expect{ click_button 'Update' }.to_not change { fee.reload.calculator_type } + expect{ click_button 'Update' }.not_to change { fee.reload.calculator_type } expect(page).to have_content "Inheriting the tax categeory requires a per-item calculator." end end @@ -250,7 +250,7 @@ describe ' # Then my enterprise fee should have been deleted visit admin_enterprise_fees_path - expect(page).to have_no_selector "input[value='#{fee.name}']" + expect(page).not_to have_selector "input[value='#{fee.name}']" end context "as an enterprise manager" do diff --git a/spec/system/admin/enterprise_groups_spec.rb b/spec/system/admin/enterprise_groups_spec.rb index f0b2eecc33..d025aa8cc8 100644 --- a/spec/system/admin/enterprise_groups_spec.rb +++ b/spec/system/admin/enterprise_groups_spec.rb @@ -103,7 +103,7 @@ describe ' first("a.delete-resource").click end - expect(page).to have_no_content 'EGEGEG' + expect(page).not_to have_content 'EGEGEG' expect(EnterpriseGroup.all).not_to include eg end diff --git a/spec/system/admin/enterprise_relationships_spec.rb b/spec/system/admin/enterprise_relationships_spec.rb index 1d84e4374d..50b2b89e33 100644 --- a/spec/system/admin/enterprise_relationships_spec.rb +++ b/spec/system/admin/enterprise_relationships_spec.rb @@ -138,6 +138,7 @@ create(:enterprise) end end + # rubocop:disable Rails/FindEach. # These are Capybara finders def find_relationship(parent, child) page.all('tr').each do |tr| return tr if tr.find('td:first-child').text == parent.name && @@ -146,4 +147,5 @@ create(:enterprise) end raise "relationship not found" end + # rubocop:enable Rails/FindEach. end diff --git a/spec/system/admin/enterprise_roles_spec.rb b/spec/system/admin/enterprise_roles_spec.rb index 4ce24922cd..2b7be496ca 100644 --- a/spec/system/admin/enterprise_roles_spec.rb +++ b/spec/system/admin/enterprise_roles_spec.rb @@ -140,7 +140,7 @@ create(:enterprise) within 'table.managers' do within "tr#manager-#{user1.id}" do expect(page).to have_css 'i.owner' - expect(page).to have_no_css 'i.contact' + expect(page).not_to have_css 'i.contact' end within "tr#manager-#{user2.id}" do expect(page).to have_css 'i.contact' diff --git a/spec/system/admin/enterprises/connected_apps_spec.rb b/spec/system/admin/enterprises/connected_apps_spec.rb index 2b61f6466f..2be667e904 100644 --- a/spec/system/admin/enterprises/connected_apps_spec.rb +++ b/spec/system/admin/enterprises/connected_apps_spec.rb @@ -16,7 +16,7 @@ describe "Connected Apps", feature: :connected_apps, vcr: true do # removing one day. Flipper.disable(:connected_apps) visit edit_admin_enterprise_path(enterprise) - expect(page).to_not have_content "CONNECTED APPS" + expect(page).not_to have_content "CONNECTED APPS" Flipper.enable(:connected_apps, enterprise.owner) visit edit_admin_enterprise_path(enterprise) @@ -36,18 +36,18 @@ describe "Connected Apps", feature: :connected_apps, vcr: true do expect(page).to have_content "Discover Regenerative" click_button "Allow data sharing" - expect(page).to_not have_button "Allow data sharing" + expect(page).not_to have_button "Allow data sharing" expect(page).to have_button "Loading", disabled: true perform_enqueued_jobs(only: ConnectAppJob) - expect(page).to_not have_button "Loading", disabled: true + expect(page).not_to have_button "Loading", disabled: true expect(page).to have_content "account is connected" expect(page).to have_link "Manage listing" click_button "Stop sharing" expect(page).to have_button "Allow data sharing" - expect(page).to_not have_button "Stop sharing" - expect(page).to_not have_content "account is connected" - expect(page).to_not have_link "Manage listing" + expect(page).not_to have_button "Stop sharing" + expect(page).not_to have_content "account is connected" + expect(page).not_to have_link "Manage listing" end end diff --git a/spec/system/admin/enterprises/images_spec.rb b/spec/system/admin/enterprises/images_spec.rb index 42bc455b92..f5f1ccdb97 100644 --- a/spec/system/admin/enterprises/images_spec.rb +++ b/spec/system/admin/enterprises/images_spec.rb @@ -123,6 +123,6 @@ describe "Managing enterprise images" do end def expect_no_preview_image - expect(page).to have_no_selector(".image-field-group__preview-image") + expect(page).not_to have_selector(".image-field-group__preview-image") end end diff --git a/spec/system/admin/enterprises/index_spec.rb b/spec/system/admin/enterprises/index_spec.rb index f1d78745ec..c79780b490 100644 --- a/spec/system/admin/enterprises/index_spec.rb +++ b/spec/system/admin/enterprises/index_spec.rb @@ -19,8 +19,8 @@ describe 'Enterprises Index' do expect(page).to have_select "sets_enterprise_set_collection_attributes_1_sells" expect(page).to have_content "Settings" expect(page).to have_content "Delete" - expect(page).to have_no_content "Payment Methods" - expect(page).to have_no_content "Shipping Methods" + expect(page).not_to have_content "Payment Methods" + expect(page).not_to have_content "Shipping Methods" expect(page).to have_content "Enterprise Fees" end @@ -93,9 +93,9 @@ describe 'Enterprises Index' do "#{manager.email} is not permitted to own any more enterprises (limit is 1)." ) second_distributor.reload - }.to_not change { second_distributor.owner } + }.not_to change { second_distributor.owner } - expect(second_distributor.owner).to_not eq manager + expect(second_distributor.owner).not_to eq manager end def select_new_owner(user, enterprise) @@ -149,8 +149,8 @@ describe 'Enterprises Index' do expect(page).to have_selector "td.package", text: 'Profile' end - expect(page).to have_no_content "supplier2.name" - expect(page).to have_no_content "distributor2.name" + expect(page).not_to have_content "supplier2.name" + expect(page).not_to have_content "distributor2.name" expect(find('.js-admin-section-header')).to have_link "New Enterprise" end @@ -164,12 +164,12 @@ describe 'Enterprises Index' do expect(page).to have_selector "a.selector.producer.disabled" find("a.selector.producer.disabled").click expect(page).to have_selector "a.selector.non-producer.selected.disabled" - expect(page).to have_no_selector "a.update" + expect(page).not_to have_selector "a.update" find("td.package").click expect(page).to have_selector "a.selector.hub-profile.disabled" find("a.selector.hub-profile.disabled").click expect(page).to have_selector "a.selector.hub.selected.disabled" - expect(page).to have_no_selector "a.update" + expect(page).not_to have_selector "a.update" end end end @@ -194,13 +194,13 @@ describe 'Enterprises Index' do # Open the producer panel find("td.producer").click - expect(page).to have_no_selector "a.selector.producer.selected" + expect(page).not_to have_selector "a.selector.producer.selected" expect(page).to have_selector "a.selector.non-producer.selected" # Change to a producer find("a.selector.producer").click - expect(page).to have_no_selector "a.selector.non-producer.selected" + expect(page).not_to have_selector "a.selector.non-producer.selected" expect(page).to have_selector "a.selector.producer.selected" expect(page).to have_selector "a.update", text: "SAVE" @@ -212,16 +212,16 @@ describe 'Enterprises Index' do # Open the package panel find("td.package").click - expect(page).to have_no_selector "a.selector.producer-profile.selected" - expect(page).to have_no_selector "a.selector.producer-shop.selected" + expect(page).not_to have_selector "a.selector.producer-profile.selected" + expect(page).not_to have_selector "a.selector.producer-shop.selected" expect(page).to have_selector "a.selector.producer-hub.selected" # Change to a producer-shop find("a.selector.producer-shop").click - expect(page).to have_no_selector "a.selector.producer-profile.selected" + expect(page).not_to have_selector "a.selector.producer-profile.selected" expect(page).to have_selector "a.selector.producer-shop.selected" - expect(page).to have_no_selector "a.selector.producer-hub.selected" + expect(page).not_to have_selector "a.selector.producer-hub.selected" expect(page).to have_selector "a.update", text: "SAVE" # Save selection diff --git a/spec/system/admin/enterprises/terms_and_conditions_spec.rb b/spec/system/admin/enterprises/terms_and_conditions_spec.rb index 9b8eace1f2..e8a5f33bd7 100644 --- a/spec/system/admin/enterprises/terms_and_conditions_spec.rb +++ b/spec/system/admin/enterprises/terms_and_conditions_spec.rb @@ -50,7 +50,7 @@ describe "Uploading Terms and Conditions PDF" do click_button "Update" expect(page). to have_content "Enterprise \"#{distributor.name}\" has been successfully updated!" - expect(distributor.reload.terms_and_conditions_blob.created_at).to_not eq run_time + expect(distributor.reload.terms_and_conditions_blob.created_at).not_to eq run_time go_to_business_details expect(page).to have_selector "a[href*='Terms-of-ServiceUK.pdf']" diff --git a/spec/system/admin/enterprises_spec.rb b/spec/system/admin/enterprises_spec.rb index 69c52cf6b1..92fdf304d3 100644 --- a/spec/system/admin/enterprises_spec.rb +++ b/spec/system/admin/enterprises_spec.rb @@ -97,7 +97,7 @@ describe ' expect(page).to have_checked_field "enterprise_require_login_false" expect(page).to have_checked_field "enterprise_allow_guest_orders_true" find(:xpath, '//*[@id="enterprise_require_login_true"]').trigger("click") - expect(page).to have_no_checked_field "enterprise_require_login_false" + expect(page).not_to have_checked_field "enterprise_require_login_false" # expect(page).to have_checked_field "enterprise_enable_subscriptions_false" accept_alert do @@ -105,7 +105,7 @@ describe ' within(".side_menu") { click_link "Users" } end select2_select user.email, from: 'enterprise_owner_id' - expect(page).to have_no_selector '.select2-drop-mask' # Ensure select2 has finished + expect(page).not_to have_selector '.select2-drop-mask' # Ensure select2 has finished accept_alert do click_link "About" @@ -149,7 +149,7 @@ describe ' within(".permalink") do link_path = "#{main_app.root_url}#{@enterprise.permalink}/shop" - link = find_link(link) + link = find_link(link_path) expect(link[:href]).to eq link_path expect(link[:target]).to eq '_blank' end @@ -413,7 +413,7 @@ describe ' click_button 'Create' # Then it should show me an error - expect(page).to have_no_content 'Enterprise "zzz" has been successfully created!' + expect(page).not_to have_content 'Enterprise "zzz" has been successfully created!' expect(page).to have_content "#{enterprise_user.email} is not permitted " \ "to own any more enterprises (limit is 1)." end @@ -588,7 +588,7 @@ describe ' expect do click_button "Invite" expect(page).to have_content "Email is invalid" - end.to_not enqueue_job ActionMailer::MailDeliveryJob + end.not_to enqueue_job ActionMailer::MailDeliveryJob end end @@ -600,7 +600,7 @@ describe ' expect do click_button "Invite" expect(page).to have_content "User already exists" - end.to_not enqueue_job ActionMailer::MailDeliveryJob + end.not_to enqueue_job ActionMailer::MailDeliveryJob end end @@ -698,7 +698,7 @@ describe ' end expect(flash_message).to match(/Logo removed/) distributor1.reload - expect(distributor1.white_label_logo).to_not be_attached + expect(distributor1.white_label_logo).not_to be_attached end shared_examples "edit link with" do |url, result| diff --git a/spec/system/admin/invoice_print_spec.rb b/spec/system/admin/invoice_print_spec.rb index 45a6823706..e4246a9d69 100644 --- a/spec/system/admin/invoice_print_spec.rb +++ b/spec/system/admin/invoice_print_spec.rb @@ -56,7 +56,7 @@ describe ' login_as_admin visit spree.print_admin_order_path(order, params: url_params) convert_pdf_to_page - expect(page).to have_no_content 'Payment Description at Checkout' + expect(page).not_to have_content 'Payment Description at Checkout' end end @@ -542,7 +542,7 @@ describe ' # first line item, no tax expect(page).to have_content Spree::Product.first.name.to_s expect(page).to have_content "($12,540.00 / kg)" # unit price - expect(page).to have_content "1 1g $12.54 $12.54 0.0% $12.54" + expect(page).to have_content "1 1g $12.54 $12.54 $12.54" # # second line item, included tax expect(page).to have_content Spree::Product.second.name.to_s expect(page).to have_content "($500,150.00 / kg)" # unit price @@ -645,7 +645,7 @@ describe ' # first line item, no tax expect(page).to have_content Spree::Product.first.name.to_s expect(page).to have_content "($12,540.00 / kg)" # unit price - expect(page).to have_content "1 1g $12.54 $12.54 0.0% $12.54" + expect(page).to have_content "1 1g $12.54 $12.54 $12.54" # second line item, included tax expect(page).to have_content Spree::Product.second.name.to_s expect(page).to have_content "($500,150.00 / kg)" # unit price @@ -678,7 +678,7 @@ describe ' context "Order has previous invoices" do before do - OrderInvoiceGenerator.new(order).generate_or_update_latest_invoice + Orders::GenerateInvoiceService.new(order).generate_or_update_latest_invoice first_line_item = order.line_items.first order.line_items.first.update(quantity: first_line_item.quantity + 1) end diff --git a/spec/system/admin/oidc_settings_spec.rb b/spec/system/admin/oidc_settings_spec.rb index 160a9ca189..3402bc6797 100644 --- a/spec/system/admin/oidc_settings_spec.rb +++ b/spec/system/admin/oidc_settings_spec.rb @@ -6,7 +6,7 @@ describe "OIDC Settings" do it "requires login" do visit admin_oidc_settings_path expect(page).to have_button "Login" - expect(page).to_not have_button "Link your Les Communs OIDC Account" + expect(page).not_to have_button "Link your Les Communs OIDC Account" end describe "with valid login" do @@ -36,7 +36,7 @@ describe "OIDC Settings" do expect(page).to have_content "Tokens to access connected apps have expired" click_button "Refresh authorisation" - expect(page).to_not have_content "Tokens to access connected apps have expired" + expect(page).not_to have_content "Tokens to access connected apps have expired" end end end diff --git a/spec/system/admin/order_cycles/complex_editing_multiple_product_pages_spec.rb b/spec/system/admin/order_cycles/complex_editing_multiple_product_pages_spec.rb index 0317722eaf..122085e583 100644 --- a/spec/system/admin/order_cycles/complex_editing_multiple_product_pages_spec.rb +++ b/spec/system/admin/order_cycles/complex_editing_multiple_product_pages_spec.rb @@ -26,7 +26,7 @@ describe ' expect(page).to have_selector ".exchange-product-details" expect(page).to have_content "1 of 2 Variants Loaded" - expect(page).to_not have_content new_product.name + expect(page).not_to have_content new_product.name end it "load all products" do @@ -36,9 +36,9 @@ describe ' end it "select all products" do - # replace with scroll_to method when upgrading to Capybara >= 3.13.0 checkbox_id = "order_cycle_incoming_exchange_0_select_all_variants" - page.execute_script("document.getElementById('#{checkbox_id}').scrollIntoView()") + elmnt = find_field(id: checkbox_id) + scroll_to(elmnt, align: :top) check checkbox_id expect_all_products_loaded diff --git a/spec/system/admin/order_cycles/list_spec.rb b/spec/system/admin/order_cycles/list_spec.rb index 027cbb2ebc..308f95a36f 100644 --- a/spec/system/admin/order_cycles/list_spec.rb +++ b/spec/system/admin/order_cycles/list_spec.rb @@ -72,7 +72,7 @@ describe ' end # I can load more order_cycles - expect(page).to have_no_selector "#listing_order_cycles tr.order-cycle-#{oc7.id}" + expect(page).not_to have_selector "#listing_order_cycles tr.order-cycle-#{oc7.id}" click_button "Show 30 more days" expect(page).to have_selector "#listing_order_cycles tr.order-cycle-#{oc7.id}" @@ -81,9 +81,9 @@ describe ' expect(page).to have_selector "#listing_order_cycles tr.order-cycle-#{oc1.id}" expect(page).to have_selector "#listing_order_cycles tr.order-cycle-#{oc2.id}" select2_select oc1.suppliers.first.name, from: "involving_filter" - expect(page).to have_no_selector "#listing_order_cycles tr.order-cycle-#{oc0.id}" + expect(page).not_to have_selector "#listing_order_cycles tr.order-cycle-#{oc0.id}" expect(page).to have_selector "#listing_order_cycles tr.order-cycle-#{oc1.id}" - expect(page).to have_no_selector "#listing_order_cycles tr.order-cycle-#{oc2.id}" + expect(page).not_to have_selector "#listing_order_cycles tr.order-cycle-#{oc2.id}" select2_select "Any Enterprise", from: "involving_filter" expect(page).to have_selector "#listing_order_cycles tr.order-cycle-#{oc0.id}" expect(page).to have_selector "#listing_order_cycles tr.order-cycle-#{oc1.id}" @@ -95,8 +95,8 @@ describe ' expect(page).to have_selector "#listing_order_cycles tr.order-cycle-#{oc2.id}" fill_in "query", with: oc0.name expect(page).to have_selector "#listing_order_cycles tr.order-cycle-#{oc0.id}" - expect(page).to have_no_selector "#listing_order_cycles tr.order-cycle-#{oc1.id}" - expect(page).to have_no_selector "#listing_order_cycles tr.order-cycle-#{oc2.id}" + expect(page).not_to have_selector "#listing_order_cycles tr.order-cycle-#{oc1.id}" + expect(page).not_to have_selector "#listing_order_cycles tr.order-cycle-#{oc2.id}" fill_in "query", with: '' expect(page).to have_selector "#listing_order_cycles tr.order-cycle-#{oc0.id}" expect(page).to have_selector "#listing_order_cycles tr.order-cycle-#{oc1.id}" @@ -108,9 +108,9 @@ describe ' expect(page).to have_selector "#listing_order_cycles tr.order-cycle-#{oc2.id}" expect(page).to have_selector "#listing_order_cycles tr.order-cycle-#{oc3.id}" select2_select schedule1.name, from: "schedule_filter" - expect(page).to have_no_selector "#listing_order_cycles tr.order-cycle-#{oc0.id}" + expect(page).not_to have_selector "#listing_order_cycles tr.order-cycle-#{oc0.id}" expect(page).to have_selector "#listing_order_cycles tr.order-cycle-#{oc1.id}" - expect(page).to have_no_selector "#listing_order_cycles tr.order-cycle-#{oc2.id}" + expect(page).not_to have_selector "#listing_order_cycles tr.order-cycle-#{oc2.id}" expect(page).to have_selector "#listing_order_cycles tr.order-cycle-#{oc3.id}" select2_select 'Any Schedule', from: "schedule_filter" expect(page).to have_selector "#listing_order_cycles tr.order-cycle-#{oc0.id}" @@ -133,9 +133,9 @@ describe ' } around(:each) do |spec| - I18n.locale = :pt - spec.run - I18n.locale = :en + I18n.with_locale(:pt) do + spec.run + end end context 'using datetimepickers' do @@ -194,15 +194,6 @@ describe ' private - def wait_for_edit_form_to_load_order_cycle(order_cycle) - expect(page).to have_field "order_cycle_name", with: order_cycle.name - end - - def select_incoming_variant(supplier, exchange_no, variant) - page.find("table.exchanges tr.supplier-#{supplier.id} td.products").click - check "order_cycle_incoming_exchange_#{exchange_no}_variants_#{variant.id}" - end - def date_warning_msg(nbr = 1) "This order cycle is linked to %d open subscription orders. Changing this date now will not " \ "affect any orders which have already been placed, but should be avoided if possible. " \ diff --git a/spec/system/admin/order_cycles/simple_spec.rb b/spec/system/admin/order_cycles/simple_spec.rb index 0d2be4f125..087665d92d 100644 --- a/spec/system/admin/order_cycles/simple_spec.rb +++ b/spec/system/admin/order_cycles/simple_spec.rb @@ -207,7 +207,7 @@ describe ' # I should see only the order cycle I am coordinating expect(page).to have_selector "tr.order-cycle-#{oc_user_coordinating.id}" - expect(page).to_not have_selector "tr.order-cycle-#{oc_for_other_user.id}" + expect(page).not_to have_selector "tr.order-cycle-#{oc_for_other_user.id}" toggle_columns "Producers", "Shops" @@ -263,7 +263,7 @@ describe ' click_button 'Save and Next' expect(page).to have_content 'Your order cycle has been updated.' - expect(page).to_not have_content "Loading..." + expect(page).not_to have_content "Loading..." expect(page).to have_select 'new_distributor_id' expect(page).not_to have_select 'new_distributor_id', @@ -578,7 +578,7 @@ describe ' expect(page).to have_selector "tr.supplier-#{supplier_managed.id}" expect(page).to have_selector 'tr.supplier', count: 1 - expect(page).to_not have_content "Loading..." + expect(page).not_to have_content "Loading..." # Open the products list for managed_supplier's incoming exchange within "tr.supplier-#{supplier_managed.id}" do @@ -847,7 +847,7 @@ describe ' accept_alert do first('a.delete-order-cycle').click end - expect(page).to_not have_selector "tr.order-cycle-#{order_cycle.id}" + expect(page).not_to have_selector "tr.order-cycle-#{order_cycle.id}" end private diff --git a/spec/system/admin/order_spec.rb b/spec/system/admin/order_spec.rb index 8ec2dc5867..f6f5f96fe0 100644 --- a/spec/system/admin/order_spec.rb +++ b/spec/system/admin/order_spec.rb @@ -210,7 +210,7 @@ describe ' end expect(page).to have_content "Cannot add item to canceled order" expect(order.reload.state).to eq("canceled") - end.to_not have_enqueued_mail(Spree::OrderMailer, :cancel_email) + end.not_to have_enqueued_mail(Spree::OrderMailer, :cancel_email) end it "and the items are not restocked when the user uncheck the checkbox to restock items" do @@ -359,7 +359,7 @@ describe ' within("tr.stock-item", text: order.products.first.name) do expect(page).to have_field :quantity, with: max_quantity.to_s end - expect { item.reload }.to_not change { item.quantity } + expect { item.reload }.not_to change { item.quantity } end it "there are infinite items available (variant is on demand)" do @@ -430,7 +430,7 @@ describe ' find("button.add_variant").click end - expect(page).to_not have_selector("table.stock-levels") + expect(page).not_to have_selector("table.stock-levels") expect(page).to have_selector("table.stock-contents") within("tr.stock-item") do @@ -719,7 +719,7 @@ describe ' it "should not display links but a js alert" do visit spree.edit_admin_order_path(order) - find("#links-dropdown .ofn-drop-down").click + find("summary", text: "ACTIONS").click expect(page).to have_link "Send Invoice", href: "#" expect(page).to have_link "Print Invoice", href: "#" @@ -729,7 +729,7 @@ describe ' expect(message) .to eq "#{distributor1.name} must have a valid ABN before invoices can be used." - find("#links-dropdown .ofn-drop-down").click + find("summary", text: "ACTIONS").click message = accept_prompt do click_link "Send Invoice" end @@ -752,7 +752,7 @@ describe ' it "can edit shipping method" do visit spree.edit_admin_order_path(order) - expect(page).to_not have_content different_shipping_method_for_distributor1.name + expect(page).not_to have_content different_shipping_method_for_distributor1.name find('.edit-method').click expect(page).to have_select2('selected_shipping_rate_id', @@ -857,7 +857,7 @@ describe ' it "can edit and delete tracking number" do test_tracking_number = "ABCCBA" - expect(page).to_not have_content test_tracking_number + expect(page).not_to have_content test_tracking_number find('.edit-tracking').click fill_in "tracking", with: test_tracking_number @@ -871,18 +871,18 @@ describe ' # the alert box vanishes and tracking num is still present expect(page).to have_content 'Are you sure?' find('.cancel').click - expect(page).to_not have_content 'Are you sure?' + expect(page).not_to have_content 'Are you sure?' expect(page).to have_content test_tracking_number find('.delete-tracking.icon-trash').click expect(page).to have_content 'Are you sure?' find('.confirm').click - expect(page).to_not have_content test_tracking_number + expect(page).not_to have_content test_tracking_number end it "can edit and delete note" do test_note = "this is a note" - expect(page).to_not have_content test_note + expect(page).not_to have_content test_note find('.edit-note.icon-edit').click fill_in "note", with: test_note @@ -896,13 +896,13 @@ describe ' # the alert box vanishes and note is still present expect(page).to have_content 'Are you sure?' find('.cancel').click - expect(page).to_not have_content 'Are you sure?' + expect(page).not_to have_content 'Are you sure?' expect(page).to have_content test_note find('.delete-note.icon-trash').click expect(page).to have_content 'Are you sure?' find('.confirm').click - expect(page).to_not have_content test_note + expect(page).not_to have_content test_note end it "viewing shipping fees" do @@ -949,50 +949,63 @@ describe ' uncheck 'Send a shipment/pick up notification email to the customer.' expect { find_button("Confirm").click - }.to_not enqueue_job(ActionMailer::MailDeliveryJob) + }.not_to enqueue_job(ActionMailer::MailDeliveryJob) end - save_screenshot('~/hello.png') expect(order.reload.shipped?).to be true expect(page).to have_text 'SHIPPED' end - context "ship order from dropdown" do - it "ships the order and sends email" do - expect(order.reload.shipped?).to be false + shared_examples "ship order from dropdown" do |subpage| + context "in the #{subpage}", feature: :invoices do + it "ships the order and sends email" do + click_on subpage + expect(order.reload.shipped?).to be false - find('.ofn-drop-down').click - click_link 'Ship Order' + find('.ofn-drop-down').click + click_link 'Ship Order' - within ".reveal-modal" do - expect(page).to have_checked_field('Send a shipment/pick up ' \ - 'notification email to the customer.') - expect { - find_button("Confirm").click - }.to enqueue_job(ActionMailer::MailDeliveryJob).exactly(:once) + within ".reveal-modal" do + expect(page).to have_checked_field('Send a shipment/pick up ' \ + 'notification email to the customer.') + expect { + find_button("Confirm").click + }.to enqueue_job(ActionMailer::MailDeliveryJob).exactly(:once) + end + + expect(order.reload.shipped?).to be true + expect(page).to have_text 'SHIPPED' end - expect(order.reload.shipped?).to be true - expect(page).to have_text 'SHIPPED' - end + it "ships the order without sending email" do + click_on subpage + expect(order.reload.shipped?).to be false - it "ships the order without sending email" do - expect(order.reload.shipped?).to be false + find('.ofn-drop-down').click + click_link 'Ship Order' - find('.ofn-drop-down').click - click_link 'Ship Order' + within ".reveal-modal" do + uncheck 'Send a shipment/pick up notification email to the customer.' + expect { + find_button("Confirm").click + }.not_to enqueue_job(ActionMailer::MailDeliveryJob) + end - within ".reveal-modal" do - uncheck 'Send a shipment/pick up notification email to the customer.' - expect { - find_button("Confirm").click - }.to_not enqueue_job(ActionMailer::MailDeliveryJob) + expect(order.reload.shipped?).to be true + expect(page).to have_text 'SHIPPED' end - - expect(order.reload.shipped?).to be true - expect(page).to have_text 'SHIPPED' end end + + it_behaves_like "ship order from dropdown", "Order Details" + context "pending examples" do + before { pending("#12369") } + it_behaves_like "ship order from dropdown", "Customer Details" + it_behaves_like "ship order from dropdown", "Payments" + it_behaves_like "ship order from dropdown", "Adjustments" + it_behaves_like "ship order from dropdown", "Invoices" + it_behaves_like "ship order from dropdown", "Return Authorizations" + end end context "when an included variant has been deleted" do @@ -1012,7 +1025,7 @@ describe ' order.cancel! visit spree.edit_admin_order_path(order) within("tr.stock-item", text: order.products.first.name) do - expect(page).to_not have_selector("a.edit-item") + expect(page).not_to have_selector("a.edit-item") end end end @@ -1035,12 +1048,12 @@ describe ' accept_alert 'Are you sure?' do find("a.delete-resource").click end - expect(page).to_not have_content incomplete_order.products.first.name + expect(page).not_to have_content incomplete_order.products.first.name end # updates the order and verifies the warning disappears click_button 'Update And Recalculate Fees' - expect(page).to_not have_content "Out of Stock".upcase + expect(page).not_to have_content "Out of Stock".upcase end end end @@ -1058,11 +1071,11 @@ describe ' expect(page).to have_selector 'td', text: product.name expect(page).to have_select2 'order_distributor_id', with_options: [distributor1.name] - expect(page).to_not have_select2 'order_distributor_id', with_options: [distributor2.name] + expect(page).not_to have_select2 'order_distributor_id', with_options: [distributor2.name] expect(page).to have_select2 'order_order_cycle_id', with_options: ["#{order_cycle1.name} (open)"] - expect(page).to_not have_select2 'order_order_cycle_id', + expect(page).not_to have_select2 'order_order_cycle_id', with_options: ["#{order_cycle2.name} (open)"] click_button 'Update' @@ -1188,8 +1201,8 @@ describe ' click_link "Create or Update Invoice" # and disappear after clicking - expect(page).to have_no_link "Create or Update Invoice" - expect(page).to_not have_content "The order has changed since the last invoice update." + expect(page).not_to have_link "Create or Update Invoice" + expect(page).not_to have_content "The order has changed since the last invoice update." # creating an invoice, displays a second row expect(page.find("table").text).to have_content(table_contents) diff --git a/spec/system/admin/orders/invoices_spec.rb b/spec/system/admin/orders/invoices_spec.rb index 5527eac11a..e57f83f350 100644 --- a/spec/system/admin/orders/invoices_spec.rb +++ b/spec/system/admin/orders/invoices_spec.rb @@ -40,7 +40,7 @@ describe ' expect { click_link "Create or Update Invoice" - expect(page).to have_no_link "Create or Update Invoice" + expect(page).not_to have_link "Create or Update Invoice" }.to change { order.invoices.count }.by(1) invoice = order.invoices.first @@ -55,7 +55,7 @@ describe ' context 'order not updated since latest invoice' do it 'should not render new invoice button' do click_link 'Invoices' - expect(page).to_not have_link "Create or Update Invoice" + expect(page).not_to have_link "Create or Update Invoice" end end @@ -72,7 +72,7 @@ describe ' click_link 'Invoices' expect { click_link "Create or Update Invoice" - expect(page).to have_no_link "Create or Update Invoice" + expect(page).not_to have_link "Create or Update Invoice" }.to change { order.reload.invoices.count }.by(0) .and change { latest_invoice.reload.presenter.note }.from("").to(new_note) @@ -89,7 +89,7 @@ describe ' click_link 'Invoices' expect { click_link "Create or Update Invoice" - expect(page).to have_no_link "Create or Update Invoice" + expect(page).not_to have_link "Create or Update Invoice" }.to change { order.reload.invoices.count }.by(1) expect(latest_invoice.reload.cancelled).to eq true diff --git a/spec/system/admin/orders_spec.rb b/spec/system/admin/orders_spec.rb index b9f29d296b..d7b4ca715f 100644 --- a/spec/system/admin/orders_spec.rb +++ b/spec/system/admin/orders_spec.rb @@ -115,7 +115,7 @@ describe ' # Order 2 and 3 should show, but not 4 expect(page).to have_content order2.number expect(page).to have_content order3.number - expect(page).to_not have_content order4.number + expect(page).not_to have_content order4.number end it "filter by distributors" do @@ -126,7 +126,7 @@ describe ' # Order 2 and 4 should show, but not 3 expect(page).to have_content order2.number - expect(page).to_not have_content order3.number + expect(page).not_to have_content order3.number expect(page).to have_content order4.number end @@ -138,7 +138,7 @@ describe ' page.find('.filter-actions .button[type=submit]').click # Order 3 and 4 should show, but not 2 - expect(page).to_not have_content order2.number + expect(page).not_to have_content order2.number expect(page).to have_content order3.number expect(page).to have_content order4.number end @@ -149,9 +149,9 @@ describe ' page.find('.filter-actions .button[type=submit]').click # Order 3 should show, but not 2 and 4 - expect(page).to_not have_content order2.number + expect(page).not_to have_content order2.number expect(page).to have_content order3.number - expect(page).to_not have_content order4.number + expect(page).not_to have_content order4.number end it "filter by customer first and last names" do @@ -161,8 +161,8 @@ describe ' page.find('.filter-actions .button[type=submit]').click # Order 2 should show, but not 3 and 4 expect(page).to have_content order2.number - expect(page).to_not have_content order3.number - expect(page).to_not have_content order4.number + expect(page).not_to have_content order3.number + expect(page).not_to have_content order4.number find("#clear_filters_button").click # filtering by last name @@ -170,8 +170,8 @@ describe ' fill_in "Last name begins with", with: billing_address4.lastname page.find('.filter-actions .button[type=submit]').click # Order 4 should show, but not 2 and 3 - expect(page).to_not have_content order2.number - expect(page).to_not have_content order3.number + expect(page).not_to have_content order2.number + expect(page).not_to have_content order3.number expect(page).to have_content order4.number find("#clear_filters_button").click @@ -194,16 +194,16 @@ describe ' page.find('.filter-actions .button[type=submit]').click # Order 2 should show, but not 3 and 5 expect(page).to have_content order2.number - expect(page).to_not have_content order3.number - expect(page).to_not have_content order4.number + expect(page).not_to have_content order3.number + expect(page).not_to have_content order4.number find("#clear_filters_button").click tomselect_search_and_select "Signed, sealed, delivered", from: 'shipping_method_id' page.find('.filter-actions .button[type=submit]').click # Order 4 should show, but not 2 and 3 - expect(page).to_not have_content order2.number - expect(page).to_not have_content order3.number + expect(page).not_to have_content order2.number + expect(page).not_to have_content order3.number expect(page).to have_content order4.number end @@ -214,8 +214,8 @@ describe ' # Order 2 should show, but not 3 and 4 expect(page).to have_content order2.number - expect(page).to_not have_content order3.number - expect(page).to_not have_content order4.number + expect(page).not_to have_content order3.number + expect(page).not_to have_content order4.number end it "filter by order state" do @@ -236,10 +236,10 @@ describe ' # Order 2 should show, but not 3 and 4 expect(page).to have_content order.number - expect(page).to_not have_content order2.number - expect(page).to_not have_content order3.number - expect(page).to_not have_content order4.number - expect(page).to_not have_content order5.number + expect(page).not_to have_content order2.number + expect(page).not_to have_content order3.number + expect(page).not_to have_content order4.number + expect(page).not_to have_content order5.number end end @@ -281,7 +281,7 @@ describe ' # And the same orders are displayed when sorting by name: find("th a", text: "NAME").click - expect(page).to have_no_content order_empty.number + expect(page).not_to have_content order_empty.number expect(page).to have_content order_not_empty.number expect(page).to have_content order_not_empty_no_address.number end @@ -445,7 +445,7 @@ describe ' within "tr#order_#{order3.id}" do expect(page).to have_content "Note" find(".icon-warning-sign").hover - expect(page).to have_content /#{order3.special_instructions}/i + expect(page).to have_content(/#{order3.special_instructions}/i) end end end @@ -496,10 +496,11 @@ describe ' page.find("#listing_orders thead th:first-child input[type=checkbox]").trigger("click") expect(page.find( "#listing_orders tbody tr td:first-child input[type=checkbox]" - )).to_not be_checked - # disables print invoices button - page.find("span.icon-reorder", text: "ACTIONS").click - expect(page).to_not have_content "Print Invoices" + )).not_to be_checked + # disables print invoices button not clickable + expect { find("span.icon-reorder", text: "ACTIONS").click } + .to raise_error(Capybara::Cuprite::MouseEventFailed) + expect(page).not_to have_content "Print Invoices" end end @@ -573,20 +574,13 @@ describe ' end context "can bulk print invoices" do - def extract_pdf_content - # Extract last part of invoice URL - link = page.find(class: "button", text: "VIEW FILE") - filename = link[:href].match %r{/invoices/.*} - - # Load invoice temp file directly instead of downloading - reader = PDF::Reader.new("tmp/#{filename}.pdf") - reader.pages.map(&:text) - end + let(:order4_selector){ "#order_#{order4.id} input[name='bulk_ids[]']" } + let(:order5_selector){ "#order_#{order5.id} input[name='bulk_ids[]']" } shared_examples "can bulk print invoices from 2 orders" do it "bulk prints invoices in pdf format" do - page.find("#listing_orders tbody tr:nth-child(1) input[name='bulk_ids[]']").click - page.find("#listing_orders tbody tr:nth-child(2) input[name='bulk_ids[]']").click + page.find(order4_selector).click + page.find(order5_selector).click page.find("span.icon-reorder", text: "ACTIONS").click within ".ofn-drop-down .menu" do @@ -621,13 +615,173 @@ describe ' end end - it_behaves_like "can bulk print invoices from 2 orders" + shared_examples "should ignore the non invoiceable order" do + it "bulk prints invoices in pdf format" do + page.find(order4_selector).click + page.find(order5_selector).click + + page.find("span.icon-reorder", text: "ACTIONS").click + within ".ofn-drop-down .menu" do + expect { + page.find("span", text: "Print Invoices").click # Prints invoices in bulk + }.to enqueue_job(BulkInvoiceJob).exactly(:once) + end + + expect(page).to have_content "Compiling Invoices" + expect(page).to have_content "Please wait until the PDF is ready " \ + "before closing this modal." + + perform_enqueued_jobs(only: BulkInvoiceJob) + + expect(page).to have_content "Bulk Invoice created" + + within ".modal-content" do + expect(page).to have_link(class: "button", text: "VIEW FILE", + href: /invoices/) + + invoice_content = extract_pdf_content + + expect(invoice_content).to have_content("TAX INVOICE", count: 1) + expect(invoice_content).not_to have_content(order4.number.to_s) + expect(invoice_content).to have_content(order5.number.to_s) + expect(invoice_content).not_to have_content(distributor4.name.to_s) + expect(invoice_content).to have_content(distributor5.name.to_s) + expect(invoice_content).not_to have_content(order_cycle4.name.to_s) + expect(invoice_content).to have_content(order_cycle5.name.to_s) + end + end + end + + context "ABN is not required" do + before do + allow(Spree::Config).to receive(:enterprise_number_required_on_invoices?) + .and_return false + end - context "with legal invoices feature", feature: :invoices do it_behaves_like "can bulk print invoices from 2 orders" + + context "with legal invoices feature", feature: :invoices do + it_behaves_like "can bulk print invoices from 2 orders" + end + + context "one of the two orders is not invoiceable" do + before do + order4.cancel! + end + + it_behaves_like "should ignore the non invoiceable order" + context "with legal invoices feature", feature: :invoices do + it_behaves_like "should ignore the non invoiceable order" + end + end + + context "ordering by customer name" do + context "ascending" do + let!(:surnames) { + [order2.name.gsub(/.* /, ""), order3.name.gsub(/.* /, ""), + order4.name.gsub(/.* /, ""), order5.name.gsub(/.* /, "")].sort + } + it "orders by customer name ascending" do + page.find('a', text: "NAME").click # orders alphabetically (asc) + sleep(0.5) # waits for column sorting + + page.find("#selectAll").click + + print_all_invoices + + invoice_content = extract_pdf_content + + expect( + invoice_content.join + ).to match(/#{surnames[0]}.*#{surnames[1]}.*#{surnames[2]}.*#{surnames[3]}/m) + end + end + context "descending" do + let!(:surnames) { + [order2.name.gsub(/.* /, ""), order3.name.gsub(/.* /, ""), + order4.name.gsub(/.* /, ""), order5.name.gsub(/.* /, "")].sort.reverse + } + it "order by customer name descending" do + page.find('a', text: "NAME").click # orders alphabetically (asc) + sleep(0.5) # waits for column sorting + page.find('a', text: "NAME").click # orders alphabetically (desc) + sleep(0.5) # waits for column sorting + + page.find("#selectAll").click + + print_all_invoices + + invoice_content = extract_pdf_content + + expect( + invoice_content.join + ).to match(/#{surnames[0]}.*#{surnames[1]}.*#{surnames[2]}.*#{surnames[3]}/m) + end + end + end + end + context "ABN is required" do + before do + allow(Spree::Config).to receive(:enterprise_number_required_on_invoices?) + .and_return true + end + context "All the distributors setup the ABN" do + before do + order4.distributor.update(abn: "123456789") + order5.distributor.update(abn: "987654321") + end + context "all the orders are invoiceable (completed/resumed)" do + it_behaves_like "can bulk print invoices from 2 orders" + context "with legal invoices feature", feature: :invoices do + it_behaves_like "can bulk print invoices from 2 orders" + end + end + + context "one of the two orders is not invoiceable" do + before do + order4.cancel! + end + + it_behaves_like "should ignore the non invoiceable order" + context "with legal invoices feature", feature: :invoices do + it_behaves_like "should ignore the non invoiceable order" + end + end + end + context "the distributor of one of the order didn't set the ABN" do + before do + order4.distributor.update(abn: "123456789") + order5.distributor.update(abn: nil) + end + + shared_examples "should not print the invoice" do + it "should render a warning message" do + page.find(order4_selector).click + page.find(order5_selector).click + + page.find("span.icon-reorder", text: "ACTIONS").click + within ".ofn-drop-down .menu" do + expect { + page.find("span", text: "Print Invoices").click # Prints invoices in bulk + }.not_to enqueue_job(BulkInvoiceJob) + end + + expect(page).not_to have_content "Compiling Invoices" + expect(page).not_to have_content "Please wait until the PDF is ready " \ + "before closing this modal." + + expect(page).to have_content "#{ + order5.distributor.name + } must have a valid ABN before invoices can be used." + end + end + it_behaves_like "should not print the invoice" + context "with legal invoices feature", feature: :invoices do + it_behaves_like "should not print the invoice" + end + end end end - it "can bulk cancel 2 orders" do page.find("#listing_orders tbody tr:nth-child(1) input[name='bulk_ids[]']").click page.find("#listing_orders tbody tr:nth-child(2) input[name='bulk_ids[]']").click @@ -644,7 +798,7 @@ describe ' uncheck "Send a cancellation email to the customer" expect { find_button("Cancel").click # Cancels the cancel action - }.to_not enqueue_job(ActionMailer::MailDeliveryJob).exactly(:twice) + }.not_to enqueue_job(ActionMailer::MailDeliveryJob).exactly(:twice) end page.find("span.icon-reorder", text: "ACTIONS").click @@ -655,7 +809,7 @@ describe ' within ".reveal-modal" do expect { find_button("Confirm").click # Confirms the cancel action - }.to_not enqueue_job(ActionMailer::MailDeliveryJob).exactly(:twice) + }.not_to enqueue_job(ActionMailer::MailDeliveryJob).exactly(:twice) end expect(page).to have_content("CANCELLED", count: 2) @@ -696,7 +850,7 @@ describe ' within ".reveal-modal" do expect { find_button("Confirm").click - }.to_not enqueue_job(ActionMailer::MailDeliveryJob) + }.not_to enqueue_job(ActionMailer::MailDeliveryJob) end end end @@ -898,15 +1052,15 @@ describe ' visit spree.admin_orders_path expect(page).to have_content complete_order.number expect(page).to have_content empty_complete_order.number - expect(page).to have_no_content incomplete_order.number - expect(page).to have_no_content empty_order.number + expect(page).not_to have_content incomplete_order.number + expect(page).not_to have_content empty_order.number uncheck 'Only show complete orders' page.find('button[type=submit]').click expect(page).to have_content complete_order.number expect(page).to have_content incomplete_order.number - expect(page).to have_no_content empty_order.number + expect(page).not_to have_content empty_order.number end end @@ -977,4 +1131,30 @@ describe ' expect(find("input.datepicker").value).to be_empty end end + def extract_pdf_content + # Extract last part of invoice URL + link = page.find(class: "button", text: "VIEW FILE") + filename = link[:href].match %r{/invoices/.*} + + # Load invoice temp file directly instead of downloading + reader = PDF::Reader.new("tmp/#{filename}.pdf") + reader.pages.map(&:text) + end + + def print_all_invoices + page.find("span.icon-reorder", text: "ACTIONS").click + within ".ofn-drop-down .menu" do + expect { + page.find("span", text: "Print Invoices").click # Prints invoices in bulk + }.to enqueue_job(BulkInvoiceJob).exactly(:once) + end + + expect(page).to have_content "Compiling Invoices" + expect(page).to have_content "Please wait until the PDF is ready " \ + "before closing this modal." + + perform_enqueued_jobs(only: BulkInvoiceJob) + + expect(page).to have_content "Bulk Invoice created" + end end diff --git a/spec/system/admin/overview_spec.rb b/spec/system/admin/overview_spec.rb index 055ef9d6e5..da77a83e39 100644 --- a/spec/system/admin/overview_spec.rb +++ b/spec/system/admin/overview_spec.rb @@ -53,7 +53,7 @@ describe ' it "does not show a products item" do visit '/admin' - expect(page).to have_no_selector "#products" + expect(page).not_to have_selector "#products" end end end diff --git a/spec/system/admin/payments_stripe_spec.rb b/spec/system/admin/payments_stripe_spec.rb index 13ff3a6b6f..0d648250ae 100644 --- a/spec/system/admin/payments_stripe_spec.rb +++ b/spec/system/admin/payments_stripe_spec.rb @@ -47,7 +47,8 @@ describe ' click_button "Update" expect(page).to have_link "StripeSCA" - expect(OrderPaymentFinder.new(order.reload).last_payment.state).to eq "completed" + last_payment_state = Orders::FindPaymentService.new(order.reload).last_payment.state + expect(last_payment_state).to eq 'completed' end end @@ -66,7 +67,7 @@ describe ' expect(page).to have_link "StripeSCA" expect(page).to have_content "FAILED" - expect(OrderPaymentFinder.new(order.reload).last_payment.state).to eq "failed" + expect(Orders::FindPaymentService.new(order.reload).last_payment.state).to eq "failed" end end end @@ -87,7 +88,7 @@ describe ' expect(page).to have_link "StripeSCA" expect(page).to have_content "AUTHORIZATION REQUIRED" - expect(OrderPaymentFinder.new(order.reload).last_payment.state) + expect(Orders::FindPaymentService.new(order.reload).last_payment.state) .to eq "requires_authorization" end end @@ -112,7 +113,7 @@ describe ' click_button "Update" expect(page).to have_link "StripeSCA" - expect(OrderPaymentFinder.new(order.reload).last_payment.state).to eq "completed" + expect(Orders::FindPaymentService.new(order.reload).last_payment.state).to eq "completed" end end end @@ -191,6 +192,10 @@ describe ' order.payments << payment end + after do + Stripe::Account.delete(connected_account.id) + end + it "allows to refund the payment" do login_as_admin visit spree.admin_order_payments_path order @@ -200,7 +205,7 @@ describe ' page.find('a.icon-void').click - expect(page).to have_content "VOID" + expect(page).to have_content "VOID", wait: 4 expect(payment.reload.state).to eq "void" end end diff --git a/spec/system/admin/product_import_spec.rb b/spec/system/admin/product_import_spec.rb index 8671daa8c7..6cc91970a6 100644 --- a/spec/system/admin/product_import_spec.rb +++ b/spec/system/admin/product_import_spec.rb @@ -78,14 +78,14 @@ describe "Product Import" do proceed_to_validation expect(page).to have_selector '.item-count', text: "2" - expect(page).to have_no_selector '.invalid-count' + expect(page).not_to have_selector '.invalid-count' expect(page).to have_selector '.create-count', text: "2" - expect(page).to have_no_selector '.update-count' + expect(page).not_to have_selector '.update-count' save_data expect(page).to have_selector '.created-count', text: '2' - expect(page).to have_no_selector '.updated-count' + expect(page).not_to have_selector '.updated-count' carrots = Spree::Product.find_by(name: 'Carrots') potatoes = Spree::Product.find_by(name: 'Potatoes') @@ -126,9 +126,9 @@ describe "Product Import" do expect(page).to have_selector '.item-count', text: "4" expect(page).to have_selector '.invalid-count', text: "3" expect(page).to have_selector ".create-count", text: "1" - expect(page).to have_no_selector '.update-count' + expect(page).not_to have_selector '.update-count' - expect(page).to have_no_selector 'input[type=submit][value="Save"]' + expect(page).not_to have_selector 'input[type=submit][value="Save"]' end it "displays info about inconsistent variant unit names, within the same product" do @@ -152,7 +152,7 @@ describe "Product Import" do "with the same name" expect(page).to have_content "Imported file contains invalid entries" - expect(page).to have_no_selector 'input[type=submit][value="Save"]' + expect(page).not_to have_selector 'input[type=submit][value="Save"]' end it "handles saving of named tax and shipping categories" do @@ -173,12 +173,12 @@ describe "Product Import" do expect(page).to have_selector '.item-count', text: "1" expect(page).to have_selector '.create-count', text: "1" - expect(page).to have_no_selector '.update-count' + expect(page).not_to have_selector '.update-count' save_data expect(page).to have_selector '.created-count', text: '1' - expect(page).to have_no_selector '.updated-count' + expect(page).not_to have_selector '.updated-count' carrots = Spree::Product.find_by(name: 'Carrots') expect(carrots.variants.first.tax_category).to eq tax_category @@ -227,8 +227,8 @@ describe "Product Import" do expect(page).to have_field "product_name", with: carrots.name expect(page).to have_field "product_name", with: potatoes.name - expect(page).to have_no_field "product_name", with: product.name - expect(page).to have_no_field "product_name", with: product2.name + expect(page).not_to have_field "product_name", with: product.name + expect(page).not_to have_field "product_name", with: product2.name end it "can reset product stock to zero for products not present in the CSV" do @@ -278,11 +278,11 @@ describe "Product Import" do proceed_to_validation expect(page).to have_selector '.item-count', text: "3" - expect(page).to_not have_selector '.invalid-count' + expect(page).not_to have_selector '.invalid-count' expect(page).to have_selector '.create-count', text: "3" - expect(page).to_not have_selector '.update-count' - expect(page).to_not have_selector '.inv-create-count' - expect(page).to_not have_selector '.inv-update-count' + expect(page).not_to have_selector '.update-count' + expect(page).not_to have_selector '.inv-create-count' + expect(page).not_to have_selector '.inv-update-count' save_data @@ -316,16 +316,16 @@ describe "Product Import" do proceed_to_validation expect(page).to have_selector '.item-count', text: "3" - expect(page).to have_no_selector '.invalid-count' - expect(page).to have_no_selector '.create-count' - expect(page).to have_no_selector '.update-count' + expect(page).not_to have_selector '.invalid-count' + expect(page).not_to have_selector '.create-count' + expect(page).not_to have_selector '.update-count' expect(page).to have_selector '.inv-create-count', text: "2" expect(page).to have_selector '.inv-update-count', text: "1" save_data - expect(page).to have_no_selector '.created-count' - expect(page).to have_no_selector '.updated-count' + expect(page).not_to have_selector '.created-count' + expect(page).not_to have_selector '.updated-count' expect(page).to have_selector '.inv-created-count', text: '2' expect(page).to have_selector '.inv-updated-count', text: '1' @@ -374,7 +374,7 @@ describe "Product Import" do proceed_to_validation expect(page).to have_selector '.item-count', text: "1" - expect(page).to have_no_selector '.invalid-count' + expect(page).not_to have_selector '.invalid-count' expect(page).to have_selector '.inv-create-count', text: '1' save_data @@ -414,7 +414,7 @@ describe "Product Import" do click_button 'Upload' proceed_to_validation expect(page).to have_selector '.item-count', text: "1" - expect(page).to have_no_selector '.invalid-count' + expect(page).not_to have_selector '.invalid-count' expect(page).to have_selector '.inv-create-count', text: '1' save_data @@ -452,7 +452,7 @@ describe "Product Import" do expect(page).to have_content "Variant_unit_name must be the same for products " \ "with the same name" expect(page).to have_content "Imported file contains invalid entries" - expect(page).to have_no_selector 'input[type=submit][value="Save"]' + expect(page).not_to have_selector 'input[type=submit][value="Save"]' visit main_app.admin_inventory_path @@ -482,7 +482,7 @@ describe "Product Import" do expect(page).to have_content "line 4: Cabbage - Units incorrect value" expect(page).to have_content "line 3: Beans - Units incorrect value" expect(page).to have_content "Imported file contains invalid entries" - expect(page).to have_no_selector 'input[type=submit][value="Save"]' + expect(page).not_to have_selector 'input[type=submit][value="Save"]' expect(page).not_to have_content "line 2: Aubergine" end @@ -509,7 +509,7 @@ describe "Product Import" do expect(page).to have_content "line 4: Cabbage - Price incorrect value" expect(page).to have_content "line 3: Beans - Price can't be blank" expect(page).to have_content "Imported file contains invalid entries" - expect(page).to have_no_selector 'input[type=submit][value="Save"]' + expect(page).not_to have_selector 'input[type=submit][value="Save"]' expect(page).not_to have_content "line 2: Aubergine" end end @@ -541,7 +541,7 @@ describe "Product Import" do expect(page) .to have_content "line 5: Aubergine - On_hand incorrect value - On_demand incorrect value" expect(page).to have_content "Imported file contains invalid entries" - expect(page).to have_no_selector 'input[type=submit][value="Save"]' + expect(page).not_to have_selector 'input[type=submit][value="Save"]' expect(page).not_to have_content "line 2: Beans" expect(page).not_to have_content "line 3: Sprouts" end @@ -577,7 +577,7 @@ describe "Product Import" do expect(page).to have_content "line 5: Aubergine ( Bag ) - On_hand incorrect value - " \ "On_demand incorrect value" expect(page).to have_content "Imported file contains invalid entries" - expect(page).to have_no_selector 'input[type=submit][value="Save"]' + expect(page).not_to have_selector 'input[type=submit][value="Save"]' expect(page).not_to have_content "line 2: Beans" expect(page).not_to have_content "line 3: Potatoes" end @@ -611,7 +611,7 @@ describe "Product Import" do expect(page).to have_content "line 5: Aubergine ( Bag ) - On_hand incorrect value - " \ "On_demand incorrect value" expect(page).to have_content "Imported file contains invalid entries" - expect(page).to have_no_selector 'input[type=submit][value="Save"]' + expect(page).not_to have_selector 'input[type=submit][value="Save"]' expect(page).not_to have_content "line 2: Beans" expect(page).not_to have_content "line 3: Sprouts" end @@ -640,7 +640,7 @@ describe "Product Import" do expect(page).to have_content "line 3: Sprouts - Count_on_hand must be blank if on demand" expect(page).to have_content "line 4: Cabbage - Count_on_hand must be blank if on demand" expect(page).to have_content "Imported file contains invalid entries" - expect(page).to have_no_selector 'input[type=submit][value="Save"]' + expect(page).not_to have_selector 'input[type=submit][value="Save"]' end it "imports lines with all allowed units" do @@ -663,14 +663,14 @@ describe "Product Import" do proceed_to_validation expect(page).to have_selector '.item-count', text: "2" - expect(page).to have_no_selector '.invalid-count' + expect(page).not_to have_selector '.invalid-count' expect(page).to have_selector '.create-count', text: "2" - expect(page).to have_no_selector '.update-count' + expect(page).not_to have_selector '.update-count' save_data expect(page).to have_selector '.created-count', text: '2' - expect(page).to have_no_selector '.updated-count' + expect(page).not_to have_selector '.updated-count' visit spree.admin_products_path @@ -699,14 +699,14 @@ describe "Product Import" do proceed_to_validation expect(page).to have_selector '.item-count', text: "1" - expect(page).to have_no_selector '.invalid-count' + expect(page).not_to have_selector '.invalid-count' expect(page).to have_selector '.create-count', text: "1" - expect(page).to have_no_selector '.update-count' + expect(page).not_to have_selector '.update-count' save_data expect(page).to have_selector '.created-count', text: '1' - expect(page).to have_no_selector '.updated-count' + expect(page).not_to have_selector '.updated-count' expect(page).to have_content "GO TO PRODUCTS PAGE" expect(page).to have_content "UPLOAD ANOTHER FILE" @@ -739,10 +739,10 @@ describe "Product Import" do expect(page).to have_selector '.item-count', text: "1" expect(page).to have_selector '.invalid-count', text: "1" - expect(page).to have_no_selector ".create-count" - expect(page).to have_no_selector '.update-count' + expect(page).not_to have_selector ".create-count" + expect(page).not_to have_selector '.update-count' - expect(page).to have_no_selector 'input[type=submit][value="Save"]' + expect(page).not_to have_selector 'input[type=submit][value="Save"]' end context 'when using other language than English' do @@ -800,7 +800,7 @@ describe "Product Import" do click_button 'Upload' expect(page).to have_content "Importer could not process file: invalid filetype" - expect(page).to have_no_selector 'input[type=submit][value="Save"]' + expect(page).not_to have_selector 'input[type=submit][value="Save"]' expect(page).to have_content "Select a spreadsheet to upload" File.delete('/tmp/test.txt') end @@ -820,9 +820,9 @@ describe "Product Import" do attach_file 'file', '/tmp/test.csv' click_button 'Upload' - expect(page).to have_no_selector '.create-count' - expect(page).to have_no_selector '.update-count' - expect(page).to have_no_selector 'input[type=submit][value="Save"]' + expect(page).not_to have_selector '.create-count' + expect(page).not_to have_selector '.update-count' + expect(page).not_to have_selector 'input[type=submit][value="Save"]' File.delete('/tmp/test.csv') end @@ -837,9 +837,9 @@ describe "Product Import" do attach_file 'file', '/tmp/test.csv' click_button 'Upload' - expect(page).to have_no_selector '.create-count' - expect(page).to have_no_selector '.update-count' - expect(page).to have_no_selector 'input[type=submit][value="Save"]' + expect(page).not_to have_selector '.create-count' + expect(page).not_to have_selector '.update-count' + expect(page).not_to have_selector 'input[type=submit][value="Save"]' expect(flash_message).to match("Product Import encountered a malformed CSV: %s" % '') File.delete('/tmp/test.csv') @@ -874,7 +874,7 @@ describe "Product Import" do expect(page).to have_selector '.create-count', text: "1" expect(page.body).to have_content 'you do not have permission' - expect(page).to have_no_selector 'a.button.proceed' + expect(page).not_to have_selector 'a.button.proceed' end end diff --git a/spec/system/admin/products_spec.rb b/spec/system/admin/products_spec.rb index 12f1cddee5..55e15a3e41 100644 --- a/spec/system/admin/products_spec.rb +++ b/spec/system/admin/products_spec.rb @@ -143,7 +143,7 @@ describe ' expect(product.variants.first.unit_value).to eq(5000) expect(product.variants.first.unit_description).to eq("") expect(product.variant_unit_name).to eq("") - expect(product.primary_taxon_id).to eq(taxon.id) + expect(product.variants.first.primary_taxon_id).to eq(taxon.id) expect(product.variants.first.price.to_s).to eq('19.99') expect(product.on_hand).to eq(5) expect(product.variants.first.tax_category_id).to eq(tax_category.id) @@ -714,13 +714,13 @@ describe ' visit spree.admin_product_images_path(product) expect(page).to have_selector "table.index td img" - expect(product.reload.image).to_not be_nil + expect(product.reload.image).not_to be_nil accept_alert do page.find('a.delete-resource').click end - expect(page).to_not have_selector "table.index td img" + expect(page).not_to have_selector "table.index td img" expect(product.reload.image).to be_nil end diff --git a/spec/system/admin/products_v3/products_spec.rb b/spec/system/admin/products_v3/products_spec.rb index 6164d1ecf2..7384f1c0bd 100644 --- a/spec/system/admin/products_v3/products_spec.rb +++ b/spec/system/admin/products_v3/products_spec.rb @@ -43,7 +43,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do expect(page).to have_selector ".pagination" expect_products_count_to_be 15 within ".pagination" do - click_link "2" + click_on "2" end expect(page).to have_content "Showing 16 to 16" # todo: remove unnecessary duplication @@ -58,7 +58,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do select "50", from: "per_page" - expect(page).to have_content "Showing 1 to 50" + expect(page).to have_content "Showing 1 to 50", wait: 10 expect_page_to_be 1 expect_per_page_to_be 50 expect_products_count_to_be 50 @@ -66,6 +66,8 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do end describe "search" do + # TODO: explicitly test with multiple products, to ensure incorrect products don't show. + # TODO: test with multiple variants, to ensure distinct query reponse context "product has searchable term" do # create a product with a name that can be searched let!(:product_by_name) { create(:simple_product, name: "searchable product") } @@ -86,7 +88,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do visit admin_products_url within ".pagination" do - click_link "2" + click_on "2" end expect(page).to have_content "Showing 16 to 16" @@ -128,13 +130,29 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do # create a product with a different supplier let!(:producer) { create(:supplier_enterprise, name: "Producer 1") } - let!(:product_by_supplier) { create(:simple_product, supplier: producer) } + let!(:product_by_supplier) { create(:simple_product, name: "Apples", supplier: producer) } - it "can search for a product" do + it "can search for and update a product" do visit admin_products_url search_by_producer "Producer 1" + # expect(page).to have_content "1 product found for your search criteria." + expect(page).to have_select "producer_id", selected: "Producer 1", wait: 5 + expect_products_count_to_be 1 + + within row_containing_name("Apples") do + fill_in "Name", with: "Pommes" + end + + expect { + click_button "Save changes" + + expect(page).to have_content "Changes saved" + product_by_supplier.reload + }.to change { product_by_supplier.name }.to("Pommes") + + # Search is still applied # expect(page).to have_content "1 product found for your search criteria." expect(page).to have_select "producer_id", selected: "Producer 1" expect_products_count_to_be 1 @@ -169,7 +187,10 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do on_demand: false } } - let!(:product_a) { create(:simple_product, name: "Apples", sku: "APL-00") } + let!(:product_a) { + create(:simple_product, name: "Apples", sku: "APL-00", + variant_unit: "weight", variant_unit_scale: 1) # Grams + } before do visit admin_products_url end @@ -178,10 +199,23 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do within row_containing_name("Apples") do fill_in "Name", with: "Pommes" fill_in "SKU", with: "POM-00" + tomselect_select "Volume (mL)", from: "Unit scale" end within row_containing_name("Medium box") do fill_in "Name", with: "Large box" fill_in "SKU", with: "POM-01" + + click_on "Unit" # activate popout + end + + # Unit popout + # TODO: prevent empty value + fill_in "Unit value", with: "" + click_button "Save changes" # attempt to save or close the popout + expect(page).to have_field "Unit value", with: "" # popout is still open + fill_in "Unit value", with: "500.1" + + within row_containing_name("Medium box") do fill_in "Price", with: "10.25" click_on "On Hand" # activate popout @@ -201,8 +235,11 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do variant_a1.reload }.to change { product_a.name }.to("Pommes") .and change{ product_a.sku }.to("POM-00") + .and change{ product_a.variant_unit }.to("volume") + .and change{ product_a.variant_unit_scale }.to(0.001) .and change{ variant_a1.display_name }.to("Large box") .and change{ variant_a1.sku }.to("POM-01") + .and change{ variant_a1.unit_value }.to(0.5001) # volumes are stored in litres .and change{ variant_a1.price }.to(10.25) .and change{ variant_a1.on_hand }.to(6) @@ -213,8 +250,9 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do within row_containing_name("Large box") do expect(page).to have_field "Name", with: "Large box" expect(page).to have_field "SKU", with: "POM-01" + expect(page).to have_button "Unit", text: "500.1mL" expect(page).to have_field "Price", with: "10.25" - expect(page).to have_css "button[aria-label='On Hand']", text: "6" + expect(page).to have_button "On Hand", text: "6" end end @@ -223,19 +261,112 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do click_on "On Hand" # activate stock popout check "On demand" - expect(page).to have_css "button[aria-label='On Hand']", text: "On demand" + expect(page).to have_button "On Hand", text: "On demand" end expect { click_button "Save changes" expect(page).to have_content "Changes saved" - product_a.reload variant_a1.reload }.to change{ variant_a1.on_demand }.to(true) within row_containing_name("Medium box") do - expect(page).to have_css "button[aria-label='On Hand']", text: "On demand" + expect(page).to have_button "On Hand", text: "On demand" + end + end + + describe "Changing unit scale" do + it "saves unit values using the new scale" do + within row_containing_name("Medium box") do + expect(page).to have_button "Unit", text: "1g" + end + within row_containing_name("Apples") do + tomselect_select "Weight (kg)", from: "Unit scale" + end + within row_containing_name("Medium box") do + # New scale is visible immediately + expect(page).to have_button "Unit", text: "1kg" + end + + click_button "Save changes" + + expect(page).to have_content "Changes saved" + product_a.reload + expect(product_a.variant_unit).to eq "weight" + expect(product_a.variant_unit_scale).to eq 1000 # kg + expect(variant_a1.reload.unit_value).to eq 1000 # 1kg + + within row_containing_name("Medium box") do + expect(page).to have_button "Unit", text: "1kg" + end + end + + it "saves a custom item unit name" do + within row_containing_name("Apples") do + tomselect_select "Items", from: "Unit scale" + fill_in "Items", with: "box" + end + + expect { + click_button "Save changes" + + expect(page).to have_content "Changes saved" + product_a.reload + }.to change{ product_a.variant_unit }.to("items") + .and change{ product_a.variant_unit_name }.to("box") + + within row_containing_name("Apples") do + pending "#12005" + expect(page).to have_content "Items (box)" + end + end + end + + describe "Changing unit values" do + # This is a rather strange feature, I wonder if anyone actually uses it. + it "saves a variant unit description" do + within row_containing_name("Medium box") do + click_on "Unit" # activate popout + fill_in "Unit value", with: "1000 boxed" # 1000 grams + + find_field("Price").click # de-activate popout + # unit value has been parsed and displayed with unit + expect(page).to have_button "Unit", text: "1kg boxed" + end + + expect { + click_button "Save changes" + + expect(page).to have_content "Changes saved" + variant_a1.reload + }.to change{ variant_a1.unit_value }.to(1000) + .and change{ variant_a1.unit_description }.to("boxed") + + within row_containing_name("Medium box") do + # New value is visible immediately + expect(page).to have_button "Unit", text: "1kg boxed" + end + end + + it "saves a custom variant unit display name" do + within row_containing_name("Medium box") do + click_on "Unit" # activate popout + fill_in "Display unit as", with: "250g box" + end + + expect { + click_button "Save changes" + + expect(page).to have_content "Changes saved" + variant_a1.reload + }.to change{ variant_a1.unit_to_display }.to("250g box") + + within row_containing_name("Medium box") do + expect(page).to have_button "Unit", text: "250g box" + click_on "Unit" + expect(page).to have_field "Display unit as", with: "250g box" + end end end @@ -256,9 +387,11 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do product_a.update! sku: "APL-10" expect { - click_button "Discard changes" + accept_confirm do + click_on "Discard changes" + end product_a.reload - }.to_not change { product_a.name } + }.not_to change { product_a.name } within row_containing_name("Apples") do expect(page).to have_field "Name", with: "Apples" # Changed value wasn't saved @@ -270,6 +403,8 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do let!(:product_b) { create(:simple_product, name: "Bananas") } before do + visit admin_products_url + within row_containing_name("Apples") do fill_in "Name", with: "" fill_in "SKU", with: "A" * 256 @@ -295,7 +430,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do expect(page).to have_content "1 product could not be saved" expect(page).to have_content "Please review the errors and try again" product_a.reload - }.to_not change { product_a.name } + }.not_to change { product_a.name } # (there's no identifier displayed, so the user must remember which product it is..) within row_containing_name("") do @@ -320,7 +455,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do expect(page).to have_content("1 product could not be saved") product_a.reload - }.to_not change { product_a.name } + }.not_to change { product_a.name } within row_containing_name("") do fill_in "Name", with: "Pommes" @@ -349,11 +484,15 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do within new_variant_row do fill_in "Name", with: "Large box" fill_in "SKU", with: "APL-02" - fill_in "Unit", with: 1000 + + click_on "Unit" # activate popout + fill_in "Unit value", with: "1000" + fill_in "Price", with: 10.25 + click_on "On Hand" # activate popout + fill_in "On Hand", with: "3" end - fill_in "On Hand", with: "3" expect { click_button "Save changes" @@ -368,13 +507,17 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do expect(new_variant.price).to eq 10.25 expect(new_variant.unit_value).to eq 1000 expect(new_variant.on_hand).to eq 3 + expect(new_variant.tax_category_id).to be_nil within row_containing_name("Large box") do expect(page).to have_field "Name", with: "Large box" expect(page).to have_field "SKU", with: "APL-02" expect(page).to have_field "Price", with: "10.25" expect(page).to have_content "1kg" - expect(page).to have_css "button[aria-label='On Hand']", text: "3" + expect(page).to have_button "On Hand", text: "3" + within tax_category_column do + expect(page).to have_content "None" + end end end @@ -389,7 +532,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do within new_variant_row do fill_in "Name", with: "N" * 256 # too long fill_in "SKU", with: "n" * 256 - fill_in "Unit", with: "" # can't be blank + # didn't fill_in "Unit", can't be blank fill_in "Price", with: "10.25" # valid end end @@ -408,14 +551,14 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do expect(page).to have_content "1 product could not be saved" expect(page).to have_content "Please review the errors and try again" variant_a1.reload - }.to_not change { variant_a1.display_name } + }.not_to change { variant_a1.display_name } # New variant within row_containing_name("N" * 256) do expect(page).to have_field "Name", with: "N" * 256 expect(page).to have_field "SKU", with: "n" * 256 expect(page).to have_content "is too long" - expect(page).to have_field "Unit", with: "" + expect(page.find_button("Unit")).to have_text "" # have_button selector don't work here expect(page).to have_content "can't be blank" expect(page).to have_field "Price", with: "10.25" # other updated value is retained end @@ -433,131 +576,14 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do click_button "Save changes" variant_a1.reload - }.to_not change { variant_a1.display_name } + }.not_to change { variant_a1.display_name } within row_containing_name("N" * 256) do fill_in "Name", with: "Nice box" fill_in "SKU", with: "APL-02" - fill_in "Unit", with: 200 - end - expect { - click_button "Save changes" - - expect(page).to have_content "Changes saved" - product_a.reload - }.to change { product_a.variants.count }.by(1) - - new_variant = product_a.variants.last - expect(new_variant.display_name).to eq "Nice box" - expect(new_variant.sku).to eq "APL-02" - expect(new_variant.price).to eq 10.25 - expect(new_variant.unit_value).to eq 200 - end - end - end - - describe "adding variants" do - it "creates a new variant" do - click_on "New variant" - - # find empty row for Apples - new_variant_row = find_field("Name", placeholder: "Apples", with: "").ancestor("tr") - expect(new_variant_row).to be_present - - within new_variant_row do - fill_in "Name", with: "Large box" - fill_in "SKU", with: "APL-02" - fill_in "Unit", with: 1000 - fill_in "Price", with: 10.25 - click_on "On Hand" # activate popout - end - fill_in "On Hand", with: "3" - - expect { - click_button "Save changes" - - expect(page).to have_content "Changes saved" - product_a.reload - }.to change { product_a.variants.count }.by(1) - - new_variant = product_a.variants.last - expect(new_variant.display_name).to eq "Large box" - expect(new_variant.sku).to eq "APL-02" - expect(new_variant.price).to eq 10.25 - expect(new_variant.unit_value).to eq 1000 - expect(new_variant.on_hand).to eq 3 - - within row_containing_name("Large box") do - expect(page).to have_field "Name", with: "Large box" - expect(page).to have_field "SKU", with: "APL-02" - expect(page).to have_field "Price", with: "10.25" - expect(page).to have_content "1kg" - expect(page).to have_css "button[aria-label='On Hand']", text: "3" - end - end - - context "with invalid data" do - before do - click_on "New variant" - - # find empty row for Apples - new_variant_row = find_field("Name", placeholder: "Apples", with: "").ancestor("tr") - expect(new_variant_row).to be_present - - within new_variant_row do - fill_in "Name", with: "N" * 256 # too long - fill_in "SKU", with: "n" * 256 - fill_in "Unit", with: "" # can't be blank - fill_in "Price", with: "10.25" # valid - end - end - - it "shows errors for both existing and new variant fields" do - # Update existing variant with invalid data too - within row_containing_name("Medium box") do - fill_in "Name", with: "M" * 256 - fill_in "SKU", with: "m" * 256 - fill_in "Price", with: "10.25" - end - - expect { - click_button "Save changes" - - expect(page).to have_content "1 product could not be saved" - expect(page).to have_content "Please review the errors and try again" - variant_a1.reload - }.to_not change { variant_a1.display_name } - - # New variant - within row_containing_name("N" * 256) do - expect(page).to have_field "Name", with: "N" * 256 - expect(page).to have_field "SKU", with: "n" * 256 - expect(page).to have_content "is too long" - expect(page).to have_field "Unit", with: "" - expect(page).to have_content "can't be blank" - expect(page).to have_field "Price", with: "10.25" # other updated value is retained - end - - # Existing variant - within row_containing_name("M" * 256) do - expect(page).to have_field "Name", with: "M" * 256 - expect(page).to have_field "SKU", with: "m" * 256 - expect(page).to have_content "is too long" - end - end - - it "saves changes after fixing errors" do - expect { - click_button "Save changes" - - variant_a1.reload - }.to_not change { variant_a1.display_name } - - within row_containing_name("N" * 256) do - fill_in "Name", with: "Nice box" - fill_in "SKU", with: "APL-02" - fill_in "Unit", with: "200" + click_on "Unit" # activate popout + fill_in "Unit value", with: "200" end expect { @@ -580,6 +606,8 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do let!(:product_b) { create(:simple_product, name: "Bananas") } before do + visit admin_products_url + within row_containing_name("Apples") do fill_in "Name", with: "" fill_in "SKU", with: "A" * 256 @@ -595,13 +623,42 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do expect { click_button "Save changes" product_a.reload - }.to_not change { product_a.name } + }.not_to change { product_a.name } expect(page).not_to have_content("0 product was saved correctly, but") expect(page).to have_content("1 product could not be saved") expect(page).to have_content "Please review the errors and try again" end end + + context "pagination" do + let!(:product_a) { create(:simple_product, name: "zucchini") } # appears on p2 + + it "retains selected page after saving" do + create_products 15 # in addition to product_a + visit admin_products_url + + within ".pagination" do + click_on "2" + end + within row_containing_name("zucchini") do + fill_in "Name", with: "zucchinis" + end + + expect { + click_button "Save changes" + + expect(page).to have_content "Changes saved" + product_a.reload + }.to change { product_a.name }.to("zucchinis") + + expect(page).to have_content "Showing 16 to 16" # todo: remove unnecessary duplication + expect_page_to_be 2 + expect_per_page_to_be 15 + expect_products_count_to_be 1 + expect(page).to have_css row_containing_name("zucchinis") + end + end end describe "edit image" do @@ -699,7 +756,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do within row_containing_name("Medium box") do page.find(".vertical-ellipsis-menu").click - expect(page).to_not have_link "Clone", href: spree.clone_admin_product_path(product_a) + expect(page).not_to have_link "Clone", href: spree.clone_admin_product_path(product_a) end end end @@ -711,7 +768,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do input_content = page.find_all('input[type=text]').map(&:value).join # Products does not include the cloned product. - expect(input_content).to_not match /COPY OF Apples/ + expect(input_content).not_to match /COPY OF Apples/ end within row_containing_name("Apples") do @@ -741,11 +798,11 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do "tr:has(input[aria-label=Price][value='#{product_a.price}'])" } - before do - visit admin_products_url - end - describe "Actions columns (delete)" do + before do + visit admin_products_url + end + it "shows an actions menu with a delete link when clicking on icon for product. " \ "doesn't show delete link for the single variant" do within product_selector do @@ -757,17 +814,18 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do # to select the default variant within default_variant_selector do page.find(".vertical-ellipsis-menu").click - expect(page).to_not have_css(delete_option_selector) + expect(page).not_to have_css(delete_option_selector) end end - it "shows an actions menu with a delete link when clicking on icon for variant" \ + it "shows an actions menu with a delete link when clicking on icon for variant " \ "if have multiple" do create(:variant, product: product_a, display_name: "Medium box", sku: "APL-01", price: 5.25) + visit admin_products_url # to select the default variant within default_variant_selector do @@ -796,6 +854,8 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do context "when 'keep product/variant' is selected" do it 'should not delete the product/variant' do + visit admin_products_url + # Keep Product within product_selector do page.find(".vertical-ellipsis-menu").click @@ -806,7 +866,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do page.find(keep_button_selector).click end - expect(page).to_not have_selector(modal_selector) + expect(page).not_to have_selector(modal_selector) expect(page).to have_selector(product_selector) # Keep Variant @@ -819,7 +879,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do page.find(keep_button_selector).click end - expect(page).to_not have_selector(modal_selector) + expect(page).not_to have_selector(modal_selector) expect(page).to have_selector(variant_selector) end end @@ -828,6 +888,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do let(:success_flash_message_selector) { "div.flash.success" } let(:error_flash_message_selector) { "div.flash.error" } it 'should successfully delete the product/variant' do + visit admin_products_url # Delete Variant within variant_selector do page.find(".vertical-ellipsis-menu").click @@ -839,10 +900,10 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do page.find(delete_button_selector).click end - expect(page).to_not have_selector(modal_selector) + expect(page).not_to have_selector(modal_selector) # Make sure the products loading spinner is hidden wait_for_class('.spinner-overlay', 'hidden') - expect(page).to_not have_selector(variant_selector) + expect(page).not_to have_selector(variant_selector) within success_flash_message_selector do expect(page).to have_content("Successfully deleted the variant") page.find(dismiss_button_selector).click @@ -857,16 +918,17 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do within modal_selector do page.find(delete_button_selector).click end - expect(page).to_not have_selector(modal_selector) + expect(page).not_to have_selector(modal_selector) # Make sure the products loading spinner is hidden wait_for_class('.spinner-overlay', 'hidden') - expect(page).to_not have_selector(product_selector) + expect(page).not_to have_selector(product_selector) within success_flash_message_selector do expect(page).to have_content("Successfully deleted the product") end end it 'should be failed to delete the product/variant' do + visit admin_products_url allow_any_instance_of(Spree::Product).to receive(:destroy).and_return(false) allow_any_instance_of(Spree::Variant).to receive(:destroy).and_return(false) @@ -881,7 +943,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do page.find(delete_button_selector).click end - expect(page).to_not have_selector(modal_selector) + expect(page).not_to have_selector(modal_selector) sleep(0.5) # delay for loading spinner to complete expect(page).to have_selector(variant_selector) within error_flash_message_selector do @@ -898,7 +960,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do within modal_selector do page.find(delete_button_selector).click end - expect(page).to_not have_selector(modal_selector) + expect(page).not_to have_selector(modal_selector) sleep(0.5) # delay for loading spinner to complete expect(page).to have_selector(product_selector) within error_flash_message_selector do @@ -917,7 +979,7 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do end def expect_page_to_be(page_number) - expect(page).to have_selector ".pagination span.page.current", text: page_number.to_s + expect(page).to have_selector ".pagination .page.current", text: page_number.to_s end def expect_per_page_to_be(per_page) @@ -934,13 +996,12 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do end def search_by_producer(producer) - # TODO: use a helper to more reliably select the tom-select component - select producer, from: "producer_id" + tomselect_select producer, from: "producer_id" click_button "Search" end def search_by_category(category) - select category, from: "category_id" + tomselect_select category, from: "category_id" click_button "Search" end @@ -962,4 +1023,8 @@ describe 'As an admin, I can manage products', feature: :admin_style_v3 do def expect_page_to_have_image(url) expect(page).to have_selector("img[src$='#{url}']") end + + def tax_category_column + @tax_category_column ||= 'td:nth-child(10)' + end end diff --git a/spec/system/admin/reports/enterprise_fee_summaries_spec.rb b/spec/system/admin/reports/enterprise_fee_summaries_spec.rb index 1b8339ba26..5e44a321ab 100644 --- a/spec/system/admin/reports/enterprise_fee_summaries_spec.rb +++ b/spec/system/admin/reports/enterprise_fee_summaries_spec.rb @@ -44,7 +44,7 @@ describe "enterprise fee summaries" do let(:current_user) { create(:user) } it "does not allow access to the report" do - expect(page).to have_no_link('Enterprise Fee Summary') + expect(page).not_to have_link('Enterprise Fee Summary') visit main_app.admin_report_path(report_type: 'enterprise_fee_summary') expect(page).to have_content('Unauthorized') end diff --git a/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_order_spec.rb b/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_order_spec.rb index 5831946361..bd833db5d8 100644 --- a/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_order_spec.rb +++ b/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_order_spec.rb @@ -110,7 +110,7 @@ describe "Enterprise Summary Fee with Tax Report By Order" do # independently of the order_cycle. # order.reload order.recreate_all_fees! - OrderWorkflow.new(order).complete! + Orders::WorkflowService.new(order).complete! order.customer.update!({ first_name: customer_first_name, @@ -188,7 +188,7 @@ describe "Enterprise Summary Fee with Tax Report By Order" do ship_address_id: ship_address.id }) order.recreate_all_fees! - OrderWorkflow.new(order).complete! + Orders::WorkflowService.new(order).complete! order.customer.update!({ first_name: customer_first_name, diff --git a/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_producer_spec.rb b/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_producer_spec.rb index b85a67b156..d31796eea4 100644 --- a/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_producer_spec.rb +++ b/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_producer_spec.rb @@ -532,10 +532,10 @@ describe "Enterprise Summary Fee with Tax Report By Producer" do expect(table).to have_content(cost_of_produce2) expect(table).to have_content(summary_row2) - expect(table).to_not have_content(supplier_state_tax1) - expect(table).to_not have_content(supplier_country_tax1) - expect(table).to_not have_content(cost_of_produce1) - expect(table).to_not have_content(summary_row1) + expect(table).not_to have_content(supplier_state_tax1) + expect(table).not_to have_content(supplier_country_tax1) + expect(table).not_to have_content(cost_of_produce1) + expect(table).not_to have_content(summary_row1) end it "should filter by fee name" do @@ -550,19 +550,19 @@ describe "Enterprise Summary Fee with Tax Report By Producer" do expect(table).to have_content(supplier_state_tax1) expect(table).to have_content(supplier_country_tax1) - expect(table).to_not have_content(distributor_state_tax1) - expect(table).to_not have_content(distributor_country_tax1) - expect(table).to_not have_content(coordinator_state_tax1) - expect(table).to_not have_content(coordinator_country_tax1) + expect(table).not_to have_content(distributor_state_tax1) + expect(table).not_to have_content(distributor_country_tax1) + expect(table).not_to have_content(coordinator_state_tax1) + expect(table).not_to have_content(coordinator_country_tax1) expect(table).to have_content(cost_of_produce1) expect(table).to have_content(summary_row1) expect(table).to have_content(supplier_state_tax3) expect(table).to have_content(supplier_country_tax3) - expect(table).to_not have_content(distributor_state_tax3) - expect(table).to_not have_content(distributor_country_tax3) - expect(table).to_not have_content(coordinator_state_tax3) - expect(table).to_not have_content(coordinator_country_tax3) + expect(table).not_to have_content(distributor_state_tax3) + expect(table).not_to have_content(distributor_country_tax3) + expect(table).not_to have_content(coordinator_state_tax3) + expect(table).not_to have_content(coordinator_country_tax3) expect(table).to have_content(cost_of_produce3) expect(table).to have_content(summary_row3) end @@ -577,10 +577,10 @@ describe "Enterprise Summary Fee with Tax Report By Producer" do table = page.find("table.report__table tbody") expect(table).to have_content(supplier_state_tax1) expect(table).to have_content(supplier_country_tax1) - expect(table).to_not have_content(distributor_state_tax1) - expect(table).to_not have_content(distributor_country_tax1) - expect(table).to_not have_content(coordinator_state_tax1) - expect(table).to_not have_content(coordinator_country_tax1) + expect(table).not_to have_content(distributor_state_tax1) + expect(table).not_to have_content(distributor_country_tax1) + expect(table).not_to have_content(coordinator_state_tax1) + expect(table).not_to have_content(coordinator_country_tax1) expect(table).to have_content(cost_of_produce1) expect(table).to have_content(summary_row_after_filtering_by_fee_owner) end diff --git a/spec/system/admin/reports/sales_tax/sales_tax_totals_by_order_spec.rb b/spec/system/admin/reports/sales_tax/sales_tax_totals_by_order_spec.rb index 7678f59c02..1ff6b557b0 100644 --- a/spec/system/admin/reports/sales_tax/sales_tax_totals_by_order_spec.rb +++ b/spec/system/admin/reports/sales_tax/sales_tax_totals_by_order_spec.rb @@ -100,7 +100,7 @@ describe "Sales Tax Totals By order" do # the enterprise fees can be known only when the user selects the variants # we'll need to create them by calling recreate_all_fees! order.recreate_all_fees! - OrderWorkflow.new(order).complete! + Orders::WorkflowService.new(order).complete! end it "generates the report" do @@ -166,7 +166,7 @@ describe "Sales Tax Totals By order" do it "generates the report" do order.recreate_all_fees! - OrderWorkflow.new(order).complete! + Orders::WorkflowService.new(order).complete! visit_sales_tax_totals_by_order @@ -319,7 +319,7 @@ describe "Sales Tax Totals By order" do before do order.recreate_all_fees! - OrderWorkflow.new(order).complete! + Orders::WorkflowService.new(order).complete! customer2.update!({ first_name: 'c2fname', last_name: 'c2lname', code: 'DEF456' }) order2.line_items.create({ variant:, quantity: 1, price: 200 }) @@ -331,7 +331,7 @@ describe "Sales Tax Totals By order" do email: 'order2@example.com' }) order2.recreate_all_fees! - OrderWorkflow.new(order2).complete! + Orders::WorkflowService.new(order2).complete! visit_sales_tax_totals_by_order end diff --git a/spec/system/admin/reports/sales_tax/sales_tax_totals_by_producer_spec.rb b/spec/system/admin/reports/sales_tax/sales_tax_totals_by_producer_spec.rb index 964537a037..da3244cef5 100644 --- a/spec/system/admin/reports/sales_tax/sales_tax_totals_by_producer_spec.rb +++ b/spec/system/admin/reports/sales_tax/sales_tax_totals_by_producer_spec.rb @@ -3,7 +3,7 @@ require 'system_helper' describe "Sales Tax Totals By Producer" do - # Scenarion 1: added tax + # Scenario 1: added tax # 1 producer # 1 distributor # 1 product that costs 100$ @@ -30,6 +30,7 @@ describe "Sales Tax Totals By Producer" do let!(:state_tax_rate){ create(:tax_rate, zone: state_zone, tax_category:) } let!(:country_tax_rate){ create(:tax_rate, zone: country_zone, tax_category:) } let!(:ship_address){ create(:ship_address) } + let(:another_state){ create(:state, name: 'Another state', country: ship_address.country) } let!(:variant){ create(:variant) } let!(:product){ variant.product } @@ -69,9 +70,7 @@ describe "Sales Tax Totals By Producer" do ship_address_id: ship_address.id }) - while !order.completed? - break unless order.next! - end + Orders::WorkflowService.new(order).complete! end it "generates the report" do @@ -119,6 +118,54 @@ describe "Sales Tax Totals By Producer" do end end + context 'Order not to be shipped in a state affected by state tax rate' do + # Therefore, do not apply both tax rates here, only country one + before do + ship_address.update!({ state_id: another_state.id }) + order.line_items.create({ variant:, quantity: 1, price: 100 }) + order.update!({ + order_cycle_id: order_cycle.id, + ship_address_id: ship_address.id + }) + + Orders::WorkflowService.new(order).complete! + end + + it 'generates the report' do + login_as admin + visit admin_reports_path + click_on 'Sales Tax Totals By Producer' + + run_report + expect(page.find("table.report__table thead tr").text).to have_content(table_header) + + expect(page.find("table.report__table tbody").text).to have_content([ + "Distributor", + "Yes", + "Supplier", + "Yes", + "oc1", + "tax_category", + "Country", + "2.5 %", + "100.0", + "2.5", + "102.5" + ].join(" ")) + + expect(page.find("table.report__table tbody").text).to have_content([ + "TOTAL", + "100.0", + "2.5", + "102.5" + ].join(" ")) + + # Even though 2 tax rates exist (but only one has been applied), we should get only 2 lines: + # one line item + total + expect(page.all("table.report__table tbody tr").count).to eq(2) + end + end + context 'included tax' do before do state_tax_rate.update!({ included_in_price: true }) @@ -130,9 +177,7 @@ describe "Sales Tax Totals By Producer" do ship_address_id: ship_address.id }) - while !order.completed? - break unless order.next! - end + Orders::WorkflowService.new(order).complete! end it "generates the report" do login_as admin @@ -308,9 +353,7 @@ describe "Sales Tax Totals By Producer" do ship_address_id: customer1.bill_address_id, customer_id: customer1.id }) - while !order.completed? - break unless order.next! - end + Orders::WorkflowService.new(order).complete! order2.line_items.create({ variant:, quantity: 1, price: 200 }) order2.update!({ @@ -318,9 +361,7 @@ describe "Sales Tax Totals By Producer" do ship_address_id: customer2.bill_address_id, customer_id: customer2.id }) - while !order2.completed? - break unless order2.next! - end + Orders::WorkflowService.new(order2).complete! login_as admin visit admin_reports_path click_on 'Sales Tax Totals By Producer' diff --git a/spec/system/admin/reports_spec.rb b/spec/system/admin/reports_spec.rb index 33b74e85b2..abe26647c7 100644 --- a/spec/system/admin/reports_spec.rb +++ b/spec/system/admin/reports_spec.rb @@ -122,7 +122,7 @@ describe ' page.has_selector? ".loading" end - expect(page).to have_no_selector ".loading" + expect(page).not_to have_selector ".loading" end end @@ -358,15 +358,15 @@ describe ' let(:taxon) { create(:taxon, name: 'Taxon Name') } let(:product1) { create(:simple_product, name: "Product Name", price: 100, supplier:, - primary_taxon: taxon) + primary_taxon_id: taxon.id) } let(:product2) { create(:simple_product, name: "Product 2", price: 99.0, variant_unit: 'weight', variant_unit_scale: 1, unit_value: '100', supplier:, - primary_taxon: taxon, sku: "product_sku") + primary_taxon_id: taxon.id, sku: "product_sku") } let(:variant1) { product1.variants.first } - let(:variant2) { create(:variant, product: product1, price: 80.0) } + let(:variant2) { create(:variant, product: product1, price: 80.0, primary_taxon: taxon) } let(:variant3) { product2.variants.first } before do @@ -396,17 +396,17 @@ describe ' expect(page).to have_table_row [product1.supplier.name, product1.supplier.address.city, "Product Name", product1.properties.map(&:presentation).join(", "), - product1.primary_taxon.name, "1g", "100.0", + taxon.name, "1g", "100.0", "none", "", "sku1", "No", "10"] expect(page).to have_table_row [product1.supplier.name, product1.supplier.address.city, "Product Name", product1.properties.map(&:presentation).join(", "), - product1.primary_taxon.name, "1g", "80.0", + taxon.name, "1g", "80.0", "none", "", "sku2", "No", "20"] expect(page).to have_table_row [product2.supplier.name, product1.supplier.address.city, "Product 2", product1.properties.map(&:presentation).join(", "), - product2.primary_taxon.name, "100g", "99.0", + taxon.name, "100g", "99.0", "none", "", "product_sku", "No", "9"] end diff --git a/spec/system/admin/schedules_spec.rb b/spec/system/admin/schedules_spec.rb index 8913d9af18..8832f34d66 100644 --- a/spec/system/admin/schedules_spec.rb +++ b/spec/system/admin/schedules_spec.rb @@ -39,13 +39,13 @@ describe 'Schedules' do expect(page).to have_selector '#available-order-cycles .order-cycle', text: oc1.name expect(page).to have_selector '#available-order-cycles .order-cycle', text: oc2.name expect(page).to have_selector '#available-order-cycles .order-cycle', text: oc3.name - expect(page).to have_no_selector '#available-order-cycles .order-cycle', text: oc4.name + expect(page).not_to have_selector '#available-order-cycles .order-cycle', text: oc4.name expect(page).to have_selector '#available-order-cycles .order-cycle', text: oc5.name fill_in 'name', with: "Fortnightly" find("#available-order-cycles .order-cycle", text: oc1.name).click find("#add-remove-buttons a.add").click # Selection of an order cycles limits available options to those with the same coordinator - expect(page).to have_no_selector '#available-order-cycles .order-cycle', text: oc5.name + expect(page).not_to have_selector '#available-order-cycles .order-cycle', text: oc5.name find("#available-order-cycles .order-cycle", text: oc3.name).click find("#add-remove-buttons a.add").click click_button "Create Schedule" @@ -61,7 +61,7 @@ describe 'Schedules' do within ".order-cycle-#{oc2.id} td.schedules" do expect(page).to have_selector "a", text: "Weekly" - expect(page).to have_no_selector "a", text: "Fortnightly" + expect(page).not_to have_selector "a", text: "Fortnightly" end within ".order-cycle-#{oc3.id} td.schedules" do @@ -100,11 +100,11 @@ describe 'Schedules' do within ".order-cycle-#{oc2.id} td.schedules" do expect(page).to have_selector "a", text: "Weekly" - expect(page).to have_no_selector "a", text: "Fortnightly" + expect(page).not_to have_selector "a", text: "Fortnightly" end within ".order-cycle-#{oc3.id} td.schedules" do - expect(page).to have_no_selector "a", text: "Weekly" + expect(page).not_to have_selector "a", text: "Weekly" expect(page).to have_selector "a", text: "Fortnightly" end end @@ -128,15 +128,15 @@ describe 'Schedules' do expect(save_bar).to have_content "Deleted schedule: 'Weekly'" within ".order-cycle-#{oc1.id} td.schedules" do - expect(page).to have_no_selector "a", text: "Weekly" + expect(page).not_to have_selector "a", text: "Weekly" end within ".order-cycle-#{oc2.id} td.schedules" do - expect(page).to have_no_selector "a", text: "Weekly" + expect(page).not_to have_selector "a", text: "Weekly" end within ".order-cycle-#{oc3.id} td.schedules" do - expect(page).to have_no_selector "a", text: "Weekly" + expect(page).not_to have_selector "a", text: "Weekly" end expect(Schedule.find_by(id: weekly_schedule.id)).to be_nil diff --git a/spec/system/admin/shipping_methods_spec.rb b/spec/system/admin/shipping_methods_spec.rb index 6b05c91085..2bcc1f142c 100644 --- a/spec/system/admin/shipping_methods_spec.rb +++ b/spec/system/admin/shipping_methods_spec.rb @@ -35,7 +35,7 @@ describe 'shipping methods' do check "shipping_method_shipping_categories_" click_button 'Create' - expect(page).to have_no_button 'Create' + expect(page).not_to have_button 'Create' # Then the shipping method should have its distributor set expect(flash_message).to include "Carrier Pidgeon", "successfully created!" diff --git a/spec/system/admin/subscriptions/crud_spec.rb b/spec/system/admin/subscriptions/crud_spec.rb index d35a90c4d5..8882defc20 100644 --- a/spec/system/admin/subscriptions/crud_spec.rb +++ b/spec/system/admin/subscriptions/crud_spec.rb @@ -49,8 +49,8 @@ describe 'Subscriptions' do # Loads the right subscriptions expect(page).to have_selector "tr#so_#{subscription2.id}" - expect(page).to have_no_selector "tr#so_#{subscription.id}" - expect(page).to have_no_selector "tr#so_#{subscription_unmanaged.id}" + expect(page).not_to have_selector "tr#so_#{subscription.id}" + expect(page).not_to have_selector "tr#so_#{subscription_unmanaged.id}" within "tr#so_#{subscription2.id}" do expect(page).to have_selector "td.customer", text: subscription2.customer.email end @@ -60,8 +60,8 @@ describe 'Subscriptions' do # Loads the right subscriptions expect(page).to have_selector "tr#so_#{subscription.id}" - expect(page).to have_no_selector "tr#so_#{subscription2.id}" - expect(page).to have_no_selector "tr#so_#{subscription_unmanaged.id}" + expect(page).not_to have_selector "tr#so_#{subscription2.id}" + expect(page).not_to have_selector "tr#so_#{subscription_unmanaged.id}" within "tr#so_#{subscription.id}" do expect(page).to have_selector "td.customer", text: subscription.customer.email end @@ -72,23 +72,23 @@ describe 'Subscriptions' do # Using the Quick Search: no result fill_in 'query', with: 'blah blah blah' - expect(page).to have_no_selector "tr#so_#{subscription.id}" - expect(page).to have_no_selector "tr#so_#{other_subscription.id}" + expect(page).not_to have_selector "tr#so_#{subscription.id}" + expect(page).not_to have_selector "tr#so_#{other_subscription.id}" # Using the Quick Search: filter by email fill_in 'query', with: other_subscription.customer.email expect(page).to have_selector "tr#so_#{other_subscription.id}" - expect(page).to have_no_selector "tr#so_#{subscription.id}" + expect(page).not_to have_selector "tr#so_#{subscription.id}" # Using the Quick Search: filter by first_name fill_in 'query', with: other_subscription.customer.first_name expect(page).to have_selector "tr#so_#{other_subscription.id}" - expect(page).to have_no_selector "tr#so_#{subscription.id}" + expect(page).not_to have_selector "tr#so_#{subscription.id}" # Using the Quick Search: filter by last_name fill_in 'query', with: other_subscription.customer.last_name expect(page).to have_selector "tr#so_#{other_subscription.id}" - expect(page).to have_no_selector "tr#so_#{subscription.id}" + expect(page).not_to have_selector "tr#so_#{subscription.id}" # Using the Quick Search: reset filter fill_in 'query', with: '' @@ -99,8 +99,8 @@ describe 'Subscriptions' do expect(page).to have_selector "th.customer" expect(page).to have_content subscription.customer.email toggle_columns "Customer" - expect(page).to have_no_selector "th.customer" - expect(page).to have_no_content subscription.customer.email + expect(page).not_to have_selector "th.customer" + expect(page).not_to have_content subscription.customer.email # Viewing Products open_subscription_products_panel @@ -124,7 +124,7 @@ describe 'Subscriptions' do proxy_order = subscription.proxy_orders.first within "tr#po_#{proxy_order.id}" do - expect(page).to have_no_content 'CANCELLED' + expect(page).not_to have_content 'CANCELLED' accept_alert 'Are you sure?' do find("a.cancel-order").click end @@ -371,7 +371,7 @@ describe 'Subscriptions' do expect{ click_button('Create Subscription') expect(page).to have_content 'Please add at least one product' - }.to_not change { Subscription.count } + }.not_to change { Subscription.count } end context 'and adding a new product' do diff --git a/spec/system/admin/subscriptions/smoke_tests_spec.rb b/spec/system/admin/subscriptions/smoke_tests_spec.rb index 48a77da579..348721ac33 100644 --- a/spec/system/admin/subscriptions/smoke_tests_spec.rb +++ b/spec/system/admin/subscriptions/smoke_tests_spec.rb @@ -33,7 +33,7 @@ describe 'Subscriptions' do expect(page).to have_content "Just a few more steps before you can begin" # subscriptions are enabled, instructions are not displayed - expect(page).to_not have_content 'Under "Shop Preferences", / + expect(page).not_to have_content 'Under "Shop Preferences", / enable the Subscriptions option' # other relevant instructions are displayed @@ -54,7 +54,7 @@ describe 'Subscriptions' do end it "the subscriptions tab is not visible" do expect(page).to have_current_path "/admin/orders" - expect(page).to_not have_link "Subscriptions", href: "/admin/subscriptions" + expect(page).not_to have_link "Subscriptions", href: "/admin/subscriptions" end end end diff --git a/spec/system/admin/tag_rules_spec.rb b/spec/system/admin/tag_rules_spec.rb index 611dcff1df..72603632a6 100644 --- a/spec/system/admin/tag_rules_spec.rb +++ b/spec/system/admin/tag_rules_spec.rb @@ -16,7 +16,7 @@ describe 'Tag Rules' do it "allows creation of rules of each type" do # Creating a new tag expect(page).to have_content 'No tags apply to this enterprise yet' - expect(page).to have_no_selector '.customer_tag' + expect(page).not_to have_selector '.customer_tag' click_button '+ Add A New Tag' fill_in_tag "volunteer" @@ -271,13 +271,13 @@ describe 'Tag Rules' do first("a.delete-tag-rule").click end end - expect(page).to have_no_selector "#tr_1" + expect(page).not_to have_selector "#tr_1" accept_alert do within "#tr_0" do first("a.delete-tag-rule").click end end - expect(page).to have_no_selector "#tr_0" + expect(page).not_to have_selector "#tr_0" end.to change{ TagRule.count }.by(-2) # After deleting tags, the form is dirty and we need to confirm leaving diff --git a/spec/system/admin/tos_banner_spec.rb b/spec/system/admin/tos_banner_spec.rb index 902d11071f..8fe256558b 100644 --- a/spec/system/admin/tos_banner_spec.rb +++ b/spec/system/admin/tos_banner_spec.rb @@ -26,11 +26,11 @@ describe 'Terms of Service banner' do click_button "Accept Terms of Service" admin_user.reload end.to change { admin_user.terms_of_service_accepted_at } - expect(page).to_not have_content("Terms of Service have been updated") + expect(page).not_to have_content("Terms of Service have been updated") # Check the banner doesn't show again once ToS has been accepted page.refresh - expect(page).to_not have_content("Terms of Service have been updated") + expect(page).not_to have_content("Terms of Service have been updated") end end diff --git a/spec/system/admin/users_spec.rb b/spec/system/admin/users_spec.rb index 5d1e7b0163..5d3a6f9046 100644 --- a/spec/system/admin/users_spec.rb +++ b/spec/system/admin/users_spec.rb @@ -135,7 +135,7 @@ describe "Managing users" do visit spree.new_admin_user_path # shows no confirmation message to start with - expect(page).to have_no_text "Email confirmation is pending" + expect(page).not_to have_text "Email confirmation is pending" fill_in "Email", with: "user1@example.org" fill_in "Password", with: "user1Secret" diff --git a/spec/system/admin/variant_overrides_spec.rb b/spec/system/admin/variant_overrides_spec.rb index 1cf3e7669d..2da4bf705a 100644 --- a/spec/system/admin/variant_overrides_spec.rb +++ b/spec/system/admin/variant_overrides_spec.rb @@ -105,7 +105,7 @@ describe " expect(page).to have_selector "#v_#{variant_related.id}" select2_select producer.name, from: 'producer_filter' expect(page).to have_selector "#v_#{variant.id}" - expect(page).to have_no_selector "#v_#{variant_related.id}" + expect(page).not_to have_selector "#v_#{variant_related.id}" select2_select 'All', from: 'producer_filter' # Filters based on the quick search box @@ -113,7 +113,7 @@ describe " expect(page).to have_selector "#v_#{variant_related.id}" fill_in 'query', with: product.name expect(page).to have_selector "#v_#{variant.id}" - expect(page).to have_no_selector "#v_#{variant_related.id}" + expect(page).not_to have_selector "#v_#{variant_related.id}" fill_in 'query', with: '' # Clears the filters @@ -121,8 +121,8 @@ describe " expect(page).to have_selector "tr#v_#{variant_related.id}" select2_select producer.name, from: 'producer_filter' fill_in 'query', with: product_related.name - expect(page).to have_no_selector "tr#v_#{variant.id}" - expect(page).to have_no_selector "tr#v_#{variant_related.id}" + expect(page).not_to have_selector "tr#v_#{variant.id}" + expect(page).not_to have_selector "tr#v_#{variant_related.id}" click_button 'Clear All' expect(page).to have_selector "tr#v_#{variant.id}" expect(page).to have_selector "tr#v_#{variant_related.id}" @@ -134,17 +134,17 @@ describe " within "tr#v_#{variant.id}" do click_button 'Hide' end - expect(page).to have_no_selector "tr#v_#{variant.id}" + expect(page).not_to have_selector "tr#v_#{variant.id}" expect(page).to have_selector "tr#v_#{variant_related.id}" first("div#views-dropdown").click first("div#views-dropdown div.menu div.menu_item", text: "Hidden Products").click expect(page).to have_selector "tr#v_#{variant.id}" - expect(page).to have_no_selector "tr#v_#{variant_related.id}" + expect(page).not_to have_selector "tr#v_#{variant_related.id}" within "tr#v_#{variant.id}" do click_button 'Add' end - expect(page).to have_no_selector "tr#v_#{variant.id}" - expect(page).to have_no_selector "tr#v_#{variant_related.id}" + expect(page).not_to have_selector "tr#v_#{variant.id}" + expect(page).not_to have_selector "tr#v_#{variant_related.id}" first("div#views-dropdown").click first("div#views-dropdown div.menu div.menu_item", text: "Inventory Products").click expect(page).to have_selector "tr#v_#{variant.id}" @@ -434,7 +434,7 @@ describe " # It does not save the changes. click_button 'Save Changes' expect(page).to have_content 'must be specified because forcing limited stock' - expect(page).to have_no_content 'Changes saved.' + expect(page).not_to have_content 'Changes saved.' vo.reload expect(vo.count_on_hand).to eq(1111) @@ -485,8 +485,8 @@ describe " it "alerts the user to the presence of new products, and allows them to be added " \ "or hidden" do - expect(page).to have_no_selector "table#variant-overrides tr#v_#{variant1.id}" - expect(page).to have_no_selector "table#variant-overrides tr#v_#{variant2.id}" + expect(page).not_to have_selector "table#variant-overrides tr#v_#{variant1.id}" + expect(page).not_to have_selector "table#variant-overrides tr#v_#{variant2.id}" expect(page).to have_selector '.alert-row span.message', text: "There are 1 new products available to add to your " \ @@ -502,17 +502,17 @@ describe " within "table#new-products tr#v_#{variant2.id}" do click_button 'Hide' end - expect(page).to have_no_selector "table#new-products tr#v_#{variant1.id}" - expect(page).to have_no_selector "table#new-products tr#v_#{variant2.id}" + expect(page).not_to have_selector "table#new-products tr#v_#{variant1.id}" + expect(page).not_to have_selector "table#new-products tr#v_#{variant2.id}" click_button "Back to my inventory" expect(page).to have_selector "table#variant-overrides tr#v_#{variant1.id}" - expect(page).to have_no_selector "table#variant-overrides tr#v_#{variant2.id}" + expect(page).not_to have_selector "table#variant-overrides tr#v_#{variant2.id}" first("div#views-dropdown").click first("div#views-dropdown div.menu div.menu_item", text: "Hidden Products").click - expect(page).to have_no_selector "table#hidden-products tr#v_#{variant1.id}" + expect(page).not_to have_selector "table#hidden-products tr#v_#{variant1.id}" expect(page).to have_selector "table#hidden-products tr#v_#{variant2.id}" end end diff --git a/spec/system/admin/variants_spec.rb b/spec/system/admin/variants_spec.rb index 0a7e462d03..754670b542 100644 --- a/spec/system/admin/variants_spec.rb +++ b/spec/system/admin/variants_spec.rb @@ -9,6 +9,8 @@ describe ' include AuthenticationHelper include WebHelper + let!(:taxon) { create(:taxon) } + describe "new variant" do it "creating a new variant" do # Given a product with a unit-related option type @@ -21,6 +23,7 @@ describe ' fill_in 'unit_value_human', with: '1' fill_in 'variant_unit_description', with: 'foo' + select taxon.name, from: "variant_primary_taxon_id" click_button 'Create' # Then the variant should have been created @@ -61,6 +64,7 @@ describe ' # Expect variant_weight to accept 3 decimal places fill_in 'variant_weight', with: '1.234' fill_in 'unit_value_human', with: 1 + select taxon.name, from: "variant_primary_taxon_id" click_button 'Create' # Then the variant should have been created @@ -167,7 +171,7 @@ describe ' login_as_admin visit spree.edit_admin_product_variant_path(product, variant) - expect(page).to_not have_field "unit_value_human" + expect(page).not_to have_field "unit_value_human" expect(page).to have_field "variant_weight" expect(page).to have_field "variant_unit_description", with: "foo" diff --git a/spec/system/consumer/account/cards_spec.rb b/spec/system/consumer/account/cards_spec.rb index e0a6457a66..a4228031b6 100644 --- a/spec/system/consumer/account/cards_spec.rb +++ b/spec/system/consumer/account/cards_spec.rb @@ -53,7 +53,7 @@ describe "Credit Cards" do within(".card#card#{non_default_card.id}") do expect(page).to have_content non_default_card.cc_type.capitalize expect(page).to have_content non_default_card.last_digits - expect(find_field('default_card')).to_not be_checked + expect(find_field('default_card')).not_to be_checked end # Allows switching of default card @@ -73,7 +73,7 @@ describe "Credit Cards" do expect(default_card.reload.is_default).to be false within(".card#card#{default_card.id}") do - expect(find_field('default_card')).to_not be_checked + expect(find_field('default_card')).not_to be_checked end expect(non_default_card.reload.is_default).to be true @@ -90,11 +90,11 @@ describe "Credit Cards" do expect(page).to have_content( format("Your card has been removed (number: %s)", "x-#{default_card.last_digits}") ) - expect(page).to have_no_selector ".card#card#{default_card.id}" + expect(page).not_to have_selector ".card#card#{default_card.id}" # Allows authorisation of card use by shops within "tr#customer#{customer.id}" do - expect(find_field('allow_charges')).to_not be_checked + expect(find_field('allow_charges')).not_to be_checked find_field('allow_charges').click end expect(page).to have_content 'Changes saved.' diff --git a/spec/system/consumer/account/developer_settings_spec.rb b/spec/system/consumer/account/developer_settings_spec.rb index 078ac6c906..704a4a986e 100644 --- a/spec/system/consumer/account/developer_settings_spec.rb +++ b/spec/system/consumer/account/developer_settings_spec.rb @@ -47,7 +47,7 @@ describe "Developer Settings" do click_button I18n.t(:delete) expect(page.document).to have_content I18n.t('webhook_endpoints.destroy.success') - expect(page).to_not have_content "https://url" + expect(page).not_to have_content "https://url" end end end @@ -59,7 +59,7 @@ describe "Developer Settings" do it "does not show the developer settings tab" do within("#account-tabs") do - expect(page).to_not have_selector("a", text: "DEVELOPER SETTINGS") + expect(page).not_to have_selector("a", text: "DEVELOPER SETTINGS") end end end diff --git a/spec/system/consumer/account/payments_spec.rb b/spec/system/consumer/account/payments_spec.rb index 76399a7d29..b88a3932f5 100644 --- a/spec/system/consumer/account/payments_spec.rb +++ b/spec/system/consumer/account/payments_spec.rb @@ -38,7 +38,7 @@ describe "Payments requiring action" do visit "/account" find("a", text: /Transactions/i).click - expect(page).to_not have_content 'Authorisation Required' + expect(page).not_to have_content 'Authorisation Required' end end end diff --git a/spec/system/consumer/account/settings_spec.rb b/spec/system/consumer/account/settings_spec.rb index 2a6e4c2a6d..d20e870db9 100644 --- a/spec/system/consumer/account/settings_spec.rb +++ b/spec/system/consumer/account/settings_spec.rb @@ -47,7 +47,7 @@ Your email address will be updated once the new email is confirmed." % 'new@emai click_button 'Update' expect(find(".alert-box.success").text.strip).to eq "Account updated!\n×" - expect(user.reload.encrypted_password).to_not eq initial_password + expect(user.reload.encrypted_password).not_to eq initial_password end end end diff --git a/spec/system/consumer/account_spec.rb b/spec/system/consumer/account_spec.rb index 9134c9e7d1..d50ced38a0 100644 --- a/spec/system/consumer/account_spec.rb +++ b/spec/system/consumer/account_spec.rb @@ -45,7 +45,7 @@ describe ' visit "/account" # No distributors allow changes to orders - expect(page).to have_no_content 'Open Orders' + expect(page).not_to have_content 'Open Orders' expect(page).to have_content 'Past Orders' diff --git a/spec/system/consumer/caching/darkswarm_caching_spec.rb b/spec/system/consumer/caching/darkswarm_caching_spec.rb index 908a4e2b16..eea29f8cb2 100644 --- a/spec/system/consumer/caching/darkswarm_caching_spec.rb +++ b/spec/system/consumer/caching/darkswarm_caching_spec.rb @@ -35,8 +35,8 @@ describe "Darkswarm data caching", caching: true do visit shops_path - expect(Spree::Taxon).to_not receive(:all) - expect(Spree::Property).to_not receive(:all) + expect(Spree::Taxon).not_to receive(:all) + expect(Spree::Property).not_to receive(:all) visit shops_path end @@ -66,7 +66,7 @@ describe "Darkswarm data caching", caching: true do visit shops_path # Wait for /shops page to load properly before checking for new timestamps - expect(page).to_not have_selector ".row.filter-box" + expect(page).not_to have_selector ".row.filter-box" taxon_timestamp2 = CacheService.latest_timestamp_by_class(Spree::Taxon) expect_cached "views/#{CacheService::FragmentCaching.ams_all_taxons[0]}" @@ -74,8 +74,8 @@ describe "Darkswarm data caching", caching: true do property_timestamp2 = CacheService.latest_timestamp_by_class(Spree::Property) expect_cached "views/#{CacheService::FragmentCaching.ams_all_properties[0]}" - expect(taxon_timestamp1).to_not eq taxon_timestamp2 - expect(property_timestamp1).to_not eq property_timestamp2 + expect(taxon_timestamp1).not_to eq taxon_timestamp2 + expect(property_timestamp1).not_to eq property_timestamp2 toggle_filters diff --git a/spec/system/consumer/caching/shops_caching_spec.rb b/spec/system/consumer/caching/shops_caching_spec.rb index 50ae90160b..b44a8f77bc 100644 --- a/spec/system/consumer/caching/shops_caching_spec.rb +++ b/spec/system/consumer/caching/shops_caching_spec.rb @@ -38,7 +38,7 @@ describe "Shops caching", caching: true do visit shops_path - expect(page).to_not have_content "New Name" # Displayed name is unchanged + expect(page).not_to have_content "New Name" # Displayed name is unchanged end # A while later... @@ -53,8 +53,9 @@ describe "Shops caching", caching: true do let!(:property) { create(:property, presentation: "Cached Property") } let!(:property2) { create(:property, presentation: "New Property") } let!(:product) { - create(:product, primary_taxon: taxon, properties: [property]) + create(:product, primary_taxon_id: taxon.id, properties: [property]) } + let(:variant) { product.variants.first } let(:exchange) { order_cycle.exchanges.to_enterprises(distributor).outgoing.first } let(:test_domain) { @@ -92,7 +93,7 @@ describe "Shops caching", caching: true do expect(page).to have_content taxon.name expect(page).to have_content property.presentation - product.update_attribute(:primary_taxon, taxon2) + variant.update_attribute(:primary_taxon, taxon2) product.update_attribute(:properties, [property2]) visit enterprise_shop_path(distributor) diff --git a/spec/system/consumer/checkout/details_spec.rb b/spec/system/consumer/checkout/details_spec.rb index d44b0cc2ad..6f83576155 100644 --- a/spec/system/consumer/checkout/details_spec.rb +++ b/spec/system/consumer/checkout/details_spec.rb @@ -152,7 +152,7 @@ describe "As a consumer, I want to checkout my order" do before do expect { proceed_to_payment - }.to_not change { + }.not_to change { user.reload.bill_address } end @@ -206,7 +206,7 @@ describe "As a consumer, I want to checkout my order" do before do expect { proceed_to_payment - }.to_not change { + }.not_to change { user.reload.ship_address } end diff --git a/spec/system/consumer/checkout/guest_spec.rb b/spec/system/consumer/checkout/guest_spec.rb index 572213eedd..9b5687ef08 100644 --- a/spec/system/consumer/checkout/guest_spec.rb +++ b/spec/system/consumer/checkout/guest_spec.rb @@ -79,7 +79,7 @@ describe "As a consumer, I want to checkout my order" do it "should display the checkout login page" do expect(page).to have_content("Ok, ready to checkout?") expect(page).to have_content("Login") - expect(page).to have_no_content("Checkout as guest") + expect(page).not_to have_content("Checkout as guest") end it "should show the login modal when clicking the login button" do diff --git a/spec/system/consumer/checkout/summary_spec.rb b/spec/system/consumer/checkout/summary_spec.rb index f36dfa5f22..1b27719717 100644 --- a/spec/system/consumer/checkout/summary_spec.rb +++ b/spec/system/consumer/checkout/summary_spec.rb @@ -131,9 +131,9 @@ describe "As a consumer, I want to checkout my order" do visit checkout_step_path(:summary) within "#checkout" do - expect(page).to_not have_field "order_accept_terms" - expect(page).to_not have_link "Terms and Conditions" - expect(page).to_not have_link "Terms of service" + expect(page).not_to have_field "order_accept_terms" + expect(page).not_to have_link "Terms and Conditions" + expect(page).not_to have_link "Terms of service" end end end @@ -347,7 +347,7 @@ describe "As a consumer, I want to checkout my order" do order.distributor.save visit checkout_step_path(:summary) - expect(page).to_not have_content("You have an order for this order cycle already.") + expect(page).not_to have_content("You have an order for this order cycle already.") end end @@ -393,8 +393,8 @@ describe "As a consumer, I want to checkout my order" do it_behaves_like "order confirmation page", "PAID", "50" do before do - expect(page).to_not have_selector('h5', text: "Credit Owed") - expect(page).to_not have_selector('h5', text: "Balance Due") + expect(page).not_to have_selector('h5', text: "Credit Owed") + expect(page).not_to have_selector('h5', text: "Balance Due") end end end diff --git a/spec/system/consumer/cookies_spec.rb b/spec/system/consumer/cookies_spec.rb index bf0fb1d44d..7685ab1cfa 100644 --- a/spec/system/consumer/cookies_spec.rb +++ b/spec/system/consumer/cookies_spec.rb @@ -64,9 +64,11 @@ describe "Cookies", caching: true do scenario "it is not showing" do Spree::Config[:cookies_consent_banner_toggle] = false visit root_path - expect(page).to have_no_content 'This site uses cookies in order to make your navigation ' \ - 'frictionless and secure, and to help us understand how ' \ - 'you use it in order to improve the features we offer.' + expect(page).not_to have_content( + 'This site uses cookies in order to make your navigation ' \ + 'frictionless and secure, and to help us understand how ' \ + 'you use it in order to improve the features we offer.' + ) end end end @@ -91,8 +93,8 @@ describe "Cookies", caching: true do scenario "does not show Matomo cookies details and does not show Matomo optout text" do Spree::Config[:cookies_policy_matomo_section] = false visit_cookies_policy_page - expect(page).to have_no_content matomo_description_text - expect(page).to have_no_content matomo_opt_out_iframe + expect(page).not_to have_content matomo_description_text + expect(page).not_to have_content matomo_opt_out_iframe end end @@ -120,8 +122,8 @@ describe "Cookies", caching: true do Spree::Config[:cookies_policy_matomo_section] = true Spree::Config[:matomo_url] = "" visit_cookies_policy_page - expect(page).to have_no_content matomo_opt_out_iframe - expect(page).to have_no_selector("iframe") + expect(page).not_to have_content matomo_opt_out_iframe + expect(page).not_to have_selector("iframe") end end end @@ -136,7 +138,7 @@ describe "Cookies", caching: true do end def expect_not_visible_cookies_banner - expect(page).to have_no_css("button", text: accept_cookies_button_text) + expect(page).not_to have_css("button", text: accept_cookies_button_text) end def accept_cookies_button_text diff --git a/spec/system/consumer/footer_links_spec.rb b/spec/system/consumer/footer_links_spec.rb index bc052a615a..af61a4bba9 100644 --- a/spec/system/consumer/footer_links_spec.rb +++ b/spec/system/consumer/footer_links_spec.rb @@ -44,7 +44,7 @@ describe "Footer Links" do it "not showing if it is empty" do Spree::Config[:privacy_policy_url] = nil visit root_path - expect(page).to have_no_link "privacy policy" + expect(page).not_to have_link "privacy policy" end it "showing configured privacy policy link" do diff --git a/spec/system/consumer/groups_spec.rb b/spec/system/consumer/groups_spec.rb index 289a6256f8..93734d88db 100644 --- a/spec/system/consumer/groups_spec.rb +++ b/spec/system/consumer/groups_spec.rb @@ -110,10 +110,10 @@ describe 'Groups' do it "adjusts visibilities of enterprises depending on their status" do expect(page).to have_css('hub', text: d1.name) - expect(page).to_not have_css('hub.inactive', text: d1.name) + expect(page).not_to have_css('hub.inactive', text: d1.name) expect(page).to have_css('hub', text: d2.name) - expect(page).to_not have_css('hub.inactive', text: d2.name) - expect(page).to_not have_text d3.name + expect(page).not_to have_css('hub.inactive', text: d2.name) + expect(page).not_to have_text d3.name expect(page).to have_css('hub.inactive', text: d4.name) end diff --git a/spec/system/consumer/multilingual_spec.rb b/spec/system/consumer/multilingual_spec.rb index 1020d81601..48edc6e685 100644 --- a/spec/system/consumer/multilingual_spec.rb +++ b/spec/system/consumer/multilingual_spec.rb @@ -102,7 +102,7 @@ describe 'Multilingual' do it "hides the dropdown language menu" do visit root_path - expect(page).to have_no_css 'ul.right li.language-switcher.has-dropdown' + expect(page).not_to have_css 'ul.right li.language-switcher.has-dropdown' end end diff --git a/spec/system/consumer/registration_spec.rb b/spec/system/consumer/registration_spec.rb index f2081bbb14..e95c69812a 100644 --- a/spec/system/consumer/registration_spec.rb +++ b/spec/system/consumer/registration_spec.rb @@ -101,8 +101,8 @@ describe "Registration" do # Images # Upload logo image attach_file "image-select", Rails.root.join("spec/fixtures/files/logo.png"), visible: false - expect(page).to have_no_css('#image-placeholder .loading') - expect(page.find('#image-placeholder img')['src']).to_not be_empty + expect(page).not_to have_css('#image-placeholder .loading') + expect(page.find('#image-placeholder img')['src']).not_to be_empty # Move from logo page click_button "Continue" @@ -110,8 +110,8 @@ describe "Registration" do # Upload promo image attach_file "image-select", Rails.root.join("spec/fixtures/files/promo.png"), visible: false - expect(page).to have_no_css('#image-placeholder .loading') - expect(page.find('#image-placeholder img')['src']).to_not be_empty + expect(page).not_to have_css('#image-placeholder .loading') + expect(page.find('#image-placeholder img')['src']).not_to be_empty # Move from promo page click_button "Continue" @@ -255,7 +255,7 @@ describe "Registration" do expect(page).to have_selector "input.button.primary[disabled]" check "accept_terms" - expect(page).to have_no_selector "input.button.primary[disabled]" + expect(page).not_to have_selector "input.button.primary[disabled]" click_button "Let's get started!" expect(find("div#progress-bar")).to be_visible diff --git a/spec/system/consumer/shopping/cart_spec.rb b/spec/system/consumer/shopping/cart_spec.rb index 1b6b6d13a5..3cd4150e2a 100644 --- a/spec/system/consumer/shopping/cart_spec.rb +++ b/spec/system/consumer/shopping/cart_spec.rb @@ -49,9 +49,9 @@ describe "full-page cart" do click_link "Continue shopping" - expect(page).to have_no_link "Continue shopping" + expect(page).not_to have_link "Continue shopping" expect(page).to have_link "Shop" - expect(page).to have_no_content distributor.preferred_shopfront_message + expect(page).not_to have_content distributor.preferred_shopfront_message end end @@ -59,7 +59,7 @@ describe "full-page cart" do it "does not link to the product page" do add_product_to_cart order, product_with_fee, quantity: 2 visit main_app.cart_path - expect(page).to have_no_selector '.item-thumb-image a' + expect(page).not_to have_selector '.item-thumb-image a' end end @@ -132,7 +132,7 @@ describe "full-page cart" do it "hides admin and handlings row" do expect(page).to have_selector('#cart-detail') - expect(page).to have_no_content('Admin & Handling') + expect(page).not_to have_content('Admin & Handling') expect(page).to have_selector '.cart-item-price', text: with_currency(0.86) expect(page).to have_selector '.order-total.grand-total', text: with_currency(1.72) # price * 3 @@ -246,13 +246,13 @@ describe "full-page cart" do # Quantity field clearly marked as invalid and "Update" button is not highlighted expect(page).to have_selector "#order_line_items_attributes_0_quantity.ng-invalid-stock" - expect(page).to_not have_selector "#update-button.alert" + expect(page).not_to have_selector "#update-button.alert" fill_in "order_line_items_attributes_0_quantity", with: 4 # Quantity field not marked as invalid and "Update" button is # highlighted after correction - expect(page).to_not have_selector( + expect(page).not_to have_selector( "#order_line_items_attributes_0_quantity.ng-invalid-stock" ) expect(page).to have_selector "#update-button.alert" @@ -260,8 +260,8 @@ describe "full-page cart" do click_button 'Update' # "Continue Shopping" and "Checkout" buttons are not disabled after cart is updated - expect(page).to_not have_selector "a.continue-shopping[disabled=disabled]" - expect(page).to_not have_selector "a#checkout-link[disabled=disabled]" + expect(page).not_to have_selector "a.continue-shopping[disabled=disabled]" + expect(page).not_to have_selector "a#checkout-link[disabled=disabled]" end end end @@ -293,8 +293,8 @@ describe "full-page cart" do item1 = prev_order1.line_items.first item2 = prev_order2.line_items.first - expect(page).to have_no_content item1.variant.name - expect(page).to have_no_content item2.variant.name + expect(page).not_to have_content item1.variant.name + expect(page).not_to have_content item2.variant.name expect(page).to have_link 'Edit confirmed items', href: spree.account_path find("td.toggle-bought").click @@ -302,13 +302,13 @@ describe "full-page cart" do expect(page).to have_content item1.variant.name expect(page).to have_content item2.variant.name page.find(".line-item-#{item1.id} td.bought-item-delete a").click - expect(page).to have_no_content item1.variant.name + expect(page).not_to have_content item1.variant.name expect(page).to have_content item2.variant.name visit main_app.cart_path find("td.toggle-bought").click - expect(page).to have_no_content item1.variant.name + expect(page).not_to have_content item1.variant.name expect(page).to have_content item2.variant.name end @@ -318,7 +318,7 @@ describe "full-page cart" do end it "doesn't throw an error" do - expect{ visit main_app.cart_path }.to_not raise_error + expect{ visit main_app.cart_path }.not_to raise_error end end end diff --git a/spec/system/consumer/shopping/checkout_auth_spec.rb b/spec/system/consumer/shopping/checkout_auth_spec.rb index 088eb85e73..0b12d7ff0d 100644 --- a/spec/system/consumer/shopping/checkout_auth_spec.rb +++ b/spec/system/consumer/shopping/checkout_auth_spec.rb @@ -34,7 +34,7 @@ describe "As a consumer I want to check out my cart" do login_as user visit checkout_path within "section[role='main']" do - expect(page).to have_no_content "Login" + expect(page).not_to have_content "Login" expect(page).to have_checkout_details end end diff --git a/spec/system/consumer/shopping/checkout_spec.rb b/spec/system/consumer/shopping/checkout_spec.rb index b897468232..8c12d8c91c 100644 --- a/spec/system/consumer/shopping/checkout_spec.rb +++ b/spec/system/consumer/shopping/checkout_spec.rb @@ -148,13 +148,13 @@ describe "As a consumer I want to check out my cart" do end it "shows only applicable content" do - expect(page).to have_no_content("You have an order for this order cycle already.") + expect(page).not_to have_content("You have an order for this order cycle already.") - expect(page).to have_no_link("Terms and Conditions") + expect(page).not_to have_link("Terms and Conditions") # We always have this link in the footer. within "#checkout_form" do - expect(page).to have_no_link("Terms of service") + expect(page).not_to have_link("Terms of service") end end end diff --git a/spec/system/consumer/shopping/embedded_groups_spec.rb b/spec/system/consumer/shopping/embedded_groups_spec.rb index 4b3db6ea9c..f157b2cd69 100644 --- a/spec/system/consumer/shopping/embedded_groups_spec.rb +++ b/spec/system/consumer/shopping/embedded_groups_spec.rb @@ -49,8 +49,8 @@ describe "Using embedded shopfront functionality" do it "doesn't display contact details when embedded" do on_embedded_page do within 'div#group-page' do - expect(page).to have_no_selector 'div.contact-container' - expect(page).to have_no_content group.address.address1.to_s + expect(page).not_to have_selector 'div.contact-container' + expect(page).not_to have_content group.address.address1.to_s end end end @@ -58,9 +58,9 @@ describe "Using embedded shopfront functionality" do it "does not display the header when embedded" do on_embedded_page do within 'div#group-page' do - expect(page).to have_no_selector 'header' - expect(page).to have_no_selector 'img.group-logo' - expect(page).to have_no_selector 'h2.group-name' + expect(page).not_to have_selector 'header' + expect(page).not_to have_selector 'img.group-logo' + expect(page).not_to have_selector 'h2.group-name' end end end diff --git a/spec/system/consumer/shopping/orders_spec.rb b/spec/system/consumer/shopping/orders_spec.rb index 3dca930692..0aaf4e4cc7 100644 --- a/spec/system/consumer/shopping/orders_spec.rb +++ b/spec/system/consumer/shopping/orders_spec.rb @@ -44,7 +44,7 @@ describe "Order Management" do it "allows the user to see the details" do # Cannot load the page without token visit order_path(order) - expect(page).to_not be_confirmed_order_page + expect(page).not_to be_confirmed_order_page # Can load the page with token visit order_path(order, order_token: order.token) @@ -87,7 +87,7 @@ describe "Order Management" do it "allows the user to see order details after login" do # Cannot load the page without signing in visit order_path(order) - expect(page).to_not be_confirmed_order_page + expect(page).not_to be_confirmed_order_page # Can load the page after signing in fill_in_and_submit_login_form user @@ -142,7 +142,7 @@ describe "Order Management" do expect(find("tr.variant-#{item1.variant.id}")).to have_content item1.product.name expect(find("tr.variant-#{item2.variant.id}")).to have_content item2.product.name expect(find("tr.variant-#{item3.variant.id}")).to have_content item3.product.name - expect(page).to have_no_button 'Save Changes' + expect(page).not_to have_button 'Save Changes' end end @@ -155,7 +155,7 @@ describe "Order Management" do visit order_path(order) expect(page).to have_button 'Order Saved', disabled: true - expect(page).to have_no_button 'Save Changes' + expect(page).not_to have_button 'Save Changes' # Changing the quantity of an item within "tr.variant-#{item1.variant.id}" do diff --git a/spec/system/consumer/shopping/shopping_spec.rb b/spec/system/consumer/shopping/shopping_spec.rb index 1be05bc9b6..9694059eb1 100644 --- a/spec/system/consumer/shopping/shopping_spec.rb +++ b/spec/system/consumer/shopping/shopping_spec.rb @@ -11,7 +11,7 @@ describe "As a consumer I want to shop with a distributor" do describe "Viewing a distributor" do let(:distributor) { create(:distributor_enterprise, with_payment_and_shipping: true) } - let(:supplier) { create(:supplier_enterprise) } + let(:supplier) { create(:supplier_enterprise, name: 'The small mammals company') } let(:oc1) { create(:simple_order_cycle, distributors: [distributor], coordinator: create(:distributor_enterprise), @@ -62,7 +62,7 @@ describe "As a consumer I want to shop with a distributor" do (all_tabs - tabs).each do |tab| it "does not show the #{tab} tab" do within ".tab-buttons" do - expect(page).to_not have_content tab + expect(page).not_to have_content tab end end end @@ -132,8 +132,8 @@ describe "As a consumer I want to shop with a distributor" do end it "does not show the producer modal" do - expect(page).to_not have_link supplier.name - expect(page).to_not have_selector ".reveal-modal" + expect(page).not_to have_link supplier.name + expect(page).not_to have_selector ".reveal-modal" end end end @@ -291,9 +291,12 @@ describe "As a consumer I want to shop with a distributor" do describe "after selecting an order cycle with products visible" do let(:variant1) { create(:variant, product:, price: 20) } - let(:variant2) { create(:variant, product:, price: 30, display_name: "Badgers") } + let(:variant2) do + create(:variant, product:, price: 30, display_name: "Badgers", + display_as: 'displayedunderthename') + end let(:product2) { - create(:simple_product, supplier:, name: "Meercats", meta_keywords: "Wild") + create(:simple_product, supplier:, name: "Meercats", meta_keywords: "Wild Fresh") } let(:variant3) { create(:variant, product: product2, price: 40, display_name: "Ferrets") } let(:exchange) { Exchange.find(oc1.exchanges.to_enterprises(distributor).outgoing.first.id) } @@ -330,24 +333,45 @@ describe "As a consumer I want to shop with a distributor" do end context "filtering search results" do - it "returns no results and clears searches by clicking the clear-link" do + before do visit shop_path sleep(2) + end + it "returns results when successful" do fill_in "search", with: "74576345634XXXXXX" expect(page).to have_content "Sorry, no results found" - expect(page).not_to have_content product2.name + expect(page).not_to have_content 'Meercats' click_on "Clear search" # clears search by clicking text expect(page).to have_content("Add", count: 4) - end - it "returns results and clears searches by clicking the clear-button" do - visit shop_path - sleep(2) fill_in "search", with: "Meer" # For product named "Meercats" - expect(page).to have_content product2.name + expect(page).to have_content 'Meercats' expect(page).not_to have_content product.name find("a.clear").click # clears search by clicking the X button expect(page).to have_content("Add", count: 4) end + it "returns results by looking at different columns in DB" do + # by keyword model: meta_keywords + fill_in "search", with: "Wild" # For product named "Meercats" + expect(page).to have_content 'Wild' + find("a.clear").click + # by variant display name model: variant display_name + fill_in "search", with: "Ferrets" # For variants named "Ferrets" + within('div.pad-top') do + expect(page).to have_content 'Ferrets' + expect(page).not_to have_content 'Badgers' + end + # model: variant display_as + fill_in "search", with: "displayedunder" # "Badgers" + within('div.pad-top') do + expect(page).not_to have_content 'Ferrets' + expect(page).to have_content 'Badgers' + end + # model: Enterprise name + fill_in "search", with: "Enterp" # Enterprise 1 sells nothing + within('p.no-results') do + expect(page).to have_content "Sorry, no results found for Enterp" + end + end end context "when supplier uses property" do @@ -531,7 +555,7 @@ describe "As a consumer I want to shop with a distributor" do # Update amount in cart within_variant(variant) do expect(page).to have_button "Add", disabled: true - expect(page).to have_no_content "in cart" + expect(page).not_to have_content "in cart" end within_variant(variant2) do expect(page).to have_button "Add", disabled: false @@ -549,7 +573,7 @@ describe "As a consumer I want to shop with a distributor" do click_add_to_cart variant - expect(page).to_not have_selector '.out-of-stock-modal' + expect(page).not_to have_selector '.out-of-stock-modal' end context "group buy products" do @@ -578,7 +602,7 @@ describe "As a consumer I want to shop with a distributor" do # Update amount in cart within_variant(variant) do expect(page).to have_button "Add", disabled: true - expect(page).to have_no_content "in cart" + expect(page).not_to have_content "in cart" end # Update amount available in product list @@ -703,7 +727,7 @@ describe "As a consumer I want to shop with a distributor" do visit shop_path expect(page).to have_content "Only approved customers can access this shop." expect(page).to have_content "login to proceed" - expect(page).to have_no_content product.name + expect(page).not_to have_content product.name expect(page).not_to have_selector "ordercycle" end end @@ -721,7 +745,7 @@ describe "As a consumer I want to shop with a distributor" do visit shop_path expect(page).to have_content "Only approved customers can access this shop." expect(page).to have_content "please contact #{distributor.name}" - expect(page).to have_no_content product.name + expect(page).not_to have_content product.name expect(page).not_to have_selector "ordercycle" end end @@ -773,7 +797,7 @@ describe "As a consumer I want to shop with a distributor" do end def shows_products_without_customer_warning - expect(page).to have_no_content "This shop is for customers only." + expect(page).not_to have_content "This shop is for customers only." expect(page).to have_content product.name end @@ -789,7 +813,7 @@ describe "As a consumer I want to shop with a distributor" do expect(page).to have_selector "#variant-#{variant.id}.out-of-stock" within_variant(variant) do expect(page).to have_button "Add", disabled: true - expect(page).to have_no_content "in cart" + expect(page).not_to have_content "in cart" end end end diff --git a/spec/system/consumer/shopping/unit_price_spec.rb b/spec/system/consumer/shopping/unit_price_spec.rb index ff881cf073..de195c1159 100644 --- a/spec/system/consumer/shopping/unit_price_spec.rb +++ b/spec/system/consumer/shopping/unit_price_spec.rb @@ -48,9 +48,9 @@ describe "As a consumer, I want to check unit price information for a product" d page.find("body").click expect(page).not_to have_selector '.joyride-tip-guide.question-mark-tooltip' - expect(page).to have_no_content('This is the unit price of this product. ' \ - 'It allows you to compare the price of products ' \ - 'independent of packaging sizes & weights.') + expect(page).not_to have_content('This is the unit price of this product. ' \ + 'It allows you to compare the price of products ' \ + 'independent of packaging sizes & weights.') end end @@ -72,9 +72,9 @@ describe "As a consumer, I want to check unit price information for a product" d end page.find("body").click expect(page).not_to have_selector '.joyride-tip-guide.question-mark-tooltip' - expect(page).to have_no_content('This is the unit price of this product. ' \ - 'It allows you to compare the price of products ' \ - 'independent of packaging sizes & weights.') + expect(page).not_to have_content('This is the unit price of this product. ' \ + 'It allows you to compare the price of products ' \ + 'independent of packaging sizes & weights.') end end end diff --git a/spec/system/consumer/shops_spec.rb b/spec/system/consumer/shops_spec.rb index c67e5969fe..02fccfd130 100644 --- a/spec/system/consumer/shops_spec.rb +++ b/spec/system/consumer/shops_spec.rb @@ -74,8 +74,8 @@ describe 'Shops' do end it "does not show hubs that are not in an order cycle" do - expect(page).to have_no_selector 'hub.inactive' - expect(page).to have_no_selector 'hub', text: d2.name + expect(page).not_to have_selector 'hub.inactive' + expect(page).not_to have_selector 'hub', text: d2.name end it "does not show profiles" do @@ -246,7 +246,7 @@ describe 'Shops' do it "does not show the producer modal" do open_enterprise_modal producer - expect(page).to_not have_selector(".reveal-modal") + expect(page).not_to have_selector(".reveal-modal") end end end diff --git a/spec/system/consumer/user_password_spec.rb b/spec/system/consumer/user_password_spec.rb index 0f07a53eab..a744aac85c 100644 --- a/spec/system/consumer/user_password_spec.rb +++ b/spec/system/consumer/user_password_spec.rb @@ -25,7 +25,7 @@ describe "User password confirm/reset page" do fill_in "Password Confirmation", with: "my secret" click_button - expect(page).to have_no_text "Reset password token has expired" + expect(page).not_to have_text "Reset password token has expired" expect(page).to be_logged_in_as user end @@ -40,7 +40,7 @@ describe "User password confirm/reset page" do click_button expect(page).to have_text "User password cannot be blank. Please enter a password." - expect(page).to_not be_logged_in_as user + expect(page).not_to be_logged_in_as user end end diff --git a/spec/system/consumer/white_label_spec.rb b/spec/system/consumer/white_label_spec.rb index 1956872ecc..6fe7645ec6 100644 --- a/spec/system/consumer/white_label_spec.rb +++ b/spec/system/consumer/white_label_spec.rb @@ -115,7 +115,7 @@ describe 'White label setting' do end it "hides the OFN navigation" do - expect(page).to have_no_selector ofn_navigation + expect(page).not_to have_selector ofn_navigation end it_behaves_like "hides the OFN navigation for mobile view as well" @@ -153,7 +153,7 @@ describe 'White label setting' do end it "hides the OFN navigation" do - expect(page).to have_no_selector ofn_navigation + expect(page).not_to have_selector ofn_navigation end it_behaves_like "hides the OFN navigation for mobile view as well" @@ -167,7 +167,7 @@ describe 'White label setting' do it "hides the OFN navigation" do expect(page).to have_content "Checkout now" expect(page).to have_content "Order ready for " - expect(page).to have_no_selector ofn_navigation + expect(page).not_to have_selector ofn_navigation end it_behaves_like "hides the OFN navigation for mobile view as well" @@ -186,7 +186,7 @@ describe 'White label setting' do end it "hides the OFN navigation" do - expect(page).to have_no_selector ofn_navigation + expect(page).not_to have_selector ofn_navigation end end end @@ -247,7 +247,7 @@ describe 'White label setting' do it "hides the groups tab" do visit main_app.enterprise_shop_path(distributor) - expect(page).to have_no_selector "a[href='#groups']" + expect(page).not_to have_selector "a[href='#groups']" end end @@ -381,7 +381,7 @@ describe 'White label setting' do shared_examples "shows the right link on the logo" do it "shows the white label logo link" do within ".nav-logo .ofn-logo" do - expect(page).to_not have_selector "a[href='/']" + expect(page).not_to have_selector "a[href='/']" expect(page).to have_selector "a[href*='https://www.example.com']" end end diff --git a/spec/validators/date_time_string_validator_spec.rb b/spec/validators/date_time_string_validator_spec.rb index 5476b0f6a0..a4b5d7a468 100644 --- a/spec/validators/date_time_string_validator_spec.rb +++ b/spec/validators/date_time_string_validator_spec.rb @@ -3,14 +3,6 @@ require "spec_helper" describe DateTimeStringValidator do - class TestModel - include ActiveModel::Validations - - attr_accessor :timestamp - - validates :timestamp, date_time_string: true - end - describe "internationalization" do it "has translation for NOT_STRING_ERROR" do expect(described_class.not_string_error).not_to be_blank @@ -22,7 +14,14 @@ describe DateTimeStringValidator do end describe "validation" do - let(:instance) { TestModel.new } + let(:instance) do + Class.new do + include ActiveModel::Validations + attr_accessor :timestamp + + validates :timestamp, date_time_string: true + end.new + end it "does not add error when nil" do instance.timestamp = nil diff --git a/spec/validators/integer_array_validator_spec.rb b/spec/validators/integer_array_validator_spec.rb index 0fbb08fd20..0643d02806 100644 --- a/spec/validators/integer_array_validator_spec.rb +++ b/spec/validators/integer_array_validator_spec.rb @@ -3,14 +3,6 @@ require "spec_helper" describe IntegerArrayValidator do - class TestModel - include ActiveModel::Validations - - attr_accessor :ids - - validates :ids, integer_array: true - end - describe "internationalization" do it "has translation for NOT_ARRAY_ERROR" do expect(described_class.not_array_error).not_to be_blank @@ -22,7 +14,14 @@ describe IntegerArrayValidator do end describe "validation" do - let(:instance) { TestModel.new } + let(:instance) do + Class.new do + include ActiveModel::Validations + attr_accessor :ids + + validates :ids, integer_array: true + end.new + end it "does not add error when nil" do instance.ids = nil diff --git a/spec/views/admin/products_v3/_filters.html.haml_spec.rb b/spec/views/admin/products_v3/_filters.html.haml_spec.rb index fa2943502a..b9ae7725c2 100644 --- a/spec/views/admin/products_v3/_filters.html.haml_spec.rb +++ b/spec/views/admin/products_v3/_filters.html.haml_spec.rb @@ -38,7 +38,7 @@ describe "admin/products_v3/_filters.html.haml" do ], ) - is_expected.to have_no_content "Producers" - is_expected.to have_no_select "producer_id" + is_expected.not_to have_content "Producers" + is_expected.not_to have_select "producer_id" end end diff --git a/spec/views/checkout/_voucher_section.html.haml_spec.rb b/spec/views/checkout/_voucher_section.html.haml_spec.rb index 90683f7c57..36aa3e0776 100644 --- a/spec/views/checkout/_voucher_section.html.haml_spec.rb +++ b/spec/views/checkout/_voucher_section.html.haml_spec.rb @@ -40,7 +40,7 @@ describe "checkout/_voucher_section.html.haml" do assign(:order, order) render - expect(rendered).to_not have_content(note) + expect(rendered).not_to have_content(note) end def add_voucher(voucher, order) diff --git a/spec/views/spree/admin/orders/edit.html.haml_spec.rb b/spec/views/spree/admin/orders/edit.html.haml_spec.rb index c1417cf7b2..9376b9188e 100644 --- a/spec/views/spree/admin/orders/edit.html.haml_spec.rb +++ b/spec/views/spree/admin/orders/edit.html.haml_spec.rb @@ -54,8 +54,8 @@ describe "spree/admin/orders/edit.html.haml" do it "doesn't display a table of out of stock line items" do render - expect(rendered).to_not have_content "Out of Stock" - expect(rendered).to_not have_selector ".insufficient-stock-items", + expect(rendered).not_to have_content "Out of Stock" + expect(rendered).not_to have_selector ".insufficient-stock-items", text: out_of_stock_line_item.variant.display_name end end @@ -63,7 +63,7 @@ describe "spree/admin/orders/edit.html.haml" do it "doesn't display closed associated adjustments" do render - expect(rendered).to_not have_content "Associated adjustment closed" + expect(rendered).not_to have_content "Associated adjustment closed" end end @@ -96,14 +96,14 @@ describe "spree/admin/orders/edit.html.haml" do it "doesn't display a table of out of stock line items" do render - expect(rendered).to_not have_content "Out of Stock" + expect(rendered).not_to have_content "Out of Stock" end end it "doesn't display closed associated adjustments" do render - expect(rendered).to_not have_content "Associated adjustment closed" + expect(rendered).not_to have_content "Associated adjustment closed" end end end diff --git a/spec/views/spree/admin/orders/index.html.haml_spec.rb b/spec/views/spree/admin/orders/index.html.haml_spec.rb index eac6b8d5a8..04641e5159 100644 --- a/spec/views/spree/admin/orders/index.html.haml_spec.rb +++ b/spec/views/spree/admin/orders/index.html.haml_spec.rb @@ -38,7 +38,7 @@ describe "spree/admin/orders/index.html.haml" do render - expect(rendered).to_not have_content("Print Invoices") + expect(rendered).not_to have_content("Print Invoices") expect(rendered).to have_content("Resend Confirmation") expect(rendered).to have_content("Cancel Orders") end diff --git a/spec/views/spree/admin/orders/invoice.html.haml_spec.rb b/spec/views/spree/admin/orders/invoice.html.haml_spec.rb index f0aebd480e..c76950e869 100644 --- a/spec/views/spree/admin/orders/invoice.html.haml_spec.rb +++ b/spec/views/spree/admin/orders/invoice.html.haml_spec.rb @@ -82,7 +82,7 @@ describe "spree/admin/orders/invoice.html.haml" do render expect(rendered).to have_content "Shipping: Pickup" - expect(rendered).to_not have_content adas_address_display + expect(rendered).not_to have_content adas_address_display end it "displays order note on invoice when note is given" do diff --git a/swagger/dfc.yaml b/swagger/dfc.yaml index 9ba35ae272..a96c33c2e7 100644 --- a/swagger/dfc.yaml +++ b/swagger/dfc.yaml @@ -64,6 +64,8 @@ paths: dfc-b:hasPostalCode: '20170' dfc-b:hasCity: Herndon dfc-b:hasCountry: Australia + dfc-b:latitude: 0.0 + dfc-b:longitude: 0.0 dfc-b:region: Victoria '404': description: not found @@ -92,10 +94,12 @@ paths: "@graph": - "@id": http://test.host/api/dfc/persons/12345 "@type": dfc-b:Person + dfc-b:logo: '' dfc-b:affiliates: http://test.host/api/dfc/enterprises/10000 - "@id": http://test.host/api/dfc/enterprises/10000 "@type": dfc-b:Enterprise dfc-b:hasAddress: http://test.host/api/dfc/addresses/40000 + dfc-b:logo: '' dfc-b:name: Fred's Farm dfc-b:hasDescription: Beautiful dfc-b:manages: http://test.host/api/dfc/enterprises/10000/catalog_items/10001 @@ -111,7 +115,6 @@ paths: "@type": dfc-b:SuppliedProduct dfc-b:name: Apple - 1g dfc-b:description: Red - dfc-b:hasType: dfc-pt:non-local-vegetable dfc-b:hasQuantity: "@type": dfc-b:QuantitativeValue dfc-b:hasUnit: dfc-m:Gram @@ -121,6 +124,7 @@ paths: dfc-b:usageOrStorageCondition: '' dfc-b:totalTheoreticalStock: 0.0 ofn:spree_product_id: 90000 + ofn:spree_product_uri: http://test.host/api/dfc/enterprises/10000?spree_product_id=90000 - "@id": http://test.host/api/dfc/enterprises/10000/offers/10001 "@type": dfc-b:Offer dfc-b:hasPrice: 19.99 @@ -299,9 +303,11 @@ paths: "@graph": - "@id": http://test.host/api/dfc/persons/12345 "@type": dfc-b:Person + dfc-b:logo: '' dfc-b:affiliates: http://test.host/api/dfc/enterprise_groups/60000 - "@id": http://test.host/api/dfc/enterprise_groups/60000 "@type": dfc-b:Enterprise + dfc-b:logo: '' dfc-b:name: Sustainable Farmers dfc-b:hasDescription: this is a group dfc-b:VATnumber: '' @@ -330,6 +336,7 @@ paths: - "@id": http://test.host/api/dfc/enterprise_groups/60000 "@type": dfc-b:Enterprise dfc-b:hasAddress: http://test.host/api/dfc/addresses/40000 + dfc-b:logo: '' dfc-b:name: Sustainable Farmers dfc-b:hasDescription: this is a group dfc-b:VATnumber: '' @@ -340,6 +347,8 @@ paths: dfc-b:hasPostalCode: '20170' dfc-b:hasCity: Herndon dfc-b:hasCountry: Australia + dfc-b:latitude: 0.0 + dfc-b:longitude: 0.0 dfc-b:region: Victoria "/api/dfc/enterprises/{id}": get: @@ -369,6 +378,7 @@ paths: dfc-b:email: hello@example.org dfc-b:websitePage: openfoodnetwork.org dfc-b:hasSocialMedia: http://test.host/api/dfc/enterprises/10000/social_medias/facebook + dfc-b:logo: '' dfc-b:name: Fred's Farm dfc-b:hasDescription: This is an awesome enterprise dfc-b:VATnumber: 123 456 @@ -376,8 +386,8 @@ paths: dfc-b:supplies: http://test.host/api/dfc/enterprises/10000/supplied_products/10001 ofn:long_description: "

Hello, world!

This is a paragraph.

" ofn:contact_name: Fred Farmer - ofn:logo_url: http://www.example.com/rails/active_storage/url/logo.png - ofn:promo_image_url: http://www.example.com/rails/active_storage/url/promo.png + ofn:logo_url: http://test.host/rails/active_storage/url/logo.png + ofn:promo_image_url: http://test.host/rails/active_storage/url/promo.png dfc-b:affiliates: http://test.host/api/dfc/enterprise_groups/60000 - "@id": http://test.host/api/dfc/addresses/40000 "@type": dfc-b:Address @@ -385,12 +395,13 @@ paths: dfc-b:hasPostalCode: '20170' dfc-b:hasCity: Herndon dfc-b:hasCountry: Australia + dfc-b:latitude: 0.0 + dfc-b:longitude: 0.0 dfc-b:region: Victoria - "@id": http://test.host/api/dfc/enterprises/10000/supplied_products/10001 "@type": dfc-b:SuppliedProduct dfc-b:name: Apple - 1g dfc-b:description: Round - dfc-b:hasType: dfc-pt:non-local-vegetable dfc-b:hasQuantity: "@type": dfc-b:QuantitativeValue dfc-b:hasUnit: dfc-m:Gram @@ -400,6 +411,7 @@ paths: dfc-b:usageOrStorageCondition: '' dfc-b:totalTheoreticalStock: 0.0 ofn:spree_product_id: 90000 + ofn:spree_product_uri: http://test.host/api/dfc/enterprises/10000?spree_product_id=90000 ofn:image: http://test.host/rails/active_storage/url/logo-white.png - "@id": http://test.host/api/dfc/enterprises/10000/catalog_items/10001 "@type": dfc-b:CatalogItem @@ -482,6 +494,7 @@ paths: "@context": https://www.datafoodconsortium.org "@id": http://test.host/api/dfc/persons/10000 "@type": dfc-b:Person + dfc-b:logo: '' '404': description: not found "/api/dfc/enterprises/{enterprise_id}/social_medias/{name}": @@ -540,7 +553,7 @@ paths: "@context": https://www.datafoodconsortium.org "@id": http://test.host/api/dfc/enterprises/10000/supplied_products/10001 "@type": dfc-b:SuppliedProduct - dfc-b:name: Apple (6g) + dfc-b:name: Pesto - Apple (6g) dfc-b:description: A delicious heritage apple dfc-b:hasType: dfc-pt:non-local-vegetable dfc-b:hasQuantity: @@ -552,6 +565,8 @@ paths: dfc-b:usageOrStorageCondition: '' dfc-b:totalTheoreticalStock: 0.0 ofn:spree_product_id: 90000 + ofn:spree_product_uri: http://test.host/api/dfc/enterprises/10000?spree_product_id=90000 + ofn:image: http://test.host/rails/active_storage/url/logo-white.png requestBody: content: application/json: @@ -572,6 +587,7 @@ paths: dfc-b:usageOrStorageCondition: '' dfc-b:totalTheoreticalStock: 0.0 ofn:spree_product_id: 90000 + ofn:spree_product_uri: http://test.host/api/dfc/enterprises/10000?spree_product_id=90000 "/api/dfc/enterprises/{enterprise_id}/supplied_products/{id}": parameters: - name: enterprise_id @@ -611,6 +627,7 @@ paths: dfc-b:usageOrStorageCondition: '' dfc-b:totalTheoreticalStock: 0.0 ofn:spree_product_id: 90000 + ofn:spree_product_uri: http://test.host/api/dfc/enterprises/10000?spree_product_id=90000 ofn:image: http://test.host/rails/active_storage/url/logo-white.png '404': description: not found diff --git a/yarn.lock b/yarn.lock index ff946847a1..d84ee5e204 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1122,10 +1122,10 @@ resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.2.2.tgz#071aab59c600fed95b97939e605ff261a4251608" integrity sha512-eGeIqNOQpXoPAIP7tC1+1Yc1yl1xnwYqg+3mzqxyrbE5pg5YFBZcA6YoTiByJB6DKAEsiWtl6tjTJS4IYtbB7A== -"@hotwired/turbo@^8.0.3": - version "8.0.3" - resolved "https://registry.yarnpkg.com/@hotwired/turbo/-/turbo-8.0.3.tgz#338e07278f4b3c76921328d3c92dbc4831c209d0" - integrity sha512-qLgp7d6JaegKjMToTJahosrFxV3odfSbiekispQ3soOzE5jnU+iEMWlRvYRe/jvy5Q+JWoywtf9j3RD4ikVjIg== +"@hotwired/turbo@^8.0.4": + version "8.0.4" + resolved "https://registry.yarnpkg.com/@hotwired/turbo/-/turbo-8.0.4.tgz#5c5361c06a37cdf10dcba4223f1afd0ca1c75091" + integrity sha512-mlZEFUZrJnpfj+g/XeCWWuokvQyN68WvM78JM+0jfSFc98wegm259vCbC1zSllcspRwbgXK31ibehCy5PA78/Q== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" @@ -1450,6 +1450,11 @@ resolved "https://registry.yarnpkg.com/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz#96116f2a912e0c02817345b3c10751069920d553" integrity sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg== +"@stimulus-components/rails-nested-form@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@stimulus-components/rails-nested-form/-/rails-nested-form-5.0.0.tgz#b443ad8ba5220328cfd704ca956ebf95ab8c4848" + integrity sha512-qrmmurT+KBPrz9iBlyrgJa6Di8i0j328kSk2SUR53nK5W0kDhw1YxVC91aUR+7EsFKiwJT1iB7oDSwpDhDQPeA== + "@tootallnate/once@1": version "1.1.2" resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" @@ -2217,7 +2222,25 @@ bn.js@^5.2.1: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== -body-parser@1.20.1, body-parser@^1.19.0: +body-parser@1.20.2: + version "1.20.2" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.2.tgz#6feb0e21c4724d06de7ff38da36dad4f57a747fd" + integrity sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA== + dependencies: + bytes "3.1.2" + content-type "~1.0.5" + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + http-errors "2.0.0" + iconv-lite "0.4.24" + on-finished "2.4.1" + qs "6.11.0" + raw-body "2.5.2" + type-is "~1.6.18" + unpipe "1.0.0" + +body-parser@^1.19.0: version "1.20.1" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== @@ -2421,10 +2444,10 @@ bytes@3.1.2: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== -cable_ready@5.0.2, cable_ready@^5.0.0: - version "5.0.2" - resolved "https://registry.yarnpkg.com/cable_ready/-/cable_ready-5.0.2.tgz#9042bddce487c25710492d9d4b27f01ce0f8f90e" - integrity sha512-2NUDYACXZuLmnw9q32lGwRQqJaAGU+X/XTLS9lQHojw19l4Py7F2HyeJD6nZ1Rucv96oSlrVQr5kAL/jOB+CpQ== +cable_ready@5.0.1, cable_ready@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/cable_ready/-/cable_ready-5.0.1.tgz#1cef5991cf7a064d09971ed7d87c614dec2ee1e1" + integrity sha512-+t9rKTgYwW5XBx113y97qC8MNEtBZZL84Isdec23HWvjMx0icOQsMzHJE75ycjevgjACTeWZqjRcCdtCHxgZ9g== dependencies: morphdom "2.6.1" @@ -2855,6 +2878,11 @@ content-type@~1.0.4: resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== +content-type@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" + integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== + convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0: version "1.8.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" @@ -2867,10 +2895,10 @@ cookie-signature@1.0.6: resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== -cookie@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" - integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== +cookie@0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051" + integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw== cookie@~0.4.1: version "0.4.1" @@ -3813,16 +3841,16 @@ expect@^27.5.1: jest-message-util "^27.5.1" express@^4.17.1: - version "4.18.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" - integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== + version "4.19.2" + resolved "https://registry.yarnpkg.com/express/-/express-4.19.2.tgz#e25437827a3aa7f2a827bc8171bbbb664a356465" + integrity sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q== dependencies: accepts "~1.3.8" array-flatten "1.1.1" - body-parser "1.20.1" + body-parser "1.20.2" content-disposition "0.5.4" content-type "~1.0.4" - cookie "0.5.0" + cookie "0.6.0" cookie-signature "1.0.6" debug "2.6.9" depd "2.0.0" @@ -4048,9 +4076,9 @@ flush-write-stream@^1.0.0: readable-stream "^2.3.6" follow-redirects@^1.0.0: - version "1.15.4" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.4.tgz#cdc7d308bf6493126b17ea2191ea0ccf3e535adf" - integrity sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw== + version "1.15.6" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" + integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== for-in@^1.0.2: version "1.0.2" @@ -6030,6 +6058,11 @@ minipass@^3.0.0, minipass@^3.1.1: dependencies: yallist "^4.0.0" +minipass@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" + integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== + minizlib@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" @@ -7564,6 +7597,16 @@ raw-body@2.5.1: iconv-lite "0.4.24" unpipe "1.0.0" +raw-body@2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== + dependencies: + bytes "3.1.2" + http-errors "2.0.0" + iconv-lite "0.4.24" + unpipe "1.0.0" + react-is@^17.0.1: version "17.0.2" resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" @@ -8322,10 +8365,6 @@ stimulus-flatpickr@^1.4.0: resolved "https://registry.yarnpkg.com/stimulus-flatpickr/-/stimulus-flatpickr-1.4.0.tgz#a41071a3e69cfc50b7eaaacf356fc0ab1ab0543c" integrity sha512-rcC/c9+E+f5W2kOjaaLShtf3i+p95ACqt+oGzSAgeuZh2YeIN8gW4EWO7h0STBLzSVPl6BjIfPWP7upMPavIVQ== -"stimulus-rails-nested-form@https://github.com/openfoodfoundation/stimulus-rails-nested-form.git#dist": - version "4.1.0" - resolved "https://github.com/openfoodfoundation/stimulus-rails-nested-form.git#d3b82ea638a7156f1122736cf739ab1821a1817e" - stimulus@^3.2.2: version "3.2.2" resolved "https://registry.yarnpkg.com/stimulus/-/stimulus-3.2.2.tgz#a2e955f43e12e2e5784b175d4df5517ef678aa68" @@ -8574,13 +8613,13 @@ tapable@^1.0.0, tapable@^1.1.3: integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA== tar@^6.0.2: - version "6.1.11" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621" - integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== + version "6.2.1" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a" + integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A== dependencies: chownr "^2.0.0" fs-minipass "^2.0.0" - minipass "^3.0.0" + minipass "^5.0.0" minizlib "^2.1.1" mkdirp "^1.0.3" yallist "^4.0.0" @@ -8764,10 +8803,10 @@ tr46@^2.1.0: dependencies: punycode "^2.1.1" -trix@^2.0.10: - version "2.0.10" - resolved "https://registry.yarnpkg.com/trix/-/trix-2.0.10.tgz#43f1ff7a94c42f708bd2bad3a2783147c0583698" - integrity sha512-a24w8rNVL+g9nDDdiDZwQVQ9AEWiXAmk9r0ZbwimczJi/xlaM+m0d6upAi0vysDNu0HsiYDFS1/VrR7HbX0Aig== +trix@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/trix/-/trix-2.1.0.tgz#da9daddded6ee0cb2ba5676246bb343e1d45eaab" + integrity sha512-TPhgGvIjM1VqcfoR/OQQERRlMDuEw7UBIoGroJGuiTmu5yqk5KqR29ZzPgGIoOJgsqoAgxGUCK92+CRJLoO43Q== ts-pnp@^1.1.6: version "1.2.0"