diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md index e9d9864496..8d4f82b4a6 100644 --- a/.github/ISSUE_TEMPLATE/release.md +++ b/.github/ISSUE_TEMPLATE/release.md @@ -10,21 +10,11 @@ assignees: '' ## 1. Preparation on Thursday - [ ] Merge pull requests in the [Ready To Go] column -- [ ] Include translations -
Command line instructions: -
-    
-    git checkout master
-    git pull upstream master
-    tx pull --force
-    git commit -a -m "Update all locales with the latest Transifex translations"
-    git push upstream master
-    
-    
-
-- [ ] Create a tag: - - `script/tag_release` will auto increment patch version, otherwise - - `git push upstream HEAD:refs/tags/vX.Y.Z` +- [ ] Include translations: `script/release/udpate_locales` +- [ ] Increment version number: `git push upstream HEAD:refs/tags/vX.Y.Z` + - Major: if server changes are required (eg. provision with ofn-install) + - Minor: larger change that is irreversible (eg. migration deleting data) + - Patch: all others. Shortcut: `script/release/tag` - [ ] [Draft new release]. Look at previous [releases] for inspiration. - Select new release tag - _Generate release notes_ and check to ensure all items are arranged in the right category. diff --git a/app/assets/javascripts/admin/spree/orders/variant_autocomplete.js.erb b/app/assets/javascripts/admin/spree/orders/variant_autocomplete.js.erb index a8a96ec36b..001055417e 100644 --- a/app/assets/javascripts/admin/spree/orders/variant_autocomplete.js.erb +++ b/app/assets/javascripts/admin/spree/orders/variant_autocomplete.js.erb @@ -50,11 +50,11 @@ $(document).ready(function() { if (quantity > maxQuantity) { quantity = maxQuantity; save.parents('tr').find('input.line_item_quantity').val(maxQuantity); - ofnAlert(t("js.admin.orders.quantity_adjusted")); + ofnAlert(t("js.admin.orders.quantity_unavailable")); + } else { + adjustItems(shipment_number, variant_id, quantity, true); } - toggleItemEdit(); - adjustItems(shipment_number, variant_id, quantity, true); return false; } $('a.save-item').click(handle_save_click); diff --git a/app/views/shared/_google_maps_js.html.haml b/app/views/shared/_google_maps_js.html.haml index 515c0220a5..73202ada9f 100644 --- a/app/views/shared/_google_maps_js.html.haml +++ b/app/views/shared/_google_maps_js.html.haml @@ -1,2 +1,2 @@ - if !ContentConfig.open_street_map_enabled - %script{src: "https://maps.googleapis.com/maps/api/js?libraries=places,geometry#{ ENV['GOOGLE_MAPS_API_KEY'] ? '&key=' + ENV['GOOGLE_MAPS_API_KEY'] : ''}#{ ENV['GOOGLE_MAPS_REGION'] ? '®ion=' + ENV['GOOGLE_MAPS_REGION'] : ''} "} + %script{src: "https://maps.googleapis.com/maps/api/js?libraries=places,geometry#{ ENV['GOOGLE_MAPS_API_KEY'].present? ? '&key=' + ENV['GOOGLE_MAPS_API_KEY'] : ''}#{ ENV['GOOGLE_MAPS_REGION'].present? ? '®ion=' + ENV['GOOGLE_MAPS_REGION'] : ''} "} diff --git a/config/locales/en.yml b/config/locales/en.yml index 5a3aca8796..4186de07b9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3441,7 +3441,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using processing: "processing" void: "void" invalid: "invalid" - quantity_adjusted: "Insufficient stock available. Line item updated to maximum available quantity." + 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" diff --git a/script/release/prepare b/script/release/prepare new file mode 100755 index 0000000000..64eb366a17 --- /dev/null +++ b/script/release/prepare @@ -0,0 +1,13 @@ +#!/bin/sh + +# Execute preparation tasks for a regular patch release. Requires admin permission on the repo. +# +set -e + +# todo: ask to confirm, and remind to check the ready to go column. + +# Download translations and push to master +$(dirname "$0")/update_locales + +# Bump the patch version and push the tag +$(dirname "$0")/tag diff --git a/script/tag_release b/script/release/tag similarity index 84% rename from script/tag_release rename to script/release/tag index 718397ef27..1cdeb103d9 100755 --- a/script/tag_release +++ b/script/release/tag @@ -5,6 +5,8 @@ # This supports only patch releases at the moment but can be developed # further. +puts "\n*** Fetching latest release tag... ***\n" + # Fetch current tags first: `git fetch upstream --tags` @@ -18,7 +20,10 @@ latest_version = Gem::Version.new(latest_tag[1..-1]) major, minor, patch = latest_version.segments next_tag = "v#{major}.#{minor}.#{patch.succ}" +# Push the new tag +puts "\n*** Pushing new release tag #{next_tag}... ***\n" puts `git push upstream 'HEAD:refs/tags/#{next_tag}'` +# Shortcuts puts "Draft a new release with this tag: https://github.com/openfoodfoundation/openfoodnetwork/releases/new?tag=#{next_tag}&title=#{next_tag}+Code+Name" diff --git a/script/release/update_locales b/script/release/update_locales new file mode 100755 index 0000000000..186ea1c262 --- /dev/null +++ b/script/release/update_locales @@ -0,0 +1,23 @@ +#!/bin/sh + +# Download and commit the latest Transifex translations +# + +# Exit on error or uncommitted changes +# TODO: check that master matches upstream/master +set -e +if [ ! -z "$(git status --porcelain)" ]; then + echo "Aborted: git working directory is not clean." + exit 1 +fi + +echo "\n*** Checking out latest master... ***\n" +git checkout master +git pull upstream master + +echo "\n*** Downloading latest Transifex translations... ***\n" +tx pull --force +git commit -a -m "Update all locales with the latest Transifex translations" + +echo "\n*** Pushing to master... ***\n" +git push upstream master diff --git a/script/test-stripe-live b/script/test-stripe-live new file mode 100755 index 0000000000..530bd8c5ad --- /dev/null +++ b/script/test-stripe-live @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +# +# Test Stripe API integration and record new cassettes. + +git rm spec/fixtures/vcr_cassettes/Stripe-v* -r +./bin/rspec --tag stripe_version diff --git a/spec/base_spec_helper.rb b/spec/base_spec_helper.rb index 99aa4cf361..aecfe9c5fa 100644 --- a/spec/base_spec_helper.rb +++ b/spec/base_spec_helper.rb @@ -131,6 +131,21 @@ RSpec.configure do |config| end end + # Appends Stripe gem version to VCR cassette directory with ':stripe_version' flag + # + # When the Stripe gem is updated, we should re-record these cassettes: + # + # ./script/test-stripe-live + # + config.around(:each, :stripe_version) do |example| + stripe_version = "Stripe-v#{Stripe::VERSION}" + VCR.configure do |vcr_config| + vcr_config.cassette_library_dir = "spec/fixtures/vcr_cassettes/#{stripe_version}" + vcr_config.default_cassette_options = { record: :none } if ENV["CI"] + end + example.run + end + # Geocoding config.before(:each) { allow_any_instance_of(Spree::Address).to receive(:geocode).and_return([1, 1]) diff --git a/spec/controllers/spree/credit_cards_controller_spec.rb b/spec/controllers/spree/credit_cards_controller_spec.rb index ac996fd1a1..e41beb724d 100644 --- a/spec/controllers/spree/credit_cards_controller_spec.rb +++ b/spec/controllers/spree/credit_cards_controller_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Spree::CreditCardsController, type: :controller do - describe "using VCR", :vcr do + describe "using VCR", :vcr, :stripe_version do let(:user) { create(:user) } let(:secret) { ENV.fetch('STRIPE_SECRET_TEST_API_KEY', nil) } diff --git a/spec/fixtures/vcr_cassettes/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-v10.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 53% rename from spec/fixtures/vcr_cassettes/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-v10.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 7e2bba6ffd..5878deea2e 100644 --- a/spec/fixtures/vcr_cassettes/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-v10.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,16 +8,18 @@ http_interactions: string: card[number]=4242424242424242&card[exp_month]=9&card[exp_year]=2024&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/7.1.0 + - Stripe/v1 RubyBindings/10.1.0 Authorization: - Bearer Content-Type: - application/x-www-form-urlencoded + Stripe-Version: + - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"7.1.0","lang":"ruby","lang_version":"3.0.3 p157 (2021-11-24)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-48-generic (buildd@lcy02-amd64-080) (gcc (Ubuntu 11.2.0-19ubuntu1) - 11.2.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #54-Ubuntu SMP Fri Aug 26 13:26:29 - UTC 2022","hostname":"ff-LAT"}' + - '{"bindings_version":"10.1.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 6.1.0-12-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) + 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian + 6.1.52-1 (2023-09-07)","hostname":"blackbox"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -30,45 +32,54 @@ http_interactions: Server: - nginx Date: - - Tue, 27 Sep 2022 06:15:03 GMT + - Wed, 08 Nov 2023 21:53:49 GMT Content-Type: - application/json Content-Length: - - '781' + - '800' Connection: - keep-alive Access-Control-Allow-Credentials: - 'true' Access-Control-Allow-Methods: - - GET, POST, HEAD, OPTIONS, DELETE + - GET,HEAD,PUT,PATCH,POST,DELETE Access-Control-Allow-Origin: - "*" Access-Control-Expose-Headers: - - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + - 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%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' Idempotency-Key: - - 8a2c6373-a053-4674-8f35-5e5b8d9cf8fb + - c4d99b66-fe74-488e-958e-69eca92c35be Original-Request: - - req_4XXW0nwQlmbWiH + - req_1hXs9SUU8IKjKg Request-Id: - - req_4XXW0nwQlmbWiH + - req_1hXs9SUU8IKjKg Stripe-Should-Retry: - 'false' Stripe-Version: - - '2019-11-05' + - '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": "tok_1LmX4NKuuB1fWySnNTd7lIuK", + "id": "tok_1OAJh2KuuB1fWySnFuyE55Xo", "object": "token", "card": { - "id": "card_1LmX4MKuuB1fWySn6nKumo1M", + "id": "card_1OAJh2KuuB1fWySn1bi0QzS0", "object": "card", "address_city": null, "address_country": null, @@ -89,35 +100,38 @@ http_interactions: "last4": "4242", "metadata": {}, "name": null, - "tokenization_method": null + "tokenization_method": null, + "wallet": null }, - "client_ip": "188.251.215.147", - "created": 1664259303, + "client_ip": "220.253.195.13", + "created": 1699480428, "livemode": false, "type": "card", "used": false } - recorded_at: Tue, 27 Sep 2022 06:15:03 GMT + recorded_at: Wed, 08 Nov 2023 21:53:49 GMT - request: method: post uri: https://api.stripe.com/v1/customers body: encoding: UTF-8 - string: email=emerita_stroman%40gusikowski.ca&source=tok_1LmX4NKuuB1fWySnNTd7lIuK + string: email=german_jerde%40kubschmeler.ca&source=tok_1OAJh2KuuB1fWySnFuyE55Xo headers: User-Agent: - - Stripe/v1 RubyBindings/7.1.0 + - Stripe/v1 RubyBindings/10.1.0 Authorization: - Bearer Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_4XXW0nwQlmbWiH","request_duration_ms":725}}' + - '{"last_request_metrics":{"request_id":"req_1hXs9SUU8IKjKg","request_duration_ms":747}}' + Stripe-Version: + - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"7.1.0","lang":"ruby","lang_version":"3.0.3 p157 (2021-11-24)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-48-generic (buildd@lcy02-amd64-080) (gcc (Ubuntu 11.2.0-19ubuntu1) - 11.2.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #54-Ubuntu SMP Fri Aug 26 13:26:29 - UTC 2022","hostname":"ff-LAT"}' + - '{"bindings_version":"10.1.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 6.1.0-12-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) + 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian + 6.1.52-1 (2023-09-07)","hostname":"blackbox"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -130,54 +144,62 @@ http_interactions: Server: - nginx Date: - - Tue, 27 Sep 2022 06:15:04 GMT + - Wed, 08 Nov 2023 21:53:50 GMT Content-Type: - application/json Content-Length: - - '1964' + - '666' Connection: - keep-alive Access-Control-Allow-Credentials: - 'true' Access-Control-Allow-Methods: - - GET, POST, HEAD, OPTIONS, DELETE + - GET,HEAD,PUT,PATCH,POST,DELETE Access-Control-Allow-Origin: - "*" Access-Control-Expose-Headers: - - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + - 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: - - a9c15df5-51a9-4aa3-9a98-89346ac4220f + - e8aa29da-1d01-48db-9ba0-db2df6d51a04 Original-Request: - - req_Bv2J8ejL6FSWwT + - req_pdc1GBlN0NvenY Request-Id: - - req_Bv2J8ejL6FSWwT + - req_pdc1GBlN0NvenY Stripe-Should-Retry: - 'false' Stripe-Version: - - '2019-11-05' + - '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_MVYAeGp44F6wS3", + "id": "cus_OyGDSPQMHTtArJ", "object": "customer", "address": null, "balance": 0, - "created": 1664259304, + "created": 1699480429, "currency": null, - "default_currency": null, - "default_source": "card_1LmX4MKuuB1fWySn6nKumo1M", + "default_source": "card_1OAJh2KuuB1fWySn1bi0QzS0", "delinquent": false, "description": null, "discount": null, - "email": "emerita_stroman@gusikowski.ca", - "invoice_prefix": "D81408D1", + "email": "german_jerde@kubschmeler.ca", + "invoice_prefix": "EE42E7FD", "invoice_settings": { "custom_fields": null, "default_payment_method": null, @@ -191,79 +213,32 @@ http_interactions: "phone": null, "preferred_locales": [], "shipping": null, - "sources": { - "object": "list", - "data": [ - { - "id": "card_1LmX4MKuuB1fWySn6nKumo1M", - "object": "card", - "address_city": null, - "address_country": null, - "address_line1": null, - "address_line1_check": null, - "address_line2": null, - "address_state": null, - "address_zip": null, - "address_zip_check": null, - "brand": "Visa", - "country": "US", - "customer": "cus_MVYAeGp44F6wS3", - "cvc_check": "pass", - "dynamic_last4": null, - "exp_month": 9, - "exp_year": 2024, - "fingerprint": "6E6tgVjx6U65iHFV", - "funding": "credit", - "last4": "4242", - "metadata": {}, - "name": null, - "tokenization_method": null - } - ], - "has_more": false, - "total_count": 1, - "url": "/v1/customers/cus_MVYAeGp44F6wS3/sources" - }, - "subscriptions": { - "object": "list", - "data": [], - "has_more": false, - "total_count": 0, - "url": "/v1/customers/cus_MVYAeGp44F6wS3/subscriptions" - }, "tax_exempt": "none", - "tax_ids": { - "object": "list", - "data": [], - "has_more": false, - "total_count": 0, - "url": "/v1/customers/cus_MVYAeGp44F6wS3/tax_ids" - }, - "tax_info": null, - "tax_info_verification": null, "test_clock": null } - recorded_at: Tue, 27 Sep 2022 06:15:04 GMT + recorded_at: Wed, 08 Nov 2023 21:53:50 GMT - request: method: get - uri: https://api.stripe.com/v1/customers/cus_MVYAeGp44F6wS3/sources?limit=1&object=card + uri: https://api.stripe.com/v1/customers/cus_OyGDSPQMHTtArJ/sources?limit=1&object=card body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/7.1.0 + - Stripe/v1 RubyBindings/10.1.0 Authorization: - Bearer Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_Bv2J8ejL6FSWwT","request_duration_ms":1037}}' + - '{"last_request_metrics":{"request_id":"req_pdc1GBlN0NvenY","request_duration_ms":1084}}' + Stripe-Version: + - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"7.1.0","lang":"ruby","lang_version":"3.0.3 p157 (2021-11-24)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 5.15.0-48-generic (buildd@lcy02-amd64-080) (gcc (Ubuntu 11.2.0-19ubuntu1) - 11.2.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #54-Ubuntu SMP Fri Aug 26 13:26:29 - UTC 2022","hostname":"ff-LAT"}' + - '{"bindings_version":"10.1.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 6.1.0-12-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) + 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian + 6.1.52-1 (2023-09-07)","hostname":"blackbox"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -276,29 +251,39 @@ http_interactions: Server: - nginx Date: - - Tue, 27 Sep 2022 06:15:05 GMT + - Wed, 08 Nov 2023 21:53:50 GMT Content-Type: - application/json Content-Length: - - '790' + - '812' Connection: - keep-alive Access-Control-Allow-Credentials: - 'true' Access-Control-Allow-Methods: - - GET, POST, HEAD, OPTIONS, DELETE + - GET,HEAD,PUT,PATCH,POST,DELETE Access-Control-Allow-Origin: - "*" Access-Control-Expose-Headers: - - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + - 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%2Fsources; + block-all-mixed-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_4NyryTpY3ov7vf + - req_TC9pbExmRgIvbf Stripe-Version: - - '2019-11-05' + - '2023-10-16' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode Strict-Transport-Security: - max-age=63072000; includeSubDomains; preload body: @@ -308,7 +293,7 @@ http_interactions: "object": "list", "data": [ { - "id": "card_1LmX4MKuuB1fWySn6nKumo1M", + "id": "card_1OAJh2KuuB1fWySn1bi0QzS0", "object": "card", "address_city": null, "address_country": null, @@ -320,7 +305,7 @@ http_interactions: "address_zip_check": null, "brand": "Visa", "country": "US", - "customer": "cus_MVYAeGp44F6wS3", + "customer": "cus_OyGDSPQMHTtArJ", "cvc_check": "pass", "dynamic_last4": null, "exp_month": 9, @@ -330,11 +315,12 @@ http_interactions: "last4": "4242", "metadata": {}, "name": null, - "tokenization_method": null + "tokenization_method": null, + "wallet": null } ], "has_more": false, - "url": "/v1/customers/cus_MVYAeGp44F6wS3/sources" + "url": "/v1/customers/cus_OyGDSPQMHTtArJ/sources" } - recorded_at: Tue, 27 Sep 2022 06:15:05 GMT -recorded_with: VCR 6.1.0 + recorded_at: Wed, 08 Nov 2023 21:53:50 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe_PaymentIntentValidator/_call/when_payment_intent_contains_an_error/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml b/spec/fixtures/vcr_cassettes/Stripe-v10.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_contains_an_error/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml similarity index 81% rename from spec/fixtures/vcr_cassettes/Stripe_PaymentIntentValidator/_call/when_payment_intent_contains_an_error/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml rename to spec/fixtures/vcr_cassettes/Stripe-v10.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_contains_an_error/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml index 8b436f5f9d..b077322100 100644 --- a/spec/fixtures/vcr_cassettes/Stripe_PaymentIntentValidator/_call/when_payment_intent_contains_an_error/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v10.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_contains_an_error/raises_Stripe_error_with_payment_intent_last_payment_error_as_message.yml @@ -8,20 +8,20 @@ http_interactions: string: type=card&card[number]=4000000000009995&card[exp_month]=12&card[exp_year]=2034&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.0.0 + - Stripe/v1 RubyBindings/10.1.0 Authorization: - Bearer Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_MhJwK3bCx1nUCV","request_duration_ms":399}}' + - '{"last_request_metrics":{"request_id":"req_lDPJ62zgG8A9FL","request_duration_ms":372}}' Stripe-Version: - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.0.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 6.2.0-35-generic (buildd@bos03-amd64-016) (x86_64-linux-gnu-gcc-11 - (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) - #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 6 10:23:26 UTC 2","hostname":"ff-LAT"}' + - '{"bindings_version":"10.1.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 6.1.0-12-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) + 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian + 6.1.52-1 (2023-09-07)","hostname":"blackbox"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,7 +34,7 @@ http_interactions: Server: - nginx Date: - - Tue, 31 Oct 2023 19:02:51 GMT + - Wed, 08 Nov 2023 21:53:53 GMT Content-Type: - application/json Content-Length: @@ -54,16 +54,16 @@ http_interactions: - '300' Cache-Control: - no-cache, no-store - Content-Security-Policy-Report-Only: + 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: - - cae4cabe-d698-4d9a-a559-c7adee3b5919 + - 75a4ebeb-6038-4dad-b537-211f6f71b7f1 Original-Request: - - req_4u0uONl4HDoqTP + - req_CXWU1cVDbwleGf Request-Id: - - req_4u0uONl4HDoqTP + - req_CXWU1cVDbwleGf Stripe-Should-Retry: - 'false' Stripe-Version: @@ -78,7 +78,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1O7NDDKuuB1fWySnK7zLU5xt", + "id": "pm_1OAJh7KuuB1fWySnzX7O7p6v", "object": "payment_method", "billing_details": { "address": { @@ -118,35 +118,35 @@ http_interactions: }, "wallet": null }, - "created": 1698778971, + "created": 1699480433, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Tue, 31 Oct 2023 19:02:51 GMT + recorded_at: Wed, 08 Nov 2023 21:53: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_1O7NDDKuuB1fWySnK7zLU5xt&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1OAJh7KuuB1fWySnzX7O7p6v&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.0.0 + - Stripe/v1 RubyBindings/10.1.0 Authorization: - Bearer Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_4u0uONl4HDoqTP","request_duration_ms":467}}' + - '{"last_request_metrics":{"request_id":"req_CXWU1cVDbwleGf","request_duration_ms":504}}' Stripe-Version: - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.0.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 6.2.0-35-generic (buildd@bos03-amd64-016) (x86_64-linux-gnu-gcc-11 - (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) - #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 6 10:23:26 UTC 2","hostname":"ff-LAT"}' + - '{"bindings_version":"10.1.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 6.1.0-12-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) + 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian + 6.1.52-1 (2023-09-07)","hostname":"blackbox"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -159,7 +159,7 @@ http_interactions: Server: - nginx Date: - - Tue, 31 Oct 2023 19:02:52 GMT + - Wed, 08 Nov 2023 21:53:54 GMT Content-Type: - application/json Content-Length: @@ -179,16 +179,16 @@ http_interactions: - '300' Cache-Control: - no-cache, no-store - Content-Security-Policy-Report-Only: + 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: - - 2aa0ddf3-7314-4037-b01b-94d35ccd0468 + - 7ce09a3a-1ae3-44bf-a4a1-b4892300bee8 Original-Request: - - req_Tce1DG0Fz2T18d + - req_7vL6AMoApGaPOn Request-Id: - - req_Tce1DG0Fz2T18d + - req_7vL6AMoApGaPOn Stripe-Should-Retry: - 'false' Stripe-Version: @@ -203,7 +203,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3O7NDDKuuB1fWySn0NkcMDXT", + "id": "pi_3OAJh8KuuB1fWySn0KV6OR9K", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -217,9 +217,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3O7NDDKuuB1fWySn0NkcMDXT_secret_x4X665Kf2HS7eo6jcMjtLrmcO", + "client_secret": "pi_3OAJh8KuuB1fWySn0KV6OR9K_secret_GwjdRrh93OZLch9K7bSGXthZQ", "confirmation_method": "automatic", - "created": 1698778971, + "created": 1699480434, "currency": "eur", "customer": null, "description": null, @@ -230,7 +230,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1O7NDDKuuB1fWySnK7zLU5xt", + "payment_method": "pm_1OAJh7KuuB1fWySnzX7O7p6v", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -255,29 +255,29 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Tue, 31 Oct 2023 19:02:52 GMT + recorded_at: Wed, 08 Nov 2023 21:53:54 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3O7NDDKuuB1fWySn0NkcMDXT/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3OAJh8KuuB1fWySn0KV6OR9K/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.0.0 + - Stripe/v1 RubyBindings/10.1.0 Authorization: - Bearer Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_Tce1DG0Fz2T18d","request_duration_ms":403}}' + - '{"last_request_metrics":{"request_id":"req_7vL6AMoApGaPOn","request_duration_ms":481}}' Stripe-Version: - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.0.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 6.2.0-35-generic (buildd@bos03-amd64-016) (x86_64-linux-gnu-gcc-11 - (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) - #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 6 10:23:26 UTC 2","hostname":"ff-LAT"}' + - '{"bindings_version":"10.1.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 6.1.0-12-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) + 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian + 6.1.52-1 (2023-09-07)","hostname":"blackbox"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -290,7 +290,7 @@ http_interactions: Server: - nginx Date: - - Tue, 31 Oct 2023 19:02:53 GMT + - Wed, 08 Nov 2023 21:53:55 GMT Content-Type: - application/json Content-Length: @@ -310,17 +310,17 @@ http_interactions: - '300' Cache-Control: - no-cache, no-store - Content-Security-Policy-Report-Only: + 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: - - 8eef3458-d952-4f5f-be7d-51a1ba26ea4e + - f1ac8418-72c6-40a2-83a3-2e43b42f9338 Original-Request: - - req_4PX7kfhZVXH2V1 + - req_T5Mfbcixmq8B95 Request-Id: - - req_4PX7kfhZVXH2V1 + - req_T5Mfbcixmq8B95 Stripe-Should-Retry: - 'false' Stripe-Version: @@ -336,13 +336,13 @@ http_interactions: string: | { "error": { - "charge": "ch_3O7NDDKuuB1fWySn0iydIyVy", + "charge": "ch_3OAJh8KuuB1fWySn0ZBV99yj", "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_3O7NDDKuuB1fWySn0NkcMDXT", + "id": "pi_3OAJh8KuuB1fWySn0KV6OR9K", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -357,21 +357,21 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3O7NDDKuuB1fWySn0NkcMDXT_secret_x4X665Kf2HS7eo6jcMjtLrmcO", + "client_secret": "pi_3OAJh8KuuB1fWySn0KV6OR9K_secret_GwjdRrh93OZLch9K7bSGXthZQ", "confirmation_method": "automatic", - "created": 1698778971, + "created": 1699480434, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": { - "charge": "ch_3O7NDDKuuB1fWySn0iydIyVy", + "charge": "ch_3OAJh8KuuB1fWySn0ZBV99yj", "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_1O7NDDKuuB1fWySnK7zLU5xt", + "id": "pm_1OAJh7KuuB1fWySnzX7O7p6v", "object": "payment_method", "billing_details": { "address": { @@ -411,7 +411,7 @@ http_interactions: }, "wallet": null }, - "created": 1698778971, + "created": 1699480433, "customer": null, "livemode": false, "metadata": { @@ -420,7 +420,7 @@ http_interactions: }, "type": "card_error" }, - "latest_charge": "ch_3O7NDDKuuB1fWySn0iydIyVy", + "latest_charge": "ch_3OAJh8KuuB1fWySn0ZBV99yj", "livemode": false, "metadata": { }, @@ -452,7 +452,7 @@ http_interactions: "transfer_group": null }, "payment_method": { - "id": "pm_1O7NDDKuuB1fWySnK7zLU5xt", + "id": "pm_1OAJh7KuuB1fWySnzX7O7p6v", "object": "payment_method", "billing_details": { "address": { @@ -492,40 +492,40 @@ http_interactions: }, "wallet": null }, - "created": 1698778971, + "created": 1699480433, "customer": null, "livemode": false, "metadata": { }, "type": "card" }, - "request_log_url": "https://dashboard.stripe.com/test/logs/req_4PX7kfhZVXH2V1?t=1698778972", + "request_log_url": "https://dashboard.stripe.com/test/logs/req_T5Mfbcixmq8B95?t=1699480434", "type": "card_error" } } - recorded_at: Tue, 31 Oct 2023 19:02:53 GMT + recorded_at: Wed, 08 Nov 2023 21:53:55 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3O7NDDKuuB1fWySn0NkcMDXT + uri: https://api.stripe.com/v1/payment_intents/pi_3OAJh8KuuB1fWySn0KV6OR9K body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.0.0 + - Stripe/v1 RubyBindings/10.1.0 Authorization: - Bearer Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_Tce1DG0Fz2T18d","request_duration_ms":403}}' + - '{"last_request_metrics":{"request_id":"req_7vL6AMoApGaPOn","request_duration_ms":481}}' Stripe-Version: - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.0.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 6.2.0-35-generic (buildd@bos03-amd64-016) (x86_64-linux-gnu-gcc-11 - (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) - #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 6 10:23:26 UTC 2","hostname":"ff-LAT"}' + - '{"bindings_version":"10.1.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 6.1.0-12-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) + 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian + 6.1.52-1 (2023-09-07)","hostname":"blackbox"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -538,7 +538,7 @@ http_interactions: Server: - nginx Date: - - Tue, 31 Oct 2023 19:02:53 GMT + - Wed, 08 Nov 2023 21:53:55 GMT Content-Type: - application/json Content-Length: @@ -558,13 +558,13 @@ http_interactions: - '300' Cache-Control: - no-cache, no-store - Content-Security-Policy-Report-Only: + 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_rC5iv8iHUH5Bx9 + - req_oFg3Mxdsl0kbmA Stripe-Version: - '2023-10-16' Vary: @@ -577,7 +577,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3O7NDDKuuB1fWySn0NkcMDXT", + "id": "pi_3OAJh8KuuB1fWySn0KV6OR9K", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -591,21 +591,21 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3O7NDDKuuB1fWySn0NkcMDXT_secret_x4X665Kf2HS7eo6jcMjtLrmcO", + "client_secret": "pi_3OAJh8KuuB1fWySn0KV6OR9K_secret_GwjdRrh93OZLch9K7bSGXthZQ", "confirmation_method": "automatic", - "created": 1698778971, + "created": 1699480434, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": { - "charge": "ch_3O7NDDKuuB1fWySn0iydIyVy", + "charge": "ch_3OAJh8KuuB1fWySn0ZBV99yj", "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_1O7NDDKuuB1fWySnK7zLU5xt", + "id": "pm_1OAJh7KuuB1fWySnzX7O7p6v", "object": "payment_method", "billing_details": { "address": { @@ -645,7 +645,7 @@ http_interactions: }, "wallet": null }, - "created": 1698778971, + "created": 1699480433, "customer": null, "livemode": false, "metadata": {}, @@ -653,7 +653,7 @@ http_interactions: }, "type": "card_error" }, - "latest_charge": "ch_3O7NDDKuuB1fWySn0iydIyVy", + "latest_charge": "ch_3OAJh8KuuB1fWySn0ZBV99yj", "livemode": false, "metadata": {}, "next_action": null, @@ -683,5 +683,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Tue, 31 Oct 2023 19:02:53 GMT + recorded_at: Wed, 08 Nov 2023 21:53:56 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/returns_payment_intent_id_and_does_not_raise.yml b/spec/fixtures/vcr_cassettes/Stripe-v10.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/returns_payment_intent_id_and_does_not_raise.yml similarity index 78% rename from spec/fixtures/vcr_cassettes/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/returns_payment_intent_id_and_does_not_raise.yml rename to spec/fixtures/vcr_cassettes/Stripe-v10.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/returns_payment_intent_id_and_does_not_raise.yml index 8d565e0a9d..38458b8c94 100644 --- a/spec/fixtures/vcr_cassettes/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/returns_payment_intent_id_and_does_not_raise.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v10.1.0/Stripe_PaymentIntentValidator/_call/when_payment_intent_is_valid/returns_payment_intent_id_and_does_not_raise.yml @@ -8,18 +8,20 @@ http_interactions: string: type=card&card[number]=4242424242424242&card[exp_month]=12&card[exp_year]=2034&card[cvc]=314 headers: User-Agent: - - Stripe/v1 RubyBindings/10.0.0 + - Stripe/v1 RubyBindings/10.1.0 Authorization: - Bearer Content-Type: - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_TC9pbExmRgIvbf","request_duration_ms":286}}' Stripe-Version: - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.0.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 6.2.0-35-generic (buildd@bos03-amd64-016) (x86_64-linux-gnu-gcc-11 - (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) - #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 6 10:23:26 UTC 2","hostname":"ff-LAT"}' + - '{"bindings_version":"10.1.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 6.1.0-12-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) + 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian + 6.1.52-1 (2023-09-07)","hostname":"blackbox"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -32,7 +34,7 @@ http_interactions: Server: - nginx Date: - - Tue, 31 Oct 2023 19:02:48 GMT + - Wed, 08 Nov 2023 21:53:51 GMT Content-Type: - application/json Content-Length: @@ -52,16 +54,16 @@ http_interactions: - '300' Cache-Control: - no-cache, no-store - Content-Security-Policy-Report-Only: + 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: - - fe964a69-e54d-4063-9de0-9279a4687132 + - 6fc875e5-de6b-4f25-b196-674293d7d70f Original-Request: - - req_nN1oUfa5UXec44 + - req_DrCawewCGirS4u Request-Id: - - req_nN1oUfa5UXec44 + - req_DrCawewCGirS4u Stripe-Should-Retry: - 'false' Stripe-Version: @@ -76,7 +78,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1O7ND9KuuB1fWySnmyW2YCGo", + "id": "pm_1OAJh4KuuB1fWySn6Sm53upC", "object": "payment_method", "billing_details": { "address": { @@ -116,35 +118,35 @@ http_interactions: }, "wallet": null }, - "created": 1698778967, + "created": 1699480430, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Tue, 31 Oct 2023 19:02:48 GMT + recorded_at: Wed, 08 Nov 2023 21:53: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_1O7ND9KuuB1fWySnmyW2YCGo&payment_method_types[0]=card&capture_method=manual + string: amount=100¤cy=eur&payment_method=pm_1OAJh4KuuB1fWySn6Sm53upC&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.0.0 + - Stripe/v1 RubyBindings/10.1.0 Authorization: - Bearer Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_nN1oUfa5UXec44","request_duration_ms":789}}' + - '{"last_request_metrics":{"request_id":"req_DrCawewCGirS4u","request_duration_ms":461}}' Stripe-Version: - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.0.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 6.2.0-35-generic (buildd@bos03-amd64-016) (x86_64-linux-gnu-gcc-11 - (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) - #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 6 10:23:26 UTC 2","hostname":"ff-LAT"}' + - '{"bindings_version":"10.1.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 6.1.0-12-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) + 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian + 6.1.52-1 (2023-09-07)","hostname":"blackbox"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -157,7 +159,7 @@ http_interactions: Server: - nginx Date: - - Tue, 31 Oct 2023 19:02:48 GMT + - Wed, 08 Nov 2023 21:53:51 GMT Content-Type: - application/json Content-Length: @@ -177,16 +179,16 @@ http_interactions: - '300' Cache-Control: - no-cache, no-store - Content-Security-Policy-Report-Only: + 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: - - 7d125bdc-3da1-4b3a-bdda-ec7acc82ac75 + - 2228abfe-aefe-45da-a235-6b1608f97198 Original-Request: - - req_GJrd6HK4e2UZdK + - req_M77hwHJKl3kOmG Request-Id: - - req_GJrd6HK4e2UZdK + - req_M77hwHJKl3kOmG Stripe-Should-Retry: - 'false' Stripe-Version: @@ -201,7 +203,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3O7NDAKuuB1fWySn0EzngPdL", + "id": "pi_3OAJh5KuuB1fWySn1teF24aw", "object": "payment_intent", "amount": 100, "amount_capturable": 0, @@ -215,9 +217,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3O7NDAKuuB1fWySn0EzngPdL_secret_nvyKe0sDpd5nsmKu485lNtGl3", + "client_secret": "pi_3OAJh5KuuB1fWySn1teF24aw_secret_zkEDdwGwOiCRYocuOOF6hlDyl", "confirmation_method": "automatic", - "created": 1698778968, + "created": 1699480431, "currency": "eur", "customer": null, "description": null, @@ -228,7 +230,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1O7ND9KuuB1fWySnmyW2YCGo", + "payment_method": "pm_1OAJh4KuuB1fWySn6Sm53upC", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -253,29 +255,29 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Tue, 31 Oct 2023 19:02:48 GMT + recorded_at: Wed, 08 Nov 2023 21:53:51 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3O7NDAKuuB1fWySn0EzngPdL/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3OAJh5KuuB1fWySn1teF24aw/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.0.0 + - Stripe/v1 RubyBindings/10.1.0 Authorization: - Bearer Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_GJrd6HK4e2UZdK","request_duration_ms":609}}' + - '{"last_request_metrics":{"request_id":"req_M77hwHJKl3kOmG","request_duration_ms":512}}' Stripe-Version: - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.0.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 6.2.0-35-generic (buildd@bos03-amd64-016) (x86_64-linux-gnu-gcc-11 - (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) - #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 6 10:23:26 UTC 2","hostname":"ff-LAT"}' + - '{"bindings_version":"10.1.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 6.1.0-12-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) + 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian + 6.1.52-1 (2023-09-07)","hostname":"blackbox"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -288,7 +290,7 @@ http_interactions: Server: - nginx Date: - - Tue, 31 Oct 2023 19:02:49 GMT + - Wed, 08 Nov 2023 21:53:52 GMT Content-Type: - application/json Content-Length: @@ -308,17 +310,17 @@ http_interactions: - '300' Cache-Control: - no-cache, no-store - Content-Security-Policy-Report-Only: + 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: - - 8f195fa2-ecd1-403b-b70e-9b4d9a768a09 + - e90c558a-5e35-4550-a5d2-b513c1b00819 Original-Request: - - req_nWd6JD2SbU0eH6 + - req_DlfzVAQPPatmxi Request-Id: - - req_nWd6JD2SbU0eH6 + - req_DlfzVAQPPatmxi Stripe-Should-Retry: - 'false' Stripe-Version: @@ -333,7 +335,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3O7NDAKuuB1fWySn0EzngPdL", + "id": "pi_3OAJh5KuuB1fWySn1teF24aw", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -347,20 +349,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3O7NDAKuuB1fWySn0EzngPdL_secret_nvyKe0sDpd5nsmKu485lNtGl3", + "client_secret": "pi_3OAJh5KuuB1fWySn1teF24aw_secret_zkEDdwGwOiCRYocuOOF6hlDyl", "confirmation_method": "automatic", - "created": 1698778968, + "created": 1699480431, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3O7NDAKuuB1fWySn01eDFLcJ", + "latest_charge": "ch_3OAJh5KuuB1fWySn1DrvKdoY", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1O7ND9KuuB1fWySnmyW2YCGo", + "payment_method": "pm_1OAJh4KuuB1fWySn6Sm53upC", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -385,29 +387,29 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Tue, 31 Oct 2023 19:02:49 GMT + recorded_at: Wed, 08 Nov 2023 21:53:52 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3O7NDAKuuB1fWySn0EzngPdL + uri: https://api.stripe.com/v1/payment_intents/pi_3OAJh5KuuB1fWySn1teF24aw body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.0.0 + - Stripe/v1 RubyBindings/10.1.0 Authorization: - Bearer Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_nWd6JD2SbU0eH6","request_duration_ms":922}}' + - '{"last_request_metrics":{"request_id":"req_DlfzVAQPPatmxi","request_duration_ms":1021}}' Stripe-Version: - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.0.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 6.2.0-35-generic (buildd@bos03-amd64-016) (x86_64-linux-gnu-gcc-11 - (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) - #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 6 10:23:26 UTC 2","hostname":"ff-LAT"}' + - '{"bindings_version":"10.1.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 6.1.0-12-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) + 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian + 6.1.52-1 (2023-09-07)","hostname":"blackbox"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -420,7 +422,7 @@ http_interactions: Server: - nginx Date: - - Tue, 31 Oct 2023 19:02:51 GMT + - Wed, 08 Nov 2023 21:53:53 GMT Content-Type: - application/json Content-Length: @@ -440,13 +442,13 @@ http_interactions: - '300' Cache-Control: - no-cache, no-store - Content-Security-Policy-Report-Only: + 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_MhJwK3bCx1nUCV + - req_lDPJ62zgG8A9FL Stripe-Version: - '2023-10-16' Vary: @@ -459,7 +461,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3O7NDAKuuB1fWySn0EzngPdL", + "id": "pi_3OAJh5KuuB1fWySn1teF24aw", "object": "payment_intent", "amount": 100, "amount_capturable": 100, @@ -473,20 +475,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3O7NDAKuuB1fWySn0EzngPdL_secret_nvyKe0sDpd5nsmKu485lNtGl3", + "client_secret": "pi_3OAJh5KuuB1fWySn1teF24aw_secret_zkEDdwGwOiCRYocuOOF6hlDyl", "confirmation_method": "automatic", - "created": 1698778968, + "created": 1699480431, "currency": "eur", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3O7NDAKuuB1fWySn01eDFLcJ", + "latest_charge": "ch_3OAJh5KuuB1fWySn1DrvKdoY", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1O7ND9KuuB1fWySnmyW2YCGo", + "payment_method": "pm_1OAJh4KuuB1fWySn6Sm53upC", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -511,5 +513,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Tue, 31 Oct 2023 19:02:51 GMT + recorded_at: Wed, 08 Nov 2023 21:53:53 GMT recorded_with: VCR 6.2.0 diff --git a/spec/lib/stripe/payment_intent_validator_spec.rb b/spec/lib/stripe/payment_intent_validator_spec.rb index bb0f95ea2b..3f1e246a8f 100644 --- a/spec/lib/stripe/payment_intent_validator_spec.rb +++ b/spec/lib/stripe/payment_intent_validator_spec.rb @@ -19,7 +19,7 @@ module Stripe Stripe.api_key = secret end - describe "#call", :vcr do + describe "#call", :vcr, :stripe_version do let(:payment) { create(:payment, amount: payment_intent.amount, payment_method:, response_code: payment_intent.id, source:) diff --git a/spec/system/admin/order_spec.rb b/spec/system/admin/order_spec.rb index bc398e7673..1a94f4ca0f 100644 --- a/spec/system/admin/order_spec.rb +++ b/spec/system/admin/order_spec.rb @@ -339,24 +339,27 @@ describe ' login_as_admin visit spree.edit_admin_order_path(order) - quantity = order.line_items.first.quantity - max_quantity = 0 + item = order.line_items.first + quantity = item.quantity + max_quantity = quantity + item.variant.on_hand total = order.display_total within("tr.stock-item", text: order.products.first.name) do find("a.edit-item").click expect(page).to have_input(:quantity) - max_quantity = find("input[name='quantity']")["max"].to_i fill_in(:quantity, with: max_quantity + 1) find("a.save-item").click end - click_button("OK") - expect(page).to_not have_content "Loading..." - within("tr.stock-item", text: order.products.first.name) do - expect(page).to have_text(max_quantity.to_s) + within(".modal") do + expect(page).to have_content "Insufficient stock available" + click_on "OK" end - expect(order.reload.line_items.first.quantity).to eq(max_quantity) + + 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 } end it "there are infinite items available (variant is on demand)" do