From 7ba2d58f50161cc1d5a691dcbcf62d0b8fb6d252 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Fri, 11 Jun 2021 14:29:30 +0200 Subject: [PATCH] update VCR to 6.0.0 Also: - updated cassettes - Automated stripe secrets filtering in cassettes - Improved display when no plan-categories exists --- CHANGELOG.md | 4 + Gemfile | 2 +- Gemfile.lock | 4 +- .../plan-categories/plan-categories-list.tsx | 7 +- .../admin/versions/upgradeModal.html | 2 +- config/locales/app.admin.en.yml | 1 + db/structure.sql | 16 - lib/pay_zen/helper.rb | 4 +- lib/tasks/fablab/stripe.rake | 12 - test/integration/payzen_test.rb | 2 +- .../reservations/restricted_test.rb | 4 +- test/test_helper.rb | 2 + .../confirm_payzen_payment_success.yml | 102 + .../create_payzen_payment_token_success.yml | 52 + ...ion_create_for_restricted_slot_success.yml | 545 ++++ ...ate_for_machine_and_pay_wallet_success.yml | 545 ++++ ..._for_machine_with_subscription_success.yml | 545 ++++ ...for_machine_without_subscription_error.yml | 443 +++ ...r_machine_without_subscription_success.yml | 545 ++++ ...tions_create_for_restricted_slot_fails.yml | 330 +++ ...ons_create_for_restricted_slot_success.yml | 543 ++++ ...raining_and_plan_by_pay_wallet_success.yml | 545 ++++ ..._training_without_subscription_success.yml | 545 ++++ ...ng_coupon_retrieve_invoice_from_stripe.yml | 218 ++ ..._machine_and_plan_using_coupon_success.yml | 545 ++++ ...on_with_payment_schedule_coupon_wallet.yml | 2479 +++++++++++++++++ ...ing_subscription_with_payment_schedule.yml | 397 +++ ...ons_training_with_expired_coupon_error.yml | 227 ++ ...ent_with_many_prices_and_payment_means.yml | 545 ++++ ...ent_means_retrieve_invoice_from_stripe.yml | 218 ++ ...ons_admin_create_with_payment_schedule.yml | 867 ++++++ .../subscriptions_user_create_failed.yml | 115 + .../subscriptions_user_create_success.yml | 545 ++++ ...ptions_user_create_success_with_wallet.yml | 545 ++++ ...ions_user_create_with_payment_schedule.yml | 397 +++ .../subscriptions_user_renew_failed.yml | 443 +++ .../subscriptions_user_renew_success.yml | 545 ++++ 37 files changed, 12846 insertions(+), 40 deletions(-) create mode 100644 test/vcr_cassettes/confirm_payzen_payment_success.yml create mode 100644 test/vcr_cassettes/create_payzen_payment_token_success.yml create mode 100644 test/vcr_cassettes/reservations_and_subscription_create_for_restricted_slot_success.yml create mode 100644 test/vcr_cassettes/reservations_create_for_machine_and_pay_wallet_success.yml create mode 100644 test/vcr_cassettes/reservations_create_for_machine_with_subscription_success.yml create mode 100644 test/vcr_cassettes/reservations_create_for_machine_without_subscription_error.yml create mode 100644 test/vcr_cassettes/reservations_create_for_machine_without_subscription_success.yml create mode 100644 test/vcr_cassettes/reservations_create_for_restricted_slot_fails.yml create mode 100644 test/vcr_cassettes/reservations_create_for_restricted_slot_success.yml create mode 100644 test/vcr_cassettes/reservations_create_for_training_and_plan_by_pay_wallet_success.yml create mode 100644 test/vcr_cassettes/reservations_create_for_training_without_subscription_success.yml create mode 100644 test/vcr_cassettes/reservations_machine_and_plan_using_coupon_retrieve_invoice_from_stripe.yml create mode 100644 test/vcr_cassettes/reservations_machine_and_plan_using_coupon_success.yml create mode 100644 test/vcr_cassettes/reservations_machine_subscription_with_payment_schedule_coupon_wallet.yml create mode 100644 test/vcr_cassettes/reservations_training_subscription_with_payment_schedule.yml create mode 100644 test/vcr_cassettes/reservations_training_with_expired_coupon_error.yml create mode 100644 test/vcr_cassettes/reserve_event_with_many_prices_and_payment_means.yml create mode 100644 test/vcr_cassettes/reserve_event_with_many_prices_and_payment_means_retrieve_invoice_from_stripe.yml create mode 100644 test/vcr_cassettes/subscriptions_admin_create_with_payment_schedule.yml create mode 100644 test/vcr_cassettes/subscriptions_user_create_failed.yml create mode 100644 test/vcr_cassettes/subscriptions_user_create_success.yml create mode 100644 test/vcr_cassettes/subscriptions_user_create_success_with_wallet.yml create mode 100644 test/vcr_cassettes/subscriptions_user_create_with_payment_schedule.yml create mode 100644 test/vcr_cassettes/subscriptions_user_renew_failed.yml create mode 100644 test/vcr_cassettes/subscriptions_user_renew_success.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 161775868..2d524a251 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog Fab-manager - Ability to upgrade to a specific version with the script +- Improved display when no plan-categories exists +- Updated VCR to 6.0.0 +- Updated cassettes +- Automated stripe secrets filtering in cassettes ## v5.0.1 2021 June 10 diff --git a/Gemfile b/Gemfile index daf0fbad7..ba51c9e79 100644 --- a/Gemfile +++ b/Gemfile @@ -47,7 +47,7 @@ group :test do gem 'faker' gem 'minitest-reporters' gem 'pdf-reader' - gem 'vcr', '3.0.1' + gem 'vcr', '6.0.0' gem 'webmock' gem 'rubyXL' end diff --git a/Gemfile.lock b/Gemfile.lock index b4562b85d..cca86c623 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -397,7 +397,7 @@ GEM tzinfo-data (1.2020.4) tzinfo (>= 1.0.0) unicode-display_width (1.4.1) - vcr (3.0.1) + vcr (6.0.0) virtus (1.0.5) axiom-types (~> 0.1) coercible (~> 1.0) @@ -495,7 +495,7 @@ DEPENDENCIES stripe (= 5.29.0) sys-filesystem tzinfo-data - vcr (= 3.0.1) + vcr (= 6.0.0) web-console (>= 3.3.0) webmock webpacker (~> 5.x) diff --git a/app/frontend/src/javascript/components/plan-categories/plan-categories-list.tsx b/app/frontend/src/javascript/components/plan-categories/plan-categories-list.tsx index 7cd0fae4d..f5dee5706 100644 --- a/app/frontend/src/javascript/components/plan-categories/plan-categories-list.tsx +++ b/app/frontend/src/javascript/components/plan-categories/plan-categories-list.tsx @@ -54,7 +54,8 @@ export const PlanCategoriesList: React.FC = ({ onSucces

{t('app.admin.plan_categories_list.categories_list')}

- + {categories && categories.length == 0 && {t('app.admin.plan_categories_list.no_categories')}} + {categories && categories.length > 0 &&
@@ -62,7 +63,7 @@ export const PlanCategoriesList: React.FC = ({ onSucces - {categories && categories.map(c => + {categories.map(c => @@ -72,7 +73,7 @@ export const PlanCategoriesList: React.FC = ({ onSucces )} -
{t('app.admin.plan_categories_list.name')}
{c.name} {c.weight}
+ } ) }; diff --git a/app/frontend/templates/admin/versions/upgradeModal.html b/app/frontend/templates/admin/versions/upgradeModal.html index b802ad075..6bc7343e6 100644 --- a/app/frontend/templates/admin/versions/upgradeModal.html +++ b/app/frontend/templates/admin/versions/upgradeModal.html @@ -9,7 +9,7 @@ {{ 'app.public.common.read_more' }}

- + {{ 'app.public.common.how_to' }}

diff --git a/config/locales/app.admin.en.yml b/config/locales/app.admin.en.yml index b1364bfe3..238d820b7 100644 --- a/config/locales/app.admin.en.yml +++ b/config/locales/app.admin.en.yml @@ -1294,6 +1294,7 @@ en: manage_plans_categories: "Manage plans' categories" plan_categories_list: categories_list: "List of the plan's categories" + no_categories: "No categories" name: "Name" significance: "Significance" create_plan_category: diff --git a/db/structure.sql b/db/structure.sql index a5514c267..213818d09 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -5276,22 +5276,6 @@ CREATE INDEX profiles_lower_unaccent_last_name_trgm_idx ON public.profiles USING CREATE INDEX projects_search_vector_idx ON public.projects USING gin (search_vector); --- --- Name: accounting_periods accounting_periods_del_protect; Type: RULE; Schema: public; Owner: - --- - -CREATE RULE accounting_periods_del_protect AS - ON DELETE TO public.accounting_periods DO INSTEAD NOTHING; - - --- --- Name: accounting_periods accounting_periods_upd_protect; Type: RULE; Schema: public; Owner: - --- - -CREATE RULE accounting_periods_upd_protect AS - ON UPDATE TO public.accounting_periods DO INSTEAD NOTHING; - - -- -- Name: projects projects_search_content_trigger; Type: TRIGGER; Schema: public; Owner: - -- diff --git a/lib/pay_zen/helper.rb b/lib/pay_zen/helper.rb index ea98c972b..047980920 100644 --- a/lib/pay_zen/helper.rb +++ b/lib/pay_zen/helper.rb @@ -19,10 +19,10 @@ class PayZen::Helper end ## generate an unique string reference for the content of a cart - def generate_ref(cart_items, customer) + def generate_ref(cart_items, customer, date = DateTime.current) require 'sha3' - content = { cart_items: cart_items, customer: customer }.to_json + DateTime.current.to_s + content = { cart_items: cart_items, customer: customer }.to_json + date.to_s # It's safe to truncate a hash. See https://crypto.stackexchange.com/questions/74646/sha3-255-one-bit-less SHA3::Digest.hexdigest(:sha224, content)[0...24] end diff --git a/lib/tasks/fablab/stripe.rake b/lib/tasks/fablab/stripe.rake index e866b968c..641a81353 100644 --- a/lib/tasks/fablab/stripe.rake +++ b/lib/tasks/fablab/stripe.rake @@ -25,18 +25,6 @@ namespace :fablab do end end - - desc 'clean stripe secrets from VCR cassettes' - task clean_cassettes_secrets: :environment do - Dir['test/vcr_cassettes/*.yml'].each do |cassette_file| - cassette = File.read(cassette_file) - cassette = cassette.gsub(Setting.get('stripe_secret_key'), 'sk_test_testfaketestfaketestfake') - cassette = cassette.gsub(Setting.get('stripe_public_key'), 'pk_test_faketestfaketestfaketest') - puts cassette - File.write(cassette_file, cassette) - end - end - desc 'sync all objects to the stripe API' task sync_objects: :environment do puts 'We create all non-existing objects on stripe. This may take a while, please wait...' diff --git a/test/integration/payzen_test.rb b/test/integration/payzen_test.rb index 8aae49f4d..83c1ac81d 100644 --- a/test/integration/payzen_test.rb +++ b/test/integration/payzen_test.rb @@ -93,7 +93,7 @@ class PayzenTest < ActionDispatch::IntegrationTest cs = CartService.new(@user) cart = cs.from_hash(cart_items) amount = cart.total[:total] - id = PayZen::Helper.generate_ref(cart_items, @user.id) + id = PayZen::Helper.generate_ref(cart_items, @user.id, DateTime.new(1970, 1, 1, 0, 0, 0)) VCR.use_cassette('confirm_payzen_payment_success') do client = PayZen::PCI::Charge.new diff --git a/test/integration/reservations/restricted_test.rb b/test/integration/reservations/restricted_test.rb index 052b9ce07..0b484aed7 100644 --- a/test/integration/reservations/restricted_test.rb +++ b/test/integration/reservations/restricted_test.rb @@ -182,7 +182,7 @@ class Reservations::RestrictedTest < ActionDispatch::IntegrationTest assert_equal availabilities_count + 1, Availability.count # book a reservation - VCR.use_cassette('reservations_create_for_restricted_slot_fails') do + VCR.use_cassette('reservations_create_for_restricted_slot_forced') do post '/api/local_payment/confirm_payment', params: { customer_id: @jdupont.id, @@ -254,7 +254,7 @@ class Reservations::RestrictedTest < ActionDispatch::IntegrationTest login_as(@jdupont, scope: :user) # book a reservation - VCR.use_cassette('reservations_create_for_restricted_slot_fails') do + VCR.use_cassette('reservations_and_subscription_create_for_restricted_slot_success') do post '/api/stripe/confirm_payment', params: { payment_method_id: stripe_payment_method, diff --git a/test/test_helper.rb b/test/test_helper.rb index 8693de473..f5d45b1a7 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -16,6 +16,8 @@ include ActionDispatch::TestProcess VCR.configure do |config| config.cassette_library_dir = 'test/vcr_cassettes' config.hook_into :webmock + config.filter_sensitive_data('sk_test_testfaketestfaketestfake') { Setting.get('stripe_secret_key') } + config.filter_sensitive_data('pk_test_faketestfaketestfaketest') { Setting.get('stripe_public_key') } end Sidekiq::Testing.fake! diff --git a/test/vcr_cassettes/confirm_payzen_payment_success.yml b/test/vcr_cassettes/confirm_payzen_payment_success.yml new file mode 100644 index 000000000..d46c263b7 --- /dev/null +++ b/test/vcr_cassettes/confirm_payzen_payment_success.yml @@ -0,0 +1,102 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.payzen.eu/api-payment/V4/PCI/Charge/CreatePayment + body: + encoding: UTF-8 + string: '{"amount":118700,"currency":"EUR","orderId":"dffd53627a4901e986862674","formAction":"PAYMENT","contrib":"fab-manager + 5.0.1","customer":{"reference":2,"email":"jean.dupond@gmail.com","billingDetails":{"firstName":"Jean","lastName":"Dupont","legalName":null,"address":"14 + rue Brecourt, Annecy"},"shippingDetails":{"category":"PRIVATE","shippingMethod":"ETICKET"},"shoppingCart":{"cartItemInfo":[{"productAmount":"5100","productLabel":"Formation + Imprimante 3D","productQty":"1","productType":"SERVICE_FOR_INDIVIDUAL"},{"productAmount":"113600","productLabel":"Abonnement + mensualisable - standard, association, year","productQty":"1","productType":"SERVICE_FOR_INDIVIDUAL"}]}},"device":{"deviceType":"BROWSER","acceptHeader":"text/html","userAgent":"Mozilla/5.0 + (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101","ip":"69.89.31.226","javaEnabled":true,"language":"fr-FR","colorDepth":"32","screenHeight":768,"screenWidth":1258,"timeZoneOffset":-120},"paymentForms":[{"paymentMethodType":"CARD","pan":"4970100000000055","expiryMonth":12,"expiryYear":"21","securityCode":123}]}' + headers: + Authorization: + - Basic Njk4NzYzNTc6dGVzdHBhc3N3b3JkX0RFTU9QUklWQVRFS0VZMjNHNDQ3NXpYWlEyVUE1eDdN + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Host: + - api.payzen.eu + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 11 Jun 2021 12:23:30 GMT + Server: + - Apache + X-Powered-By: + - Undertow/1 + Set-Cookie: + - JSESSIONID=r6TLog8sSHD6F1SHWZid8Ti_aeZ9STOsn-sWc9V3.vadapi01-tls-prod-fr-lyra; + path=/api-payment + Ecspaymentid: + - b5e6d6a0a30645c882c96b0de61c04f6 + Vary: + - Accept-Encoding,User-Agent + Timing-Allow-Origin: + - "*" + Content-Length: + - '1948' + Content-Type: + - application/json;charset=utf-8 + body: + encoding: ASCII-8BIT + string: !binary |- + eyJ3ZWJTZXJ2aWNlIjoiUENJL0NoYXJnZS9DcmVhdGVQYXltZW50IiwidmVyc2lvbiI6IlY0IiwiYXBwbGljYXRpb25WZXJzaW9uIjoiNS4yNC4wIiwic3RhdHVzIjoiU1VDQ0VTUyIsImFuc3dlciI6eyJzaG9wSWQiOiI2OTg3NjM1NyIsIm9yZGVyQ3ljbGUiOiJDTE9TRUQiLCJvcmRlclN0YXR1cyI6IlBBSUQiLCJzZXJ2ZXJEYXRlIjoiMjAyMS0wNi0xMVQxMjoyMzozMSswMDowMCIsIm9yZGVyRGV0YWlscyI6eyJvcmRlclRvdGFsQW1vdW50IjoxMTg3MDAsIm9yZGVyRWZmZWN0aXZlQW1vdW50IjoxMTg3MDAsIm9yZGVyQ3VycmVuY3kiOiJFVVIiLCJtb2RlIjoiVEVTVCIsIm9yZGVySWQiOiJkZmZkNTM2MjdhNDkwMWU5ODY4NjI2NzQiLCJfdHlwZSI6IlY0L09yZGVyRGV0YWlscyJ9LCJjdXN0b21lciI6eyJiaWxsaW5nRGV0YWlscyI6eyJhZGRyZXNzIjoiMTQgcnVlIEJyZWNvdXJ0LCBBbm5lY3kiLCJjYXRlZ29yeSI6bnVsbCwiY2VsbFBob25lTnVtYmVyIjpudWxsLCJjaXR5IjpudWxsLCJjb3VudHJ5IjpudWxsLCJkaXN0cmljdCI6bnVsbCwiZmlyc3ROYW1lIjoiSmVhbiIsImlkZW50aXR5Q29kZSI6bnVsbCwibGFuZ3VhZ2UiOiJFUyIsImxhc3ROYW1lIjoiRHVwb250IiwicGhvbmVOdW1iZXIiOm51bGwsInN0YXRlIjpudWxsLCJzdHJlZXROdW1iZXIiOm51bGwsInRpdGxlIjpudWxsLCJ6aXBDb2RlIjpudWxsLCJsZWdhbE5hbWUiOm51bGwsIl90eXBlIjoiVjQvQ3VzdG9tZXIvQmlsbGluZ0RldGFpbHMifSwiZW1haWwiOiJqZWFuLmR1cG9uZEBnbWFpbC5jb20iLCJyZWZlcmVuY2UiOiIyIiwic2hpcHBpbmdEZXRhaWxzIjp7ImFkZHJlc3MiOm51bGwsImFkZHJlc3MyIjpudWxsLCJjYXRlZ29yeSI6IlBSSVZBVEUiLCJjaXR5IjpudWxsLCJjb3VudHJ5IjpudWxsLCJkZWxpdmVyeUNvbXBhbnlOYW1lIjpudWxsLCJkaXN0cmljdCI6bnVsbCwiZmlyc3ROYW1lIjpudWxsLCJpZGVudGl0eUNvZGUiOm51bGwsImxhc3ROYW1lIjpudWxsLCJsZWdhbE5hbWUiOm51bGwsInBob25lTnVtYmVyIjpudWxsLCJzaGlwcGluZ01ldGhvZCI6IkVUSUNLRVQiLCJzaGlwcGluZ1NwZWVkIjpudWxsLCJzdGF0ZSI6bnVsbCwic3RyZWV0TnVtYmVyIjpudWxsLCJ6aXBDb2RlIjpudWxsLCJfdHlwZSI6IlY0L0N1c3RvbWVyL1NoaXBwaW5nRGV0YWlscyJ9LCJleHRyYURldGFpbHMiOnsiYnJvd3NlckFjY2VwdCI6bnVsbCwiZmluZ2VyUHJpbnRJZCI6bnVsbCwiaXBBZGRyZXNzIjoiMi43LjE5OS4xODQiLCJicm93c2VyVXNlckFnZW50IjoiUnVieSIsIl90eXBlIjoiVjQvQ3VzdG9tZXIvRXh0cmFEZXRhaWxzIn0sInNob3BwaW5nQ2FydCI6eyJpbnN1cmFuY2VBbW91bnQiOm51bGwsInNoaXBwaW5nQW1vdW50IjpudWxsLCJ0YXhBbW91bnQiOm51bGwsImNhcnRJdGVtSW5mbyI6W3sicHJvZHVjdExhYmVsIjoiRm9ybWF0aW9uIEltcHJpbWFudGUgM0QiLCJwcm9kdWN0VHlwZSI6IlNFUlZJQ0VfRk9SX0lORElWSURVQUwiLCJwcm9kdWN0UmVmIjpudWxsLCJwcm9kdWN0UXR5IjoxLCJwcm9kdWN0QW1vdW50IjoiNTEwMCIsInByb2R1Y3RWYXQiOm51bGwsIl90eXBlIjoiVjQvQ3VzdG9tZXIvU2hvcHBpbmdDYXJ0SXRlbSJ9LHsicHJvZHVjdExhYmVsIjoiQWJvbm5lbWVudCBtZW5zdWFsaXNhYmxlIC0gc3RhbmRhcmQsIGFzc29jaWF0aW9uLCB5ZWFyIiwicHJvZHVjdFR5cGUiOiJTRVJWSUNFX0ZPUl9JTkRJVklEVUFMIiwicHJvZHVjdFJlZiI6bnVsbCwicHJvZHVjdFF0eSI6MSwicHJvZHVjdEFtb3VudCI6IjExMzYwMCIsInByb2R1Y3RWYXQiOm51bGwsIl90eXBlIjoiVjQvQ3VzdG9tZXIvU2hvcHBpbmdDYXJ0SXRlbSJ9XSwiX3R5cGUiOiJWNC9DdXN0b21lci9TaG9wcGluZ0NhcnQifSwiX3R5cGUiOiJWNC9DdXN0b21lci9DdXN0b21lciJ9LCJ0cmFuc2FjdGlvbnMiOlt7InNob3BJZCI6IjY5ODc2MzU3IiwidXVpZCI6IjkyZjZmZmRjOWJmZDRkY2FiNzc5OGViYWIxZjc5M2UyIiwiYW1vdW50IjoxMTg3MDAsImN1cnJlbmN5IjoiRVVSIiwicGF5bWVudE1ldGhvZFR5cGUiOiJDQVJEIiwicGF5bWVudE1ldGhvZFRva2VuIjpudWxsLCJzdGF0dXMiOiJQQUlEIiwiZGV0YWlsZWRTdGF0dXMiOiJBVVRIT1JJU0VEIiwib3BlcmF0aW9uVHlwZSI6IkRFQklUIiwiZWZmZWN0aXZlU3Ryb25nQXV0aGVudGljYXRpb24iOiJESVNBQkxFRCIsImNyZWF0aW9uRGF0ZSI6IjIwMjEtMDYtMTFUMTI6MjM6MzArMDA6MDAiLCJlcnJvckNvZGUiOm51bGwsImVycm9yTWVzc2FnZSI6bnVsbCwiZGV0YWlsZWRFcnJvckNvZGUiOm51bGwsImRldGFpbGVkRXJyb3JNZXNzYWdlIjpudWxsLCJtZXRhZGF0YSI6bnVsbCwidHJhbnNhY3Rpb25EZXRhaWxzIjp7ImxpYWJpbGl0eVNoaWZ0IjoiTk8iLCJlZmZlY3RpdmVBbW91bnQiOjExODcwMCwiZWZmZWN0aXZlQ3VycmVuY3kiOiJFVVIiLCJjcmVhdGlvbkNvbnRleHQiOiJDSEFSR0UiLCJjYXJkRGV0YWlscyI6eyJwYXltZW50U291cmNlIjoiRUMiLCJtYW51YWxWYWxpZGF0aW9uIjoiTk8iLCJleHBlY3RlZENhcHR1cmVEYXRlIjoiMjAyMS0wNi0xN1QxMjozMzozMCswMDowMCIsImVmZmVjdGl2ZUJyYW5kIjoiVklTQSIsInBhbiI6IjQ5NzAxMFhYWFhYWDAwNTUiLCJleHBpcnlNb250aCI6MTIsImV4cGlyeVllYXIiOjIwMjEsImNvdW50cnkiOiJGUiIsImlzc3VlckNvZGUiOm51bGwsImlzc3Vlck5hbWUiOiJCYW5xdWUgZGUgZMOpbW8gZXQgZGUgbCdpbm5vdmF0aW9uIiwiZWZmZWN0aXZlUHJvZHVjdENvZGUiOiJGIiwibGVnYWN5VHJhbnNJZCI6IjkwNjA4MSIsImxlZ2FjeVRyYW5zRGF0ZSI6IjIwMjEtMDYtMTFUMTI6MjM6MzArMDA6MDAiLCJwYXltZW50TWV0aG9kU291cmNlIjoiTkVXIiwiYXV0aG9yaXphdGlvblJlc3BvbnNlIjp7ImFtb3VudCI6MTE4NzAwLCJjdXJyZW5jeSI6IkVVUiIsImF1dGhvcml6YXRpb25EYXRlIjoiMjAyMS0wNi0xMVQxMjoyMzozMCswMDowMCIsImF1dGhvcml6YXRpb25OdW1iZXIiOiIzZmVhMTciLCJhdXRob3JpemF0aW9uUmVzdWx0IjoiMCIsImF1dGhvcml6YXRpb25Nb2RlIjoiRlVMTCIsIl90eXBlIjoiVjQvUGF5bWVudE1ldGhvZC9EZXRhaWxzL0NhcmRzL0NhcmRBdXRob3JpemF0aW9uUmVzcG9uc2UifSwiY2FwdHVyZVJlc3BvbnNlIjp7InJlZnVuZEFtb3VudCI6bnVsbCwiY2FwdHVyZURhdGUiOm51bGwsImNhcHR1cmVGaWxlTnVtYmVyIjpudWxsLCJyZWZ1bmRDdXJyZW5jeSI6bnVsbCwiX3R5cGUiOiJWNC9QYXltZW50TWV0aG9kL0RldGFpbHMvQ2FyZHMvQ2FyZENhcHR1cmVSZXNwb25zZSJ9LCJ0aHJlZURTUmVzcG9uc2UiOnsiYXV0aGVudGljYXRpb25SZXN1bHREYXRhIjp7InRyYW5zYWN0aW9uQ29uZGl0aW9uIjpudWxsLCJlbnJvbGxlZCI6bnVsbCwic3RhdHVzIjpudWxsLCJlY2kiOm51bGwsInhpZCI6bnVsbCwiY2F2dkFsZ29yaXRobSI6bnVsbCwiY2F2diI6bnVsbCwic2lnblZhbGlkIjpudWxsLCJicmFuZCI6bnVsbCwiX3R5cGUiOiJWNC9QYXltZW50TWV0aG9kL0RldGFpbHMvQ2FyZHMvQ2FyZEF1dGhlbnRpY2F0aW9uUmVzcG9uc2UifSwiX3R5cGUiOiJWNC9QYXltZW50TWV0aG9kL0RldGFpbHMvQ2FyZHMvVGhyZWVEU1Jlc3BvbnNlIn0sImF1dGhlbnRpY2F0aW9uUmVzcG9uc2UiOnsiaWQiOiI0OTZiOGZiMS0xYzg5LTRmZjgtYTE1MS01MDQ3ODcwYmVjNGIiLCJvcGVyYXRpb25TZXNzaW9uSWQiOiJiNWU2ZDZhMGEzMDY0NWM4ODJjOTZiMGRlNjFjMDRmNiIsInByb3RvY29sIjp7Im5hbWUiOiJUSFJFRURTIiwidmVyc2lvbiI6IjEuMC4yIiwibmV0d29yayI6IlZJU0EiLCJjaGFsbGVuZ2VQcmVmZXJlbmNlIjoiTk9fUFJFRkVSRU5DRSIsInNpbXVsYXRpb24iOnRydWUsIl90eXBlIjoiVjQvQ2hhcmdlL0F1dGhlbnRpY2F0ZS9Qcm90b2NvbCJ9LCJ2YWx1ZSI6eyJzdGF0dXMiOiJFTlJPTExFRF9VTkFWQUlMQUJMRSIsImV4dGVuc2lvbiI6eyJhdXRoZW50aWNhdGlvblR5cGUiOiJUSFJFRURTX1YxIiwiZW5yb2xsZWQiOiJVIiwiX3R5cGUiOiJWNC9DaGFyZ2UvQXV0aGVudGljYXRlL0F1dGhlbnRpY2F0aW9uUmVzdWx0RXh0ZW5zaW9uVGhyZWVkc1YxIn0sIl90eXBlIjoiVjQvQ2hhcmdlL0F1dGhlbnRpY2F0ZS9BdXRoZW50aWNhdGlvblJlc3VsdCJ9LCJfdHlwZSI6IlY0L0F1dGhlbnRpY2F0aW9uUmVzcG9uc2VEYXRhIn0sImluc3RhbGxtZW50TnVtYmVyIjpudWxsLCJpbnN0YWxsbWVudENvZGUiOm51bGwsIm1hcmtBdXRob3JpemF0aW9uUmVzcG9uc2UiOnsiYW1vdW50IjpudWxsLCJjdXJyZW5jeSI6bnVsbCwiYXV0aG9yaXphdGlvbkRhdGUiOm51bGwsImF1dGhvcml6YXRpb25OdW1iZXIiOm51bGwsImF1dGhvcml6YXRpb25SZXN1bHQiOm51bGwsIl90eXBlIjoiVjQvUGF5bWVudE1ldGhvZC9EZXRhaWxzL0NhcmRzL01hcmtBdXRob3JpemF0aW9uUmVzcG9uc2UifSwiY2FyZEhvbGRlck5hbWUiOm51bGwsImlkZW50aXR5RG9jdW1lbnROdW1iZXIiOm51bGwsImlkZW50aXR5RG9jdW1lbnRUeXBlIjpudWxsLCJfdHlwZSI6IlY0L1BheW1lbnRNZXRob2QvRGV0YWlscy9DYXJkRGV0YWlscyJ9LCJmcmF1ZE1hbmFnZW1lbnQiOnsicmlza0NvbnRyb2wiOltdLCJyaXNrQW5hbHlzaXMiOltdLCJfdHlwZSI6IlY0L1BheW1lbnRNZXRob2QvRGV0YWlscy9GcmF1ZE1hbmFnZW1lbnQifSwic3Vic2NyaXB0aW9uRGV0YWlscyI6eyJzdWJzY3JpcHRpb25JZCI6bnVsbCwiX3R5cGUiOiJWNC9QYXltZW50TWV0aG9kL0RldGFpbHMvU3Vic2NyaXB0aW9uRGV0YWlscyJ9LCJwYXJlbnRUcmFuc2FjdGlvblV1aWQiOm51bGwsIm1pZCI6Ijk4NzYzNTciLCJzZXF1ZW5jZU51bWJlciI6MSwidGF4QW1vdW50IjpudWxsLCJwcmVUYXhBbW91bnQiOm51bGwsInRheFJhdGUiOm51bGwsImV4dGVybmFsVHJhbnNhY3Rpb25JZCI6bnVsbCwibnN1IjpudWxsLCJ0aWQiOiIwMDEiLCJhY3F1aXJlck5ldHdvcmsiOiJDQiIsInRheFJlZnVuZEFtb3VudCI6bnVsbCwidXNlckluZm8iOiJBUEkgUkVTVCIsInBheW1lbnRNZXRob2RUb2tlblByZXZpb3VzbHlSZWdpc3RlcmVkIjpudWxsLCJvY2N1cnJlbmNlVHlwZSI6IlVOSVRBSVJFIiwiX3R5cGUiOiJWNC9UcmFuc2FjdGlvbkRldGFpbHMifSwiX3R5cGUiOiJWNC9QYXltZW50VHJhbnNhY3Rpb24ifV0sInN1Yk1lcmNoYW50RGV0YWlscyI6bnVsbCwiX3R5cGUiOiJWNC9QYXltZW50In0sInRpY2tldCI6IjVjZjEzOWVmYTAyNTQ4MTU5ODBhNGE1NTNkN2YwNjcxIiwic2VydmVyRGF0ZSI6IjIwMjEtMDYtMTFUMTI6MjM6MzErMDA6MDAiLCJhcHBsaWNhdGlvblByb3ZpZGVyIjoiUEFZWkVOIiwibWV0YWRhdGEiOm51bGwsIm1vZGUiOiJURVNUIiwic2VydmVyVXJsIjoiaHR0cHM6Ly9hcGkucGF5emVuLmV1IiwiX3R5cGUiOiJWNC9XZWJTZXJ2aWNlL1Jlc3BvbnNlIn0= + recorded_at: Fri, 11 Jun 2021 12:23:31 GMT +- request: + method: post + uri: https://api.payzen.eu/api-payment/V4/Order/Get/ + body: + encoding: UTF-8 + string: '{"orderId":"dffd53627a4901e986862674","operationType":"DEBIT"}' + headers: + Authorization: + - Basic Njk4NzYzNTc6dGVzdHBhc3N3b3JkX0RFTU9QUklWQVRFS0VZMjNHNDQ3NXpYWlEyVUE1eDdN + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Host: + - api.payzen.eu + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 11 Jun 2021 12:23:31 GMT + Server: + - Apache + X-Powered-By: + - Undertow/1 + Set-Cookie: + - JSESSIONID=tQtZz1beAMixfISqOGhzUT_RP-jczC71aSUMZS4d.vadapi01-tls-prod-fr-lyra; + path=/api-payment + Vary: + - Accept-Encoding,User-Agent + Timing-Allow-Origin: + - "*" + Content-Length: + - '1868' + Content-Type: + - application/json;charset=utf-8 + body: + encoding: ASCII-8BIT + string: !binary |- + eyJ3ZWJTZXJ2aWNlIjoiT3JkZXIvR2V0IiwidmVyc2lvbiI6IlY0IiwiYXBwbGljYXRpb25WZXJzaW9uIjoiNS4yNC4wIiwic3RhdHVzIjoiU1VDQ0VTUyIsImFuc3dlciI6eyJvcmRlcklkIjoiZGZmZDUzNjI3YTQ5MDFlOTg2ODYyNjc0Iiwic2hvcElkIjoiNjk4NzYzNTciLCJ0cmFuc2FjdGlvbnMiOlt7InNob3BJZCI6IjY5ODc2MzU3IiwidXVpZCI6IjkyZjZmZmRjOWJmZDRkY2FiNzc5OGViYWIxZjc5M2UyIiwicGF5bWVudE1ldGhvZFR5cGUiOiJDQVJEIiwicGF5bWVudE1ldGhvZFRva2VuIjpudWxsLCJkZXRhaWxlZFN0YXR1cyI6IkFVVEhPUklTRUQiLCJzdGF0dXMiOiJQQUlEIiwiYW1vdW50IjoxMTg3MDAsImN1cnJlbmN5IjoiRVVSIiwiY3JlYXRpb25EYXRlIjoiMjAyMS0wNi0xMVQxMjoyMzozMCswMDowMCIsImVycm9yQ29kZSI6bnVsbCwiZXJyb3JNZXNzYWdlIjpudWxsLCJkZXRhaWxlZEVycm9yQ29kZSI6bnVsbCwiZGV0YWlsZWRFcnJvck1lc3NhZ2UiOm51bGwsImVmZmVjdGl2ZVN0cm9uZ0F1dGhlbnRpY2F0aW9uIjoiRElTQUJMRUQiLCJjdXN0b21lciI6eyJiaWxsaW5nRGV0YWlscyI6eyJhZGRyZXNzIjoiMTQgcnVlIEJyZWNvdXJ0LCBBbm5lY3kiLCJjYXRlZ29yeSI6bnVsbCwiY2VsbFBob25lTnVtYmVyIjpudWxsLCJjaXR5IjpudWxsLCJjb3VudHJ5IjpudWxsLCJkaXN0cmljdCI6bnVsbCwiZmlyc3ROYW1lIjoiSmVhbiIsImlkZW50aXR5Q29kZSI6bnVsbCwibGFuZ3VhZ2UiOiJFUyIsImxhc3ROYW1lIjoiRHVwb250IiwicGhvbmVOdW1iZXIiOm51bGwsInN0YXRlIjpudWxsLCJzdHJlZXROdW1iZXIiOm51bGwsInRpdGxlIjpudWxsLCJ6aXBDb2RlIjpudWxsLCJsZWdhbE5hbWUiOm51bGwsIl90eXBlIjoiVjQvQ3VzdG9tZXIvQmlsbGluZ0RldGFpbHMifSwiZW1haWwiOiJqZWFuLmR1cG9uZEBnbWFpbC5jb20iLCJyZWZlcmVuY2UiOiIyIiwic2hpcHBpbmdEZXRhaWxzIjp7ImFkZHJlc3MiOm51bGwsImFkZHJlc3MyIjpudWxsLCJjYXRlZ29yeSI6IlBSSVZBVEUiLCJjaXR5IjpudWxsLCJjb3VudHJ5IjpudWxsLCJkZWxpdmVyeUNvbXBhbnlOYW1lIjpudWxsLCJkaXN0cmljdCI6bnVsbCwiZmlyc3ROYW1lIjpudWxsLCJpZGVudGl0eUNvZGUiOm51bGwsImxhc3ROYW1lIjpudWxsLCJsZWdhbE5hbWUiOm51bGwsInBob25lTnVtYmVyIjpudWxsLCJzaGlwcGluZ01ldGhvZCI6IkVUSUNLRVQiLCJzaGlwcGluZ1NwZWVkIjpudWxsLCJzdGF0ZSI6bnVsbCwic3RyZWV0TnVtYmVyIjpudWxsLCJ6aXBDb2RlIjpudWxsLCJfdHlwZSI6IlY0L0N1c3RvbWVyL1NoaXBwaW5nRGV0YWlscyJ9LCJleHRyYURldGFpbHMiOnsiYnJvd3NlckFjY2VwdCI6bnVsbCwiZmluZ2VyUHJpbnRJZCI6bnVsbCwiaXBBZGRyZXNzIjoiMi43LjE5OS4xODQiLCJicm93c2VyVXNlckFnZW50IjpudWxsLCJfdHlwZSI6IlY0L0N1c3RvbWVyL0V4dHJhRGV0YWlscyJ9LCJzaG9wcGluZ0NhcnQiOnsiaW5zdXJhbmNlQW1vdW50IjpudWxsLCJzaGlwcGluZ0Ftb3VudCI6bnVsbCwidGF4QW1vdW50IjpudWxsLCJjYXJ0SXRlbUluZm8iOlt7InByb2R1Y3RMYWJlbCI6IkZvcm1hdGlvbiBJbXByaW1hbnRlIDNEIiwicHJvZHVjdFR5cGUiOiJTRVJWSUNFX0ZPUl9JTkRJVklEVUFMIiwicHJvZHVjdFJlZiI6bnVsbCwicHJvZHVjdFF0eSI6MSwicHJvZHVjdEFtb3VudCI6IjUxMDAiLCJwcm9kdWN0VmF0IjpudWxsLCJfdHlwZSI6IlY0L0N1c3RvbWVyL1Nob3BwaW5nQ2FydEl0ZW0ifSx7InByb2R1Y3RMYWJlbCI6IkFib25uZW1lbnQgbWVuc3VhbGlzYWJsZSAtIHN0YW5kYXJkLCBhc3NvY2lhdGlvbiwgeWVhciIsInByb2R1Y3RUeXBlIjoiU0VSVklDRV9GT1JfSU5ESVZJRFVBTCIsInByb2R1Y3RSZWYiOm51bGwsInByb2R1Y3RRdHkiOjEsInByb2R1Y3RBbW91bnQiOiIxMTM2MDAiLCJwcm9kdWN0VmF0IjpudWxsLCJfdHlwZSI6IlY0L0N1c3RvbWVyL1Nob3BwaW5nQ2FydEl0ZW0ifV0sIl90eXBlIjoiVjQvQ3VzdG9tZXIvU2hvcHBpbmdDYXJ0In0sIl90eXBlIjoiVjQvQ3VzdG9tZXIvQ3VzdG9tZXIifSwidHJhbnNhY3Rpb25EZXRhaWxzIjp7ImxpYWJpbGl0eVNoaWZ0IjoiTk8iLCJlZmZlY3RpdmVBbW91bnQiOjExODcwMCwiZWZmZWN0aXZlQ3VycmVuY3kiOiJFVVIiLCJjcmVhdGlvbkNvbnRleHQiOiJDSEFSR0UiLCJjYXJkRGV0YWlscyI6eyJwYXltZW50U291cmNlIjoiRUMiLCJtYW51YWxWYWxpZGF0aW9uIjoiTk8iLCJleHBlY3RlZENhcHR1cmVEYXRlIjoiMjAyMS0wNi0xN1QxMjozMzozMCswMDowMCIsImVmZmVjdGl2ZUJyYW5kIjoiVklTQSIsInBhbiI6IjQ5NzAxMFhYWFhYWDAwNTUiLCJleHBpcnlNb250aCI6MTIsImV4cGlyeVllYXIiOjIwMjEsImNvdW50cnkiOiJGUiIsImlzc3VlckNvZGUiOm51bGwsImlzc3Vlck5hbWUiOiJCYW5xdWUgZGUgZMOpbW8gZXQgZGUgbCdpbm5vdmF0aW9uIiwiZWZmZWN0aXZlUHJvZHVjdENvZGUiOiJGIiwibGVnYWN5VHJhbnNJZCI6IjkwNjA4MSIsImxlZ2FjeVRyYW5zRGF0ZSI6IjIwMjEtMDYtMTFUMTI6MjM6MzArMDA6MDAiLCJwYXltZW50TWV0aG9kU291cmNlIjoiTkVXIiwiYXV0aG9yaXphdGlvblJlc3BvbnNlIjp7ImFtb3VudCI6MTE4NzAwLCJjdXJyZW5jeSI6IkVVUiIsImF1dGhvcml6YXRpb25EYXRlIjoiMjAyMS0wNi0xMVQxMjoyMzozMCswMDowMCIsImF1dGhvcml6YXRpb25OdW1iZXIiOiIzZmVhMTciLCJhdXRob3JpemF0aW9uUmVzdWx0IjoiMCIsImF1dGhvcml6YXRpb25Nb2RlIjoiRlVMTCIsIl90eXBlIjoiVjQvUGF5bWVudE1ldGhvZC9EZXRhaWxzL0NhcmRzL0NhcmRBdXRob3JpemF0aW9uUmVzcG9uc2UifSwiY2FwdHVyZVJlc3BvbnNlIjp7InJlZnVuZEFtb3VudCI6bnVsbCwiY2FwdHVyZURhdGUiOm51bGwsImNhcHR1cmVGaWxlTnVtYmVyIjpudWxsLCJyZWZ1bmRDdXJyZW5jeSI6bnVsbCwiX3R5cGUiOiJWNC9QYXltZW50TWV0aG9kL0RldGFpbHMvQ2FyZHMvQ2FyZENhcHR1cmVSZXNwb25zZSJ9LCJ0aHJlZURTUmVzcG9uc2UiOnsiYXV0aGVudGljYXRpb25SZXN1bHREYXRhIjp7InRyYW5zYWN0aW9uQ29uZGl0aW9uIjoiQ09ORF8zRF9FUlJPUiIsImVucm9sbGVkIjoiVU5LTk9XTiIsInN0YXR1cyI6IlVOS05PV04iLCJlY2kiOm51bGwsInhpZCI6bnVsbCwiY2F2dkFsZ29yaXRobSI6bnVsbCwiY2F2diI6bnVsbCwic2lnblZhbGlkIjpudWxsLCJicmFuZCI6IlZJU0EiLCJfdHlwZSI6IlY0L1BheW1lbnRNZXRob2QvRGV0YWlscy9DYXJkcy9DYXJkQXV0aGVudGljYXRpb25SZXNwb25zZSJ9LCJfdHlwZSI6IlY0L1BheW1lbnRNZXRob2QvRGV0YWlscy9DYXJkcy9UaHJlZURTUmVzcG9uc2UifSwiYXV0aGVudGljYXRpb25SZXNwb25zZSI6eyJpZCI6IjQ5NmI4ZmIxLTFjODktNGZmOC1hMTUxLTUwNDc4NzBiZWM0YiIsInByb3RvY29sIjp7Im5hbWUiOiJUSFJFRURTIiwidmVyc2lvbiI6IjEuMC4yIiwibmV0d29yayI6IlZJU0EiLCJjaGFsbGVuZ2VQcmVmZXJlbmNlIjoiTk9fUFJFRkVSRU5DRSIsInNpbXVsYXRpb24iOnRydWUsIl90eXBlIjoiVjQvQ2hhcmdlL0F1dGhlbnRpY2F0ZS9Qcm90b2NvbCJ9LCJ2YWx1ZSI6eyJzdGF0dXMiOiJFTlJPTExFRF9VTkFWQUlMQUJMRSIsImV4dGVuc2lvbiI6eyJhdXRoZW50aWNhdGlvblR5cGUiOiJUSFJFRURTX1YxIiwiZW5yb2xsZWQiOiJVIiwiX3R5cGUiOiJWNC9DaGFyZ2UvQXV0aGVudGljYXRlL0F1dGhlbnRpY2F0aW9uUmVzdWx0RXh0ZW5zaW9uVGhyZWVkc1YxIn0sIl90eXBlIjoiVjQvQ2hhcmdlL0F1dGhlbnRpY2F0ZS9BdXRoZW50aWNhdGlvblJlc3VsdCJ9LCJfdHlwZSI6IlY0L0F1dGhlbnRpY2F0aW9uUmVzcG9uc2VEYXRhIn0sImluc3RhbGxtZW50TnVtYmVyIjpudWxsLCJpbnN0YWxsbWVudENvZGUiOm51bGwsIm1hcmtBdXRob3JpemF0aW9uUmVzcG9uc2UiOnsiYW1vdW50IjpudWxsLCJjdXJyZW5jeSI6bnVsbCwiYXV0aG9yaXphdGlvbkRhdGUiOm51bGwsImF1dGhvcml6YXRpb25OdW1iZXIiOm51bGwsImF1dGhvcml6YXRpb25SZXN1bHQiOm51bGwsIl90eXBlIjoiVjQvUGF5bWVudE1ldGhvZC9EZXRhaWxzL0NhcmRzL01hcmtBdXRob3JpemF0aW9uUmVzcG9uc2UifSwiY2FyZEhvbGRlck5hbWUiOm51bGwsImlkZW50aXR5RG9jdW1lbnROdW1iZXIiOm51bGwsImlkZW50aXR5RG9jdW1lbnRUeXBlIjpudWxsLCJfdHlwZSI6IlY0L1BheW1lbnRNZXRob2QvRGV0YWlscy9DYXJkRGV0YWlscyJ9LCJmcmF1ZE1hbmFnZW1lbnQiOnsicmlza0NvbnRyb2wiOltdLCJyaXNrQW5hbHlzaXMiOltdLCJfdHlwZSI6IlY0L1BheW1lbnRNZXRob2QvRGV0YWlscy9GcmF1ZE1hbmFnZW1lbnQifSwicGFyZW50VHJhbnNhY3Rpb25VdWlkIjpudWxsLCJtaWQiOiI5ODc2MzU3Iiwic2VxdWVuY2VOdW1iZXIiOjEsInRheEFtb3VudCI6bnVsbCwicHJlVGF4QW1vdW50IjpudWxsLCJ0YXhSYXRlIjpudWxsLCJleHRlcm5hbFRyYW5zYWN0aW9uSWQiOm51bGwsIm5zdSI6bnVsbCwidGlkIjoiMDAxIiwiYWNxdWlyZXJOZXR3b3JrIjoiQ0IiLCJ0YXhSZWZ1bmRBbW91bnQiOm51bGwsInVzZXJJbmZvIjpudWxsLCJwYXltZW50TWV0aG9kVG9rZW5QcmV2aW91c2x5UmVnaXN0ZXJlZCI6bnVsbCwib2NjdXJyZW5jZVR5cGUiOiJVTklUQUlSRSIsIl90eXBlIjoiVjQvVHJhbnNhY3Rpb25EZXRhaWxzIn0sIm9yZGVyRGV0YWlscyI6eyJvcmRlclRvdGFsQW1vdW50IjoxMTg3MDAsIm9yZGVyRWZmZWN0aXZlQW1vdW50IjpudWxsLCJvcmRlckN1cnJlbmN5IjoiRVVSIiwibW9kZSI6IlRFU1QiLCJvcmRlcklkIjoiZGZmZDUzNjI3YTQ5MDFlOTg2ODYyNjc0IiwiX3R5cGUiOiJWNC9PcmRlckRldGFpbHMifSwib3BlcmF0aW9uVHlwZSI6IkRFQklUIiwibWV0YWRhdGEiOm51bGwsIl90eXBlIjoiVjQvVHJhbnNhY3Rpb24ifV0sIl90eXBlIjoiVjQvT3JkZXJUcmFuc2FjdGlvbnMifSwidGlja2V0IjoiNWYwOTVhZWQ4MjE2NDZmNmJhOGU4NjExZTIxYWFkYTciLCJzZXJ2ZXJEYXRlIjoiMjAyMS0wNi0xMVQxMjoyMzozMSswMDowMCIsImFwcGxpY2F0aW9uUHJvdmlkZXIiOiJQQVlaRU4iLCJtZXRhZGF0YSI6bnVsbCwibW9kZSI6IlRFU1QiLCJzZXJ2ZXJVcmwiOiJodHRwczovL2FwaS5wYXl6ZW4uZXUiLCJfdHlwZSI6IlY0L1dlYlNlcnZpY2UvUmVzcG9uc2UifQ== + recorded_at: Fri, 11 Jun 2021 12:23:31 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/create_payzen_payment_token_success.yml b/test/vcr_cassettes/create_payzen_payment_token_success.yml new file mode 100644 index 000000000..cd4495347 --- /dev/null +++ b/test/vcr_cassettes/create_payzen_payment_token_success.yml @@ -0,0 +1,52 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.payzen.eu/api-payment/V4/Charge/CreatePayment + body: + encoding: UTF-8 + string: '{"amount":3000,"currency":"EUR","orderId":"925eca9143ee9bb6fc4f3ae9","formAction":"PAYMENT","contrib":"fab-manager + 5.0.1","customer":{"reference":2,"email":"jean.dupond@gmail.com","billingDetails":{"firstName":"Jean","lastName":"Dupont","legalName":null,"address":"14 + rue Brecourt, Annecy"},"shippingDetails":{"category":"PRIVATE","shippingMethod":"ETICKET"},"shoppingCart":{"cartItemInfo":[{"productAmount":"0","productLabel":"Formation + Imprimante 3D","productQty":"1","productType":"SERVICE_FOR_INDIVIDUAL"},{"productAmount":"3000","productLabel":"Mensuel + - standard, association - month","productQty":"1","productType":"SERVICE_FOR_INDIVIDUAL"}]}}}' + headers: + Authorization: + - Basic Njk4NzYzNTc6dGVzdHBhc3N3b3JkX0RFTU9QUklWQVRFS0VZMjNHNDQ3NXpYWlEyVUE1eDdN + Content-Type: + - application/json + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - Ruby + Host: + - api.payzen.eu + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 11 Jun 2021 12:09:00 GMT + Server: + - Apache + X-Powered-By: + - Undertow/1 + Set-Cookie: + - JSESSIONID=12rIBEfg8UKK81oO7VEz5i7s3A7y34Y30BhZNj51.vadapi01-tls-prod-fr-lyra; + path=/api-payment + Vary: + - Accept-Encoding,User-Agent + Timing-Allow-Origin: + - "*" + Content-Length: + - '1317' + Content-Type: + - application/json;charset=utf-8 + body: + encoding: ASCII-8BIT + string: '{"webService":"Charge/CreatePayment","version":"V4","applicationVersion":"5.24.0","status":"SUCCESS","answer":{"formToken":"01m_0CuvM3TOiDeaLrsAv88g216eyJhbW91bnQiOjMwMDAsImN1cnJlbmN5IjoiRVVSIiwibW9kZSI6IlRFU1QiLCJ2ZXJzaW9uIjozLCJvcmRlcklkIjoiOTI1ZWNhOTE0M2VlOWJiNmZjNGYzYWU5Iiwic2hvcE5hbWUiOiJEZW1vIHNob3AiLCJicmFuZFByaW9yaXR5IjpbIkJBTkNPTlRBQ1QiLCJNQVNURVJDQVJEIiwiTUFTVEVSQ0FSRF9ERUJJVCIsIlZJU0EiLCJWSVNBX0RFQklUIiwiQ0IiLCJFLUNBUlRFQkxFVUUiLCJNQUVTVFJPIiwiVklTQV9FTEVDVFJPTiJdLCJjYXRlZ29yaWVzIjp7ImRlYml0Q3JlZGl0Q2FyZHMiOnsiYXBwSWQiOiJjYXJkcyIsInBhcmFtIjpbIkVERU5SRUQiLCJBTUVYIiwiQ09ORUNTIiwiTUFTVEVSQ0FSRF9ERUJJVCIsIkRJU0NPVkVSIiwiVklTQSIsIlZJU0FfREVCSVQiLCJTT0RFWE8iLCJESU5FUlMiLCJNQUVTVFJPIiwiRS1DQVJURUJMRVVFIiwiQ0hRX0RFSiIsIk1BU1RFUkNBUkQiLCJCQU5DT05UQUNUIiwiVklTQV9FTEVDVFJPTiIsIkFQRVRJWiIsIkNCIl19fSwiY2FyZHMiOnsiQ09ORUNTIjp7ImZpZWxkcyI6eyJzZWN1cml0eUNvZGUiOnsicmVxdWlyZWQiOmZhbHNlfX0sImNvcHlGcm9tIjoiY2FyZHMuREVGQVVMVCJ9LCJBTUVYIjp7ImZpZWxkcyI6eyJzZWN1cml0eUNvZGUiOnsibWF4TGVuZ3RoIjo0fX0sImNvcHlGcm9tIjoiY2FyZHMuREVGQVVMVCJ9LCJFREVOUkVEIjp7ImZpZWxkcyI6eyJzZWN1cml0eUNvZGUiOnsicmVxdWlyZWQiOmZhbHNlfX0sImNvcHlGcm9tIjoiY2FyZHMuREVGQVVMVCJ9LCJNQVNURVJDQVJEX0RFQklUIjp7ImNvcHlGcm9tIjoiY2FyZHMuREVGQVVMVCJ9LCJESVNDT1ZFUiI6eyJjb3B5RnJvbSI6ImNhcmRzLkRFRkFVTFQifSwiVklTQSI6eyJjb3B5RnJvbSI6ImNhcmRzLkRFRkFVTFQifSwiRElORVJTIjp7ImZpZWxkcyI6eyJzZWN1cml0eUNvZGUiOnsicmVxdWlyZWQiOmZhbHNlfX0sImNvcHlGcm9tIjoiY2FyZHMuREVGQVVMVCJ9LCJTT0RFWE8iOnsiZmllbGRzIjp7InNlY3VyaXR5Q29kZSI6eyJyZXF1aXJlZCI6ZmFsc2V9fSwiY29weUZyb20iOiJjYXJkcy5ERUZBVUxUIn0sIlZJU0FfREVCSVQiOnsiY29weUZyb20iOiJjYXJkcy5ERUZBVUxUIn0sIk1BRVNUUk8iOnsiZmllbGRzIjp7InNlY3VyaXR5Q29kZSI6eyJyZXF1aXJlZCI6ZmFsc2V9fSwiY29weUZyb20iOiJjYXJkcy5ERUZBVUxUIn0sIkUtQ0FSVEVCTEVVRSI6eyJjb3B5RnJvbSI6ImNhcmRzLkRFRkFVTFQifSwiQ0hRX0RFSiI6eyJmaWVsZHMiOnsic2VjdXJpdHlDb2RlIjp7InJlcXVpcmVkIjpmYWxzZX19LCJjb3B5RnJvbSI6ImNhcmRzLkRFRkFVTFQifSwiTUFTVEVSQ0FSRCI6eyJjb3B5RnJvbSI6ImNhcmRzLkRFRkFVTFQifSwiQkFOQ09OVEFDVCI6eyJmaWVsZHMiOnsic2VjdXJpdHlDb2RlIjp7InJlcXVpcmVkIjpmYWxzZSwiaGlkZGVuIjp0cnVlfX0sImNvcHlGcm9tIjoiY2FyZHMuREVGQVVMVCJ9LCJBUEVUSVoiOnsiZmllbGRzIjp7InNlY3VyaXR5Q29kZSI6eyJyZXF1aXJlZCI6ZmFsc2V9fSwiY29weUZyb20iOiJjYXJkcy5ERUZBVUxUIn0sIlZJU0FfRUxFQ1RST04iOnsiZmllbGRzIjp7InNlY3VyaXR5Q29kZSI6eyJyZXF1aXJlZCI6ZmFsc2V9fSwiY29weUZyb20iOiJjYXJkcy5ERUZBVUxUIn0sIkRFRkFVTFQiOnsiZmllbGRzIjp7InBhbiI6eyJtaW5MZW5ndGgiOjEwLCJtYXhMZW5ndGgiOjE5LCJ2YWxpZGF0b3JzIjpbIk5VTUVSSUMiLCJMVUhOIl0sInJlcXVpcmVkIjp0cnVlLCJzZW5zaXRpdmUiOnRydWUsImhpZGRlbiI6ZmFsc2UsImNsZWFyT25FcnJvciI6ZmFsc2V9LCJleHBpcnlEYXRlIjp7InJlcXVpcmVkIjp0cnVlLCJzZW5zaXRpdmUiOnRydWUsImhpZGRlbiI6ZmFsc2UsImNsZWFyT25FcnJvciI6ZmFsc2V9LCJzZWN1cml0eUNvZGUiOnsibWluTGVuZ3RoIjozLCJtYXhMZW5ndGgiOjQsInZhbGlkYXRvcnMiOlsiTlVNRVJJQyJdLCJyZXF1aXJlZCI6dHJ1ZSwic2Vuc2l0aXZlIjp0cnVlLCJoaWRkZW4iOmZhbHNlLCJjbGVhck9uRXJyb3IiOnRydWV9fX0sIkNCIjp7ImNvcHlGcm9tIjoiY2FyZHMuREVGQVVMVCJ9fSwicGFzc0FjdGl2YXRlZCI6dHJ1ZSwiYXBpUmVzdFZlcnNpb24iOiI0LjAifQ5e02","_type":"V4/Charge/PaymentForm"},"ticket":"3353df25092f48499efaafc21f6aed8d","serverDate":"2021-06-11T12:09:01+00:00","applicationProvider":"PAYZEN","metadata":null,"mode":"TEST","serverUrl":"https://api.payzen.eu","_type":"V4/WebService/Response"}' + recorded_at: Fri, 11 Jun 2021 12:09:01 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/reservations_and_subscription_create_for_restricted_slot_success.yml b/test/vcr_cassettes/reservations_and_subscription_create_for_restricted_slot_success.yml new file mode 100644 index 000000000..14d4aa1ef --- /dev/null +++ b/test/vcr_cassettes/reservations_and_subscription_create_for_restricted_slot_success.yml @@ -0,0 +1,545 @@ +--- +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]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_oXt918i1vLvnCA","request_duration_ms":13}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:15:07 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_7vgbxefAX304bE + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19GQ2sOmf47Nz9Y86E5CXf", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413707, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:15:07 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: payment_method=pm_1J19GQ2sOmf47Nz9Y86E5CXf&amount=11500¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8Di1wjdVktv5kt + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_7vgbxefAX304bE","request_duration_ms":832}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:15:08 GMT + Content-Type: + - application/json + Content-Length: + - '4263' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_E8cT63b7DOTkyf + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '8' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19GR2sOmf47Nz9D5IFGnhg", + "object": "payment_intent", + "amount": 11500, + "amount_capturable": 0, + "amount_received": 11500, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19GR2sOmf47Nz9oCBIvZzL", + "object": "charge", + "amount": 11500, + "amount_captured": 11500, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19GS2sOmf47Nz9rHxBgciP", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413707, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 50, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19GR2sOmf47Nz9D5IFGnhg", + "payment_method": "pm_1J19GQ2sOmf47Nz9Y86E5CXf", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19GR2sOmf47Nz9oCBIvZzL/rcpt_JeSAQlSUzAZq4SypvsME0HD5lEcc0IS", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19GR2sOmf47Nz9oCBIvZzL/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19GR2sOmf47Nz9D5IFGnhg" + }, + "client_secret": "pi_1J19GR2sOmf47Nz9D5IFGnhg_secret_StfFUPwntJfwxIPmOYW342c78", + "confirmation_method": "manual", + "created": 1623413707, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19GQ2sOmf47Nz9Y86E5CXf", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:15:08 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents/pi_1J19GR2sOmf47Nz9D5IFGnhg + body: + encoding: UTF-8 + string: description=Invoice+reference%3A+2106001%2FVL + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_E8cT63b7DOTkyf","request_duration_ms":1467}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:15:09 GMT + Content-Type: + - application/json + Content-Length: + - '4290' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_OU638AhOsctwWF + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19GR2sOmf47Nz9D5IFGnhg", + "object": "payment_intent", + "amount": 11500, + "amount_capturable": 0, + "amount_received": 11500, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19GR2sOmf47Nz9oCBIvZzL", + "object": "charge", + "amount": 11500, + "amount_captured": 11500, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19GS2sOmf47Nz9rHxBgciP", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413707, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 50, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19GR2sOmf47Nz9D5IFGnhg", + "payment_method": "pm_1J19GQ2sOmf47Nz9Y86E5CXf", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19GR2sOmf47Nz9oCBIvZzL/rcpt_JeSAQlSUzAZq4SypvsME0HD5lEcc0IS", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19GR2sOmf47Nz9oCBIvZzL/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19GR2sOmf47Nz9D5IFGnhg" + }, + "client_secret": "pi_1J19GR2sOmf47Nz9D5IFGnhg_secret_StfFUPwntJfwxIPmOYW342c78", + "confirmation_method": "manual", + "created": 1623413707, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": "Invoice reference: 2106001/VL", + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19GQ2sOmf47Nz9Y86E5CXf", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:15:09 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/reservations_create_for_machine_and_pay_wallet_success.yml b/test/vcr_cassettes/reservations_create_for_machine_and_pay_wallet_success.yml new file mode 100644 index 000000000..e8401f754 --- /dev/null +++ b/test/vcr_cassettes/reservations_create_for_machine_and_pay_wallet_success.yml @@ -0,0 +1,545 @@ +--- +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]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_Qtzi0kqF6AGh3Q","request_duration_ms":523}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:38 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_LwmOXnstaUaA6l + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19C62sOmf47Nz90ly8PIVC", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413438, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:10:38 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: payment_method=pm_1J19C62sOmf47Nz90ly8PIVC&amount=2400¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8CzNtM08NVlSGN + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_LwmOXnstaUaA6l","request_duration_ms":669}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:40 GMT + Content-Type: + - application/json + Content-Length: + - '4259' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_2niOSD6nIWAZIB + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '8' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19C72sOmf47Nz9H32ZvrrU", + "object": "payment_intent", + "amount": 2400, + "amount_capturable": 0, + "amount_received": 2400, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19C72sOmf47Nz9aFGRLYwk", + "object": "charge", + "amount": 2400, + "amount_captured": 2400, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19C72sOmf47Nz9D6XLqCkM", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413439, + "currency": "usd", + "customer": "cus_8CzNtM08NVlSGN", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 36, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19C72sOmf47Nz9H32ZvrrU", + "payment_method": "pm_1J19C62sOmf47Nz90ly8PIVC", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19C72sOmf47Nz9aFGRLYwk/rcpt_JeS6JAu6YVFr9TilSFUt95UFoJJqmjc", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19C72sOmf47Nz9aFGRLYwk/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19C72sOmf47Nz9H32ZvrrU" + }, + "client_secret": "pi_1J19C72sOmf47Nz9H32ZvrrU_secret_0ymuM8JWPsuvxcX2H3ZhEU6s2", + "confirmation_method": "manual", + "created": 1623413439, + "currency": "usd", + "customer": "cus_8CzNtM08NVlSGN", + "description": null, + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19C62sOmf47Nz90ly8PIVC", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:10:40 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents/pi_1J19C72sOmf47Nz9H32ZvrrU + body: + encoding: UTF-8 + string: description=Invoice+reference%3A+2106001%2FVL + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_2niOSD6nIWAZIB","request_duration_ms":1485}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:40 GMT + Content-Type: + - application/json + Content-Length: + - '4286' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_L7oB3NXiThfKHq + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19C72sOmf47Nz9H32ZvrrU", + "object": "payment_intent", + "amount": 2400, + "amount_capturable": 0, + "amount_received": 2400, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19C72sOmf47Nz9aFGRLYwk", + "object": "charge", + "amount": 2400, + "amount_captured": 2400, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19C72sOmf47Nz9D6XLqCkM", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413439, + "currency": "usd", + "customer": "cus_8CzNtM08NVlSGN", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 36, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19C72sOmf47Nz9H32ZvrrU", + "payment_method": "pm_1J19C62sOmf47Nz90ly8PIVC", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19C72sOmf47Nz9aFGRLYwk/rcpt_JeS6JAu6YVFr9TilSFUt95UFoJJqmjc", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19C72sOmf47Nz9aFGRLYwk/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19C72sOmf47Nz9H32ZvrrU" + }, + "client_secret": "pi_1J19C72sOmf47Nz9H32ZvrrU_secret_0ymuM8JWPsuvxcX2H3ZhEU6s2", + "confirmation_method": "manual", + "created": 1623413439, + "currency": "usd", + "customer": "cus_8CzNtM08NVlSGN", + "description": "Invoice reference: 2106001/VL", + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19C62sOmf47Nz90ly8PIVC", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:10:41 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/reservations_create_for_machine_with_subscription_success.yml b/test/vcr_cassettes/reservations_create_for_machine_with_subscription_success.yml new file mode 100644 index 000000000..b0025df9c --- /dev/null +++ b/test/vcr_cassettes/reservations_create_for_machine_with_subscription_success.yml @@ -0,0 +1,545 @@ +--- +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]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_CTkdNA8UVkIfpV","request_duration_ms":360}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:11 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_0UbkJM8MshuJWR + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19Be2sOmf47Nz9JSvCV9Tb", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413411, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:10:11 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: payment_method=pm_1J19Be2sOmf47Nz9JSvCV9Tb&amount=1000¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8CzKe50I0J1gaI + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_0UbkJM8MshuJWR","request_duration_ms":648}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:12 GMT + Content-Type: + - application/json + Content-Length: + - '4258' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_VTneGxjZI1u1PD + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '8' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19Bf2sOmf47Nz9DiQ0cPCK", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_received": 1000, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19Bf2sOmf47Nz9TGxG8k6F", + "object": "charge", + "amount": 1000, + "amount_captured": 1000, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19Bg2sOmf47Nz9klgYeXZ6", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413411, + "currency": "usd", + "customer": "cus_8CzKe50I0J1gaI", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 6, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19Bf2sOmf47Nz9DiQ0cPCK", + "payment_method": "pm_1J19Be2sOmf47Nz9JSvCV9Tb", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19Bf2sOmf47Nz9TGxG8k6F/rcpt_JeS5VJUmmz6o7Sg3YxpS2PoSeoXLLdg", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19Bf2sOmf47Nz9TGxG8k6F/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19Bf2sOmf47Nz9DiQ0cPCK" + }, + "client_secret": "pi_1J19Bf2sOmf47Nz9DiQ0cPCK_secret_sO1O8SgzjiZ0sjuVhRTmIjrNd", + "confirmation_method": "manual", + "created": 1623413411, + "currency": "usd", + "customer": "cus_8CzKe50I0J1gaI", + "description": null, + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Be2sOmf47Nz9JSvCV9Tb", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:10:12 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents/pi_1J19Bf2sOmf47Nz9DiQ0cPCK + body: + encoding: UTF-8 + string: description=Invoice+reference%3A+2106001%2FVL + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_VTneGxjZI1u1PD","request_duration_ms":1667}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:13 GMT + Content-Type: + - application/json + Content-Length: + - '4285' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_C5jiry9wUrfSUk + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19Bf2sOmf47Nz9DiQ0cPCK", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_received": 1000, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19Bf2sOmf47Nz9TGxG8k6F", + "object": "charge", + "amount": 1000, + "amount_captured": 1000, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19Bg2sOmf47Nz9klgYeXZ6", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413411, + "currency": "usd", + "customer": "cus_8CzKe50I0J1gaI", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 6, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19Bf2sOmf47Nz9DiQ0cPCK", + "payment_method": "pm_1J19Be2sOmf47Nz9JSvCV9Tb", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19Bf2sOmf47Nz9TGxG8k6F/rcpt_JeS5VJUmmz6o7Sg3YxpS2PoSeoXLLdg", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19Bf2sOmf47Nz9TGxG8k6F/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19Bf2sOmf47Nz9DiQ0cPCK" + }, + "client_secret": "pi_1J19Bf2sOmf47Nz9DiQ0cPCK_secret_sO1O8SgzjiZ0sjuVhRTmIjrNd", + "confirmation_method": "manual", + "created": 1623413411, + "currency": "usd", + "customer": "cus_8CzKe50I0J1gaI", + "description": "Invoice reference: 2106001/VL", + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Be2sOmf47Nz9JSvCV9Tb", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:10:13 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/reservations_create_for_machine_without_subscription_error.yml b/test/vcr_cassettes/reservations_create_for_machine_without_subscription_error.yml new file mode 100644 index 000000000..86aec5065 --- /dev/null +++ b/test/vcr_cassettes/reservations_create_for_machine_without_subscription_error.yml @@ -0,0 +1,443 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.stripe.com/v1/payment_methods + body: + encoding: UTF-8 + string: type=card&card[number]=4000000000000002&card[exp_month]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_C5jiry9wUrfSUk","request_duration_ms":465}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:14 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_6u8nwFE3OSZsT4 + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19Bi2sOmf47Nz9O7ZqNddc", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "xsVM9Mfv9kfwhRSL", + "funding": "credit", + "generated_from": null, + "last4": "0002", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413414, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:10:14 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: payment_method=pm_1J19Bi2sOmf47Nz9O7ZqNddc&amount=3200¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8Di1wjdVktv5kt + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_6u8nwFE3OSZsT4","request_duration_ms":597}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 402 + message: Payment Required + headers: + Server: + - nginx + Date: + - Fri, 11 Jun 2021 12:10:15 GMT + Content-Type: + - application/json + Content-Length: + - '7831' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_mjdUP4FJgd6Dm2 + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '7' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "error": { + "charge": "ch_1J19Bj2sOmf47Nz9n99oJJbD", + "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_1J19Bi2sOmf47Nz9SGiyMLkI", + "object": "payment_intent", + "amount": 3200, + "amount_capturable": 0, + "amount_received": 0, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19Bj2sOmf47Nz9n99oJJbD", + "object": "charge", + "amount": 3200, + "amount_captured": 0, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": null, + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": false, + "created": 1623413415, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": "card_declined", + "failure_message": "Your card was declined.", + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "declined_by_network", + "reason": "generic_decline", + "risk_level": "normal", + "risk_score": 28, + "seller_message": "The bank did not return any further details with this decline.", + "type": "issuer_declined" + }, + "paid": false, + "payment_intent": "pi_1J19Bi2sOmf47Nz9SGiyMLkI", + "payment_method": "pm_1J19Bi2sOmf47Nz9O7ZqNddc", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "xsVM9Mfv9kfwhRSL", + "funding": "credit", + "installments": null, + "last4": "0002", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": null, + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19Bj2sOmf47Nz9n99oJJbD/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "failed", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19Bi2sOmf47Nz9SGiyMLkI" + }, + "client_secret": "pi_1J19Bi2sOmf47Nz9SGiyMLkI_secret_uWpiwOiTPrRaljspJWKFTDblC", + "confirmation_method": "manual", + "created": 1623413414, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "invoice": null, + "last_payment_error": { + "charge": "ch_1J19Bj2sOmf47Nz9n99oJJbD", + "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_1J19Bi2sOmf47Nz9O7ZqNddc", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "xsVM9Mfv9kfwhRSL", + "funding": "credit", + "generated_from": null, + "last4": "0002", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413414, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + }, + "type": "card_error" + }, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": null, + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "requires_payment_method", + "transfer_data": null, + "transfer_group": null + }, + "payment_method": { + "id": "pm_1J19Bi2sOmf47Nz9O7ZqNddc", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "xsVM9Mfv9kfwhRSL", + "funding": "credit", + "generated_from": null, + "last4": "0002", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413414, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + }, + "type": "card_error" + } + } + recorded_at: Fri, 11 Jun 2021 12:10:15 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/reservations_create_for_machine_without_subscription_success.yml b/test/vcr_cassettes/reservations_create_for_machine_without_subscription_success.yml new file mode 100644 index 000000000..a47918cbf --- /dev/null +++ b/test/vcr_cassettes/reservations_create_for_machine_without_subscription_success.yml @@ -0,0 +1,545 @@ +--- +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]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_iLsFVasH8kGMo7","request_duration_ms":623}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:35 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_kYPWtw2ej2J6VG + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19C32sOmf47Nz9HKbXgdkN", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413435, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:10:35 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: payment_method=pm_1J19C32sOmf47Nz9HKbXgdkN&amount=3200¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8Di1wjdVktv5kt + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_kYPWtw2ej2J6VG","request_duration_ms":589}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:37 GMT + Content-Type: + - application/json + Content-Length: + - '4259' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_eegs9aegAiqL5L + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '8' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19C42sOmf47Nz9IKXd4HuT", + "object": "payment_intent", + "amount": 3200, + "amount_capturable": 0, + "amount_received": 3200, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19C42sOmf47Nz9zZ3DgNMC", + "object": "charge", + "amount": 3200, + "amount_captured": 3200, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19C42sOmf47Nz9UrlLJzDe", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413436, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 43, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19C42sOmf47Nz9IKXd4HuT", + "payment_method": "pm_1J19C32sOmf47Nz9HKbXgdkN", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19C42sOmf47Nz9zZ3DgNMC/rcpt_JeS6yZgl2xYi71QATPHJs6AriBq2gUB", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19C42sOmf47Nz9zZ3DgNMC/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19C42sOmf47Nz9IKXd4HuT" + }, + "client_secret": "pi_1J19C42sOmf47Nz9IKXd4HuT_secret_ACN3JLLS2l9eBC0mzPgVewF1F", + "confirmation_method": "manual", + "created": 1623413436, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19C32sOmf47Nz9HKbXgdkN", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:10:37 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents/pi_1J19C42sOmf47Nz9IKXd4HuT + body: + encoding: UTF-8 + string: description=Invoice+reference%3A+2106001%2FVL + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_eegs9aegAiqL5L","request_duration_ms":1613}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:37 GMT + Content-Type: + - application/json + Content-Length: + - '4286' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_Qtzi0kqF6AGh3Q + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19C42sOmf47Nz9IKXd4HuT", + "object": "payment_intent", + "amount": 3200, + "amount_capturable": 0, + "amount_received": 3200, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19C42sOmf47Nz9zZ3DgNMC", + "object": "charge", + "amount": 3200, + "amount_captured": 3200, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19C42sOmf47Nz9UrlLJzDe", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413436, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 43, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19C42sOmf47Nz9IKXd4HuT", + "payment_method": "pm_1J19C32sOmf47Nz9HKbXgdkN", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19C42sOmf47Nz9zZ3DgNMC/rcpt_JeS6yZgl2xYi71QATPHJs6AriBq2gUB", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19C42sOmf47Nz9zZ3DgNMC/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19C42sOmf47Nz9IKXd4HuT" + }, + "client_secret": "pi_1J19C42sOmf47Nz9IKXd4HuT_secret_ACN3JLLS2l9eBC0mzPgVewF1F", + "confirmation_method": "manual", + "created": 1623413436, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": "Invoice reference: 2106001/VL", + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19C32sOmf47Nz9HKbXgdkN", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:10:37 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/reservations_create_for_restricted_slot_fails.yml b/test/vcr_cassettes/reservations_create_for_restricted_slot_fails.yml new file mode 100644 index 000000000..0dc637cfb --- /dev/null +++ b/test/vcr_cassettes/reservations_create_for_restricted_slot_fails.yml @@ -0,0 +1,330 @@ +--- +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]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_tdtxVNNKxaRHxE","request_duration_ms":2}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:15:10 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_sPeoJkITBeFrHQ + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19GT2sOmf47Nz98lwM2AzV", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413710, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:15:10 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: payment_method=pm_1J19GT2sOmf47Nz98lwM2AzV&amount=4200¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8Di1wjdVktv5kt + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_sPeoJkITBeFrHQ","request_duration_ms":672}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:15:11 GMT + Content-Type: + - application/json + Content-Length: + - '4259' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_nfTsL4x7hjHtX7 + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '8' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19GU2sOmf47Nz9c91GTavq", + "object": "payment_intent", + "amount": 4200, + "amount_capturable": 0, + "amount_received": 4200, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19GV2sOmf47Nz9dBSG8c8F", + "object": "charge", + "amount": 4200, + "amount_captured": 4200, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19GV2sOmf47Nz9QdwG8Nn7", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413711, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 38, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19GU2sOmf47Nz9c91GTavq", + "payment_method": "pm_1J19GT2sOmf47Nz98lwM2AzV", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19GV2sOmf47Nz9dBSG8c8F/rcpt_JeSAp69l6Sv5QMWGfH7Z9UgRmjgh7Kp", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19GV2sOmf47Nz9dBSG8c8F/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19GU2sOmf47Nz9c91GTavq" + }, + "client_secret": "pi_1J19GU2sOmf47Nz9c91GTavq_secret_v9nhUxHNKVUFRXio5geVYxKTi", + "confirmation_method": "manual", + "created": 1623413710, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19GT2sOmf47Nz98lwM2AzV", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:15:11 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/reservations_create_for_restricted_slot_success.yml b/test/vcr_cassettes/reservations_create_for_restricted_slot_success.yml new file mode 100644 index 000000000..6d0e74935 --- /dev/null +++ b/test/vcr_cassettes/reservations_create_for_restricted_slot_success.yml @@ -0,0 +1,543 @@ +--- +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]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:08:43 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_7h6cmDUYO6gEil + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19AE2sOmf47Nz9gRvdc0YH", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413323, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:08:43 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: payment_method=pm_1J19AE2sOmf47Nz9gRvdc0YH&amount=1500¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8CzHcwBJtlA3IL + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_7h6cmDUYO6gEil","request_duration_ms":701}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:08:44 GMT + Content-Type: + - application/json + Content-Length: + - '4258' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_JnNw9qW6iIfVwV + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '8' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19AF2sOmf47Nz9YtcTxgsy", + "object": "payment_intent", + "amount": 1500, + "amount_capturable": 0, + "amount_received": 1500, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19AF2sOmf47Nz9ePKivBN8", + "object": "charge", + "amount": 1500, + "amount_captured": 1500, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19AG2sOmf47Nz9GR2bkWKA", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413323, + "currency": "usd", + "customer": "cus_8CzHcwBJtlA3IL", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 0, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19AF2sOmf47Nz9YtcTxgsy", + "payment_method": "pm_1J19AE2sOmf47Nz9gRvdc0YH", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19AF2sOmf47Nz9ePKivBN8/rcpt_JeS4TGjI8HE8PYOUjp8hx1pvZEyPRYo", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19AF2sOmf47Nz9ePKivBN8/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19AF2sOmf47Nz9YtcTxgsy" + }, + "client_secret": "pi_1J19AF2sOmf47Nz9YtcTxgsy_secret_wmBrh49rseqoeNCeTs9JI0cYl", + "confirmation_method": "manual", + "created": 1623413323, + "currency": "usd", + "customer": "cus_8CzHcwBJtlA3IL", + "description": null, + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19AE2sOmf47Nz9gRvdc0YH", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:08:44 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents/pi_1J19AF2sOmf47Nz9YtcTxgsy + body: + encoding: UTF-8 + string: description=Invoice+reference%3A+2106001%2FVL + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_JnNw9qW6iIfVwV","request_duration_ms":1414}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:08:45 GMT + Content-Type: + - application/json + Content-Length: + - '4285' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_tdtxVNNKxaRHxE + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19AF2sOmf47Nz9YtcTxgsy", + "object": "payment_intent", + "amount": 1500, + "amount_capturable": 0, + "amount_received": 1500, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19AF2sOmf47Nz9ePKivBN8", + "object": "charge", + "amount": 1500, + "amount_captured": 1500, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19AG2sOmf47Nz9GR2bkWKA", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413323, + "currency": "usd", + "customer": "cus_8CzHcwBJtlA3IL", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 0, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19AF2sOmf47Nz9YtcTxgsy", + "payment_method": "pm_1J19AE2sOmf47Nz9gRvdc0YH", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19AF2sOmf47Nz9ePKivBN8/rcpt_JeS4TGjI8HE8PYOUjp8hx1pvZEyPRYo", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19AF2sOmf47Nz9ePKivBN8/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19AF2sOmf47Nz9YtcTxgsy" + }, + "client_secret": "pi_1J19AF2sOmf47Nz9YtcTxgsy_secret_wmBrh49rseqoeNCeTs9JI0cYl", + "confirmation_method": "manual", + "created": 1623413323, + "currency": "usd", + "customer": "cus_8CzHcwBJtlA3IL", + "description": "Invoice reference: 2106001/VL", + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19AE2sOmf47Nz9gRvdc0YH", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:08:45 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/reservations_create_for_training_and_plan_by_pay_wallet_success.yml b/test/vcr_cassettes/reservations_create_for_training_and_plan_by_pay_wallet_success.yml new file mode 100644 index 000000000..848e48e7f --- /dev/null +++ b/test/vcr_cassettes/reservations_create_for_training_and_plan_by_pay_wallet_success.yml @@ -0,0 +1,545 @@ +--- +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]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_XakpVhlXhUOPhF","request_duration_ms":486}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:23 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_1zLewxbxeOTCH1 + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19Br2sOmf47Nz91LRiLxIn", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413423, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:10:23 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: payment_method=pm_1J19Br2sOmf47Nz91LRiLxIn&amount=1000¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8CzNtM08NVlSGN + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_1zLewxbxeOTCH1","request_duration_ms":696}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:25 GMT + Content-Type: + - application/json + Content-Length: + - '4259' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_4B0ohox4ApLjL5 + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '8' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19Br2sOmf47Nz9wnqf26kJ", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_received": 1000, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19Bs2sOmf47Nz9cZkztkKK", + "object": "charge", + "amount": 1000, + "amount_captured": 1000, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19Bs2sOmf47Nz9dHOBJpyh", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413424, + "currency": "usd", + "customer": "cus_8CzNtM08NVlSGN", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 29, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19Br2sOmf47Nz9wnqf26kJ", + "payment_method": "pm_1J19Br2sOmf47Nz91LRiLxIn", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19Bs2sOmf47Nz9cZkztkKK/rcpt_JeS67BPPDm2r7prt6gvsuPELdNNM49t", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19Bs2sOmf47Nz9cZkztkKK/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19Br2sOmf47Nz9wnqf26kJ" + }, + "client_secret": "pi_1J19Br2sOmf47Nz9wnqf26kJ_secret_CWZsKD4LulCITqndQFtOrG0Iu", + "confirmation_method": "manual", + "created": 1623413423, + "currency": "usd", + "customer": "cus_8CzNtM08NVlSGN", + "description": null, + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Br2sOmf47Nz91LRiLxIn", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:10:25 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents/pi_1J19Br2sOmf47Nz9wnqf26kJ + body: + encoding: UTF-8 + string: description=Invoice+reference%3A+2106001%2FVL + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_4B0ohox4ApLjL5","request_duration_ms":1770}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:26 GMT + Content-Type: + - application/json + Content-Length: + - '4286' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_I9Ty57VyxHpuf5 + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19Br2sOmf47Nz9wnqf26kJ", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_received": 1000, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19Bs2sOmf47Nz9cZkztkKK", + "object": "charge", + "amount": 1000, + "amount_captured": 1000, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19Bs2sOmf47Nz9dHOBJpyh", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413424, + "currency": "usd", + "customer": "cus_8CzNtM08NVlSGN", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 29, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19Br2sOmf47Nz9wnqf26kJ", + "payment_method": "pm_1J19Br2sOmf47Nz91LRiLxIn", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19Bs2sOmf47Nz9cZkztkKK/rcpt_JeS67BPPDm2r7prt6gvsuPELdNNM49t", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19Bs2sOmf47Nz9cZkztkKK/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19Br2sOmf47Nz9wnqf26kJ" + }, + "client_secret": "pi_1J19Br2sOmf47Nz9wnqf26kJ_secret_CWZsKD4LulCITqndQFtOrG0Iu", + "confirmation_method": "manual", + "created": 1623413423, + "currency": "usd", + "customer": "cus_8CzNtM08NVlSGN", + "description": "Invoice reference: 2106001/VL", + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Br2sOmf47Nz91LRiLxIn", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:10:26 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/reservations_create_for_training_without_subscription_success.yml b/test/vcr_cassettes/reservations_create_for_training_without_subscription_success.yml new file mode 100644 index 000000000..310d9cffa --- /dev/null +++ b/test/vcr_cassettes/reservations_create_for_training_without_subscription_success.yml @@ -0,0 +1,545 @@ +--- +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]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_opRsb0WDIwJxrZ","request_duration_ms":461}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:20 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_HoOhn7MKpeBtUk + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19Bo2sOmf47Nz9oXBxhBZR", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413420, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:10:20 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: payment_method=pm_1J19Bo2sOmf47Nz9oXBxhBZR&amount=5100¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8Di1wjdVktv5kt + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_HoOhn7MKpeBtUk","request_duration_ms":633}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:21 GMT + Content-Type: + - application/json + Content-Length: + - '4259' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_3FnQstJP9Rp9XR + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '8' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19Bo2sOmf47Nz9Jq9dKoTj", + "object": "payment_intent", + "amount": 5100, + "amount_capturable": 0, + "amount_received": 5100, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19Bp2sOmf47Nz9Ps4JF3xJ", + "object": "charge", + "amount": 5100, + "amount_captured": 5100, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19Bp2sOmf47Nz9PuVT48Lc", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413421, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 11, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19Bo2sOmf47Nz9Jq9dKoTj", + "payment_method": "pm_1J19Bo2sOmf47Nz9oXBxhBZR", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19Bp2sOmf47Nz9Ps4JF3xJ/rcpt_JeS6R68FYH6P28VDGne8v1k1Jx1Hj3j", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19Bp2sOmf47Nz9Ps4JF3xJ/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19Bo2sOmf47Nz9Jq9dKoTj" + }, + "client_secret": "pi_1J19Bo2sOmf47Nz9Jq9dKoTj_secret_lqAV5Z0ilLrwtlpcYp9L6yiBJ", + "confirmation_method": "manual", + "created": 1623413420, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Bo2sOmf47Nz9oXBxhBZR", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:10:22 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents/pi_1J19Bo2sOmf47Nz9Jq9dKoTj + body: + encoding: UTF-8 + string: description=Invoice+reference%3A+2106001%2FVL + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_3FnQstJP9Rp9XR","request_duration_ms":1530}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:22 GMT + Content-Type: + - application/json + Content-Length: + - '4286' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_XakpVhlXhUOPhF + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19Bo2sOmf47Nz9Jq9dKoTj", + "object": "payment_intent", + "amount": 5100, + "amount_capturable": 0, + "amount_received": 5100, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19Bp2sOmf47Nz9Ps4JF3xJ", + "object": "charge", + "amount": 5100, + "amount_captured": 5100, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19Bp2sOmf47Nz9PuVT48Lc", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413421, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 11, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19Bo2sOmf47Nz9Jq9dKoTj", + "payment_method": "pm_1J19Bo2sOmf47Nz9oXBxhBZR", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19Bp2sOmf47Nz9Ps4JF3xJ/rcpt_JeS6R68FYH6P28VDGne8v1k1Jx1Hj3j", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19Bp2sOmf47Nz9Ps4JF3xJ/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19Bo2sOmf47Nz9Jq9dKoTj" + }, + "client_secret": "pi_1J19Bo2sOmf47Nz9Jq9dKoTj_secret_lqAV5Z0ilLrwtlpcYp9L6yiBJ", + "confirmation_method": "manual", + "created": 1623413420, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": "Invoice reference: 2106001/VL", + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Bo2sOmf47Nz9oXBxhBZR", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:10:22 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/reservations_machine_and_plan_using_coupon_retrieve_invoice_from_stripe.yml b/test/vcr_cassettes/reservations_machine_and_plan_using_coupon_retrieve_invoice_from_stripe.yml new file mode 100644 index 000000000..d5d9cac1a --- /dev/null +++ b/test/vcr_cassettes/reservations_machine_and_plan_using_coupon_retrieve_invoice_from_stripe.yml @@ -0,0 +1,218 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.stripe.com/v1/payment_intents/pi_1J19Bk2sOmf47Nz9U2nrdVpa + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_CkEyaZtZeZiTlr","request_duration_ms":536}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:19 GMT + Content-Type: + - application/json + Content-Length: + - '4286' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_opRsb0WDIwJxrZ + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19Bk2sOmf47Nz9U2nrdVpa", + "object": "payment_intent", + "amount": 3825, + "amount_capturable": 0, + "amount_received": 3825, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19Bl2sOmf47Nz9d9lBfGrS", + "object": "charge", + "amount": 3825, + "amount_captured": 3825, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19Bl2sOmf47Nz9D4BAY7cR", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413417, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 26, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19Bk2sOmf47Nz9U2nrdVpa", + "payment_method": "pm_1J19Bk2sOmf47Nz9z6WoYUpM", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19Bl2sOmf47Nz9d9lBfGrS/rcpt_JeS5Ro6whGQ5fxOg5qfb78oSXn36JTU", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19Bl2sOmf47Nz9d9lBfGrS/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19Bk2sOmf47Nz9U2nrdVpa" + }, + "client_secret": "pi_1J19Bk2sOmf47Nz9U2nrdVpa_secret_PteyL7O8ejWSUdzx4VA2OnPjS", + "confirmation_method": "manual", + "created": 1623413416, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": "Invoice reference: 2106001/VL", + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Bk2sOmf47Nz9z6WoYUpM", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:10:19 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/reservations_machine_and_plan_using_coupon_success.yml b/test/vcr_cassettes/reservations_machine_and_plan_using_coupon_success.yml new file mode 100644 index 000000000..d4ac5c096 --- /dev/null +++ b/test/vcr_cassettes/reservations_machine_and_plan_using_coupon_success.yml @@ -0,0 +1,545 @@ +--- +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]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_6u8nwFE3OSZsT4","request_duration_ms":597}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:16 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_7R5xUaJImmVkvi + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19Bk2sOmf47Nz9z6WoYUpM", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413416, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:10:16 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: payment_method=pm_1J19Bk2sOmf47Nz9z6WoYUpM&amount=3825¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8Di1wjdVktv5kt + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_7R5xUaJImmVkvi","request_duration_ms":661}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:18 GMT + Content-Type: + - application/json + Content-Length: + - '4259' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_acflCvRWyIVOtM + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '8' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19Bk2sOmf47Nz9U2nrdVpa", + "object": "payment_intent", + "amount": 3825, + "amount_capturable": 0, + "amount_received": 3825, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19Bl2sOmf47Nz9d9lBfGrS", + "object": "charge", + "amount": 3825, + "amount_captured": 3825, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19Bl2sOmf47Nz9D4BAY7cR", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413417, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 26, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19Bk2sOmf47Nz9U2nrdVpa", + "payment_method": "pm_1J19Bk2sOmf47Nz9z6WoYUpM", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19Bl2sOmf47Nz9d9lBfGrS/rcpt_JeS5Ro6whGQ5fxOg5qfb78oSXn36JTU", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19Bl2sOmf47Nz9d9lBfGrS/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19Bk2sOmf47Nz9U2nrdVpa" + }, + "client_secret": "pi_1J19Bk2sOmf47Nz9U2nrdVpa_secret_PteyL7O8ejWSUdzx4VA2OnPjS", + "confirmation_method": "manual", + "created": 1623413416, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Bk2sOmf47Nz9z6WoYUpM", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:10:18 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents/pi_1J19Bk2sOmf47Nz9U2nrdVpa + body: + encoding: UTF-8 + string: description=Invoice+reference%3A+2106001%2FVL + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_acflCvRWyIVOtM","request_duration_ms":1774}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:18 GMT + Content-Type: + - application/json + Content-Length: + - '4286' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_CkEyaZtZeZiTlr + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19Bk2sOmf47Nz9U2nrdVpa", + "object": "payment_intent", + "amount": 3825, + "amount_capturable": 0, + "amount_received": 3825, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19Bl2sOmf47Nz9d9lBfGrS", + "object": "charge", + "amount": 3825, + "amount_captured": 3825, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19Bl2sOmf47Nz9D4BAY7cR", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413417, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 26, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19Bk2sOmf47Nz9U2nrdVpa", + "payment_method": "pm_1J19Bk2sOmf47Nz9z6WoYUpM", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19Bl2sOmf47Nz9d9lBfGrS/rcpt_JeS5Ro6whGQ5fxOg5qfb78oSXn36JTU", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19Bl2sOmf47Nz9d9lBfGrS/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19Bk2sOmf47Nz9U2nrdVpa" + }, + "client_secret": "pi_1J19Bk2sOmf47Nz9U2nrdVpa_secret_PteyL7O8ejWSUdzx4VA2OnPjS", + "confirmation_method": "manual", + "created": 1623413416, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": "Invoice reference: 2106001/VL", + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Bk2sOmf47Nz9z6WoYUpM", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:10:18 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/reservations_machine_subscription_with_payment_schedule_coupon_wallet.yml b/test/vcr_cassettes/reservations_machine_subscription_with_payment_schedule_coupon_wallet.yml new file mode 100644 index 000000000..48a160f4c --- /dev/null +++ b/test/vcr_cassettes/reservations_machine_subscription_with_payment_schedule_coupon_wallet.yml @@ -0,0 +1,2479 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.stripe.com/v1/setup_intents + body: + encoding: UTF-8 + string: customer=cus_8E2ys9zDZgetWX + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_I9Ty57VyxHpuf5","request_duration_ms":483}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:26 GMT + Content-Type: + - application/json + Content-Length: + - '727' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_AVWfxtFFTUBE0g + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "seti_1J19Bu2sOmf47Nz9BfLWQchb", + "object": "setup_intent", + "application": null, + "cancellation_reason": null, + "client_secret": "seti_1J19Bu2sOmf47Nz9BfLWQchb_secret_JeS6YolgTbPvCcjRt7PKEjGx4QnU2YR", + "created": 1623413426, + "customer": "cus_8E2ys9zDZgetWX", + "description": null, + "last_setup_error": null, + "latest_attempt": null, + "livemode": false, + "mandate": null, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": null, + "payment_method_options": { + "card": { + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "single_use_mandate": null, + "status": "requires_payment_method", + "usage": "off_session" + } + recorded_at: Fri, 11 Jun 2021 12:10:26 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_methods + body: + encoding: UTF-8 + string: type=card&card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_AVWfxtFFTUBE0g","request_duration_ms":394}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:27 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_zSnKYmxRfRN2HA + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19Bv2sOmf47Nz95pa9Kosw", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413427, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:10:27 GMT +- request: + method: post + uri: https://api.stripe.com/v1/setup_intents/seti_1J19Bu2sOmf47Nz9BfLWQchb/confirm + body: + encoding: UTF-8 + string: payment_method=pm_1J19Bv2sOmf47Nz95pa9Kosw + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_zSnKYmxRfRN2HA","request_duration_ms":589}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:28 GMT + Content-Type: + - application/json + Content-Length: + - '767' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_hKqEhBmsO90NDt + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "seti_1J19Bu2sOmf47Nz9BfLWQchb", + "object": "setup_intent", + "application": null, + "cancellation_reason": null, + "client_secret": "seti_1J19Bu2sOmf47Nz9BfLWQchb_secret_JeS6YolgTbPvCcjRt7PKEjGx4QnU2YR", + "created": 1623413426, + "customer": "cus_8E2ys9zDZgetWX", + "description": null, + "last_setup_error": null, + "latest_attempt": "setatt_1J19Bv2sOmf47Nz9BNjAtrI4", + "livemode": false, + "mandate": null, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Bv2sOmf47Nz95pa9Kosw", + "payment_method_options": { + "card": { + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "single_use_mandate": null, + "status": "succeeded", + "usage": "off_session" + } + recorded_at: Fri, 11 Jun 2021 12:10:28 GMT +- request: + method: get + uri: https://api.stripe.com/v1/setup_intents/seti_1J19Bu2sOmf47Nz9BfLWQchb + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_hKqEhBmsO90NDt","request_duration_ms":1066}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:28 GMT + Content-Type: + - application/json + Content-Length: + - '767' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_q2VTcWUyEb6aw7 + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "seti_1J19Bu2sOmf47Nz9BfLWQchb", + "object": "setup_intent", + "application": null, + "cancellation_reason": null, + "client_secret": "seti_1J19Bu2sOmf47Nz9BfLWQchb_secret_JeS6YolgTbPvCcjRt7PKEjGx4QnU2YR", + "created": 1623413426, + "customer": "cus_8E2ys9zDZgetWX", + "description": null, + "last_setup_error": null, + "latest_attempt": "setatt_1J19Bv2sOmf47Nz9BNjAtrI4", + "livemode": false, + "mandate": null, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Bv2sOmf47Nz95pa9Kosw", + "payment_method_options": { + "card": { + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "single_use_mandate": null, + "status": "succeeded", + "usage": "off_session" + } + recorded_at: Fri, 11 Jun 2021 12:10:28 GMT +- request: + method: post + uri: https://api.stripe.com/v1/customers/cus_8E2ys9zDZgetWX + body: + encoding: UTF-8 + string: balance=-10174 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_q2VTcWUyEb6aw7","request_duration_ms":382}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:30 GMT + Content-Type: + - application/json + Content-Length: + - '47074' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_2QIKcvMiGhgH9X + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "cus_8E2ys9zDZgetWX", + "object": "customer", + "account_balance": -10174, + "address": null, + "balance": -10174, + "created": 1460026822, + "currency": "usd", + "default_source": "card_1Euc902sOmf47Nz9eZvNNyyQ", + "delinquent": false, + "description": "Lucile Seguin", + "discount": null, + "email": "lucile.seguin@live.fr", + "invoice_prefix": "BCC32B8", + "invoice_settings": { + "custom_fields": null, + "default_payment_method": null, + "footer": null + }, + "livemode": false, + "metadata": { + }, + "name": null, + "next_invoice_sequence": 245, + "phone": null, + "preferred_locales": [ + + ], + "shipping": null, + "sources": { + "object": "list", + "data": [ + { + "id": "card_1Euc902sOmf47Nz9eZvNNyyQ", + "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_8E2ys9zDZgetWX", + "cvc_check": "unchecked", + "dynamic_last4": null, + "exp_month": 4, + "exp_year": 2020, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "last4": "4242", + "metadata": { + }, + "name": null, + "tokenization_method": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/customers/cus_8E2ys9zDZgetWX/sources" + }, + "subscriptions": { + "object": "list", + "data": [ + { + "id": "sub_JeMwMVnUvrHh9x", + "object": "subscription", + "application_fee_percent": null, + "billing": "charge_automatically", + "billing_cycle_anchor": 1623394222, + "billing_thresholds": null, + "cancel_at": 1652511019, + "cancel_at_period_end": false, + "canceled_at": 1623394222, + "collection_method": "charge_automatically", + "created": 1623394222, + "current_period_end": 1625986222, + "current_period_start": 1623394222, + "customer": "cus_8E2ys9zDZgetWX", + "days_until_due": null, + "default_payment_method": null, + "default_source": null, + "default_tax_rates": [ + + ], + "discount": null, + "ended_at": null, + "invoice_customer_balance_settings": { + "consume_applied_balance_on_void": true + }, + "items": { + "object": "list", + "data": [ + { + "id": "si_JeMwV8QZ09xs28", + "object": "subscription_item", + "billing_thresholds": null, + "created": 1623394223, + "metadata": { + }, + "plan": { + "id": "price_1J14C92sOmf47Nz9IITWw9Y0", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623394221, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "price": { + "id": "price_1J14C92sOmf47Nz9IITWw9Y0", + "object": "price", + "active": true, + "billing_scheme": "per_unit", + "created": 1623394221, + "currency": "usd", + "livemode": false, + "lookup_key": null, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "recurring": { + "aggregate_usage": null, + "interval": "month", + "interval_count": 1, + "trial_period_days": null, + "usage_type": "licensed" + }, + "tiers_mode": null, + "transform_quantity": null, + "type": "recurring", + "unit_amount": 9466, + "unit_amount_decimal": "9466" + }, + "quantity": 1, + "subscription": "sub_JeMwMVnUvrHh9x", + "tax_rates": [ + + ] + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/subscription_items?subscription=sub_JeMwMVnUvrHh9x" + }, + "latest_invoice": "in_1J14CB2sOmf47Nz9rlPidRvD", + "livemode": false, + "metadata": { + }, + "next_pending_invoice_item_invoice": null, + "pause_collection": null, + "pending_invoice_item_interval": null, + "pending_setup_intent": null, + "pending_update": null, + "plan": { + "id": "price_1J14C92sOmf47Nz9IITWw9Y0", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623394221, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "quantity": 1, + "schedule": null, + "start": 1623394222, + "start_date": 1623394222, + "status": "active", + "tax_percent": null, + "transfer_data": null, + "trial_end": null, + "trial_start": null + }, + { + "id": "sub_Je86gbipqnlh5j", + "object": "subscription", + "application_fee_percent": null, + "billing": "charge_automatically", + "billing_cycle_anchor": 1623339060, + "billing_thresholds": null, + "cancel_at": 1652455857, + "cancel_at_period_end": false, + "canceled_at": 1623339060, + "collection_method": "charge_automatically", + "created": 1623339060, + "current_period_end": 1625931060, + "current_period_start": 1623339060, + "customer": "cus_8E2ys9zDZgetWX", + "days_until_due": null, + "default_payment_method": null, + "default_source": null, + "default_tax_rates": [ + + ], + "discount": null, + "ended_at": null, + "invoice_customer_balance_settings": { + "consume_applied_balance_on_void": true + }, + "items": { + "object": "list", + "data": [ + { + "id": "si_Je86FyovrSAZ03", + "object": "subscription_item", + "billing_thresholds": null, + "created": 1623339061, + "metadata": { + }, + "plan": { + "id": "price_1J0pqR2sOmf47Nz9grlZCF6j", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623339059, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "price": { + "id": "price_1J0pqR2sOmf47Nz9grlZCF6j", + "object": "price", + "active": true, + "billing_scheme": "per_unit", + "created": 1623339059, + "currency": "usd", + "livemode": false, + "lookup_key": null, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "recurring": { + "aggregate_usage": null, + "interval": "month", + "interval_count": 1, + "trial_period_days": null, + "usage_type": "licensed" + }, + "tiers_mode": null, + "transform_quantity": null, + "type": "recurring", + "unit_amount": 9466, + "unit_amount_decimal": "9466" + }, + "quantity": 1, + "subscription": "sub_Je86gbipqnlh5j", + "tax_rates": [ + + ] + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/subscription_items?subscription=sub_Je86gbipqnlh5j" + }, + "latest_invoice": "in_1J0pqS2sOmf47Nz9NALEVY74", + "livemode": false, + "metadata": { + }, + "next_pending_invoice_item_invoice": null, + "pause_collection": null, + "pending_invoice_item_interval": null, + "pending_setup_intent": null, + "pending_update": null, + "plan": { + "id": "price_1J0pqR2sOmf47Nz9grlZCF6j", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623339059, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "quantity": 1, + "schedule": null, + "start": 1623339060, + "start_date": 1623339060, + "status": "active", + "tax_percent": null, + "transfer_data": null, + "trial_end": null, + "trial_start": null + }, + { + "id": "sub_Je83HN1Lyvo4sH", + "object": "subscription", + "application_fee_percent": null, + "billing": "charge_automatically", + "billing_cycle_anchor": 1623338866, + "billing_thresholds": null, + "cancel_at": 1652455663, + "cancel_at_period_end": false, + "canceled_at": 1623338866, + "collection_method": "charge_automatically", + "created": 1623338866, + "current_period_end": 1625930866, + "current_period_start": 1623338866, + "customer": "cus_8E2ys9zDZgetWX", + "days_until_due": null, + "default_payment_method": null, + "default_source": null, + "default_tax_rates": [ + + ], + "discount": null, + "ended_at": null, + "invoice_customer_balance_settings": { + "consume_applied_balance_on_void": true + }, + "items": { + "object": "list", + "data": [ + { + "id": "si_Je83aULDQfy2gv", + "object": "subscription_item", + "billing_thresholds": null, + "created": 1623338866, + "metadata": { + }, + "plan": { + "id": "price_1J0pnJ2sOmf47Nz9wr2pqXxo", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623338865, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "price": { + "id": "price_1J0pnJ2sOmf47Nz9wr2pqXxo", + "object": "price", + "active": true, + "billing_scheme": "per_unit", + "created": 1623338865, + "currency": "usd", + "livemode": false, + "lookup_key": null, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "recurring": { + "aggregate_usage": null, + "interval": "month", + "interval_count": 1, + "trial_period_days": null, + "usage_type": "licensed" + }, + "tiers_mode": null, + "transform_quantity": null, + "type": "recurring", + "unit_amount": 9466, + "unit_amount_decimal": "9466" + }, + "quantity": 1, + "subscription": "sub_Je83HN1Lyvo4sH", + "tax_rates": [ + + ] + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/subscription_items?subscription=sub_Je83HN1Lyvo4sH" + }, + "latest_invoice": "in_1J0pnK2sOmf47Nz93Pt8CxJL", + "livemode": false, + "metadata": { + }, + "next_pending_invoice_item_invoice": null, + "pause_collection": null, + "pending_invoice_item_interval": null, + "pending_setup_intent": null, + "pending_update": null, + "plan": { + "id": "price_1J0pnJ2sOmf47Nz9wr2pqXxo", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623338865, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "quantity": 1, + "schedule": null, + "start": 1623338866, + "start_date": 1623338866, + "status": "active", + "tax_percent": null, + "transfer_data": null, + "trial_end": null, + "trial_start": null + }, + { + "id": "sub_Je719VCAEg8rar", + "object": "subscription", + "application_fee_percent": null, + "billing": "charge_automatically", + "billing_cycle_anchor": 1623335025, + "billing_thresholds": null, + "cancel_at": 1652451823, + "cancel_at_period_end": false, + "canceled_at": 1623335025, + "collection_method": "charge_automatically", + "created": 1623335025, + "current_period_end": 1625927025, + "current_period_start": 1623335025, + "customer": "cus_8E2ys9zDZgetWX", + "days_until_due": null, + "default_payment_method": null, + "default_source": null, + "default_tax_rates": [ + + ], + "discount": null, + "ended_at": null, + "invoice_customer_balance_settings": { + "consume_applied_balance_on_void": true + }, + "items": { + "object": "list", + "data": [ + { + "id": "si_Je711BHnVjaUdJ", + "object": "subscription_item", + "billing_thresholds": null, + "created": 1623335026, + "metadata": { + }, + "plan": { + "id": "price_1J0onM2sOmf47Nz9pU5dEOiP", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623335024, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "price": { + "id": "price_1J0onM2sOmf47Nz9pU5dEOiP", + "object": "price", + "active": true, + "billing_scheme": "per_unit", + "created": 1623335024, + "currency": "usd", + "livemode": false, + "lookup_key": null, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "recurring": { + "aggregate_usage": null, + "interval": "month", + "interval_count": 1, + "trial_period_days": null, + "usage_type": "licensed" + }, + "tiers_mode": null, + "transform_quantity": null, + "type": "recurring", + "unit_amount": 9466, + "unit_amount_decimal": "9466" + }, + "quantity": 1, + "subscription": "sub_Je719VCAEg8rar", + "tax_rates": [ + + ] + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/subscription_items?subscription=sub_Je719VCAEg8rar" + }, + "latest_invoice": "in_1J0onO2sOmf47Nz9WSepb1cl", + "livemode": false, + "metadata": { + }, + "next_pending_invoice_item_invoice": null, + "pause_collection": null, + "pending_invoice_item_interval": null, + "pending_setup_intent": null, + "pending_update": null, + "plan": { + "id": "price_1J0onM2sOmf47Nz9pU5dEOiP", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623335024, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "quantity": 1, + "schedule": null, + "start": 1623335025, + "start_date": 1623335025, + "status": "active", + "tax_percent": null, + "transfer_data": null, + "trial_end": null, + "trial_start": null + }, + { + "id": "sub_Je5z35IURtkPCd", + "object": "subscription", + "application_fee_percent": null, + "billing": "charge_automatically", + "billing_cycle_anchor": 1623331204, + "billing_thresholds": null, + "cancel_at": 1652448002, + "cancel_at_period_end": false, + "canceled_at": 1623331204, + "collection_method": "charge_automatically", + "created": 1623331204, + "current_period_end": 1625923204, + "current_period_start": 1623331204, + "customer": "cus_8E2ys9zDZgetWX", + "days_until_due": null, + "default_payment_method": null, + "default_source": null, + "default_tax_rates": [ + + ], + "discount": null, + "ended_at": null, + "invoice_customer_balance_settings": { + "consume_applied_balance_on_void": true + }, + "items": { + "object": "list", + "data": [ + { + "id": "si_Je5zxIGFpX2JQy", + "object": "subscription_item", + "billing_thresholds": null, + "created": 1623331205, + "metadata": { + }, + "plan": { + "id": "price_1J0nnj2sOmf47Nz91KqEI8mo", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623331203, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "price": { + "id": "price_1J0nnj2sOmf47Nz91KqEI8mo", + "object": "price", + "active": true, + "billing_scheme": "per_unit", + "created": 1623331203, + "currency": "usd", + "livemode": false, + "lookup_key": null, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "recurring": { + "aggregate_usage": null, + "interval": "month", + "interval_count": 1, + "trial_period_days": null, + "usage_type": "licensed" + }, + "tiers_mode": null, + "transform_quantity": null, + "type": "recurring", + "unit_amount": 9466, + "unit_amount_decimal": "9466" + }, + "quantity": 1, + "subscription": "sub_Je5z35IURtkPCd", + "tax_rates": [ + + ] + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/subscription_items?subscription=sub_Je5z35IURtkPCd" + }, + "latest_invoice": "in_1J0nnk2sOmf47Nz9xy1V7Sxu", + "livemode": false, + "metadata": { + }, + "next_pending_invoice_item_invoice": null, + "pause_collection": null, + "pending_invoice_item_interval": null, + "pending_setup_intent": null, + "pending_update": null, + "plan": { + "id": "price_1J0nnj2sOmf47Nz91KqEI8mo", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623331203, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "quantity": 1, + "schedule": null, + "start": 1623331204, + "start_date": 1623331204, + "status": "active", + "tax_percent": null, + "transfer_data": null, + "trial_end": null, + "trial_start": null + }, + { + "id": "sub_Je1sV6kgVwUrvk", + "object": "subscription", + "application_fee_percent": null, + "billing": "charge_automatically", + "billing_cycle_anchor": 1623315893, + "billing_thresholds": null, + "cancel_at": 1652432690, + "cancel_at_period_end": false, + "canceled_at": 1623315893, + "collection_method": "charge_automatically", + "created": 1623315893, + "current_period_end": 1625907893, + "current_period_start": 1623315893, + "customer": "cus_8E2ys9zDZgetWX", + "days_until_due": null, + "default_payment_method": null, + "default_source": null, + "default_tax_rates": [ + + ], + "discount": null, + "ended_at": null, + "invoice_customer_balance_settings": { + "consume_applied_balance_on_void": true + }, + "items": { + "object": "list", + "data": [ + { + "id": "si_Je1srnODiAjFFB", + "object": "subscription_item", + "billing_thresholds": null, + "created": 1623315893, + "metadata": { + }, + "plan": { + "id": "price_1J0jom2sOmf47Nz9vOd89w4d", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623315892, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "price": { + "id": "price_1J0jom2sOmf47Nz9vOd89w4d", + "object": "price", + "active": true, + "billing_scheme": "per_unit", + "created": 1623315892, + "currency": "usd", + "livemode": false, + "lookup_key": null, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "recurring": { + "aggregate_usage": null, + "interval": "month", + "interval_count": 1, + "trial_period_days": null, + "usage_type": "licensed" + }, + "tiers_mode": null, + "transform_quantity": null, + "type": "recurring", + "unit_amount": 9466, + "unit_amount_decimal": "9466" + }, + "quantity": 1, + "subscription": "sub_Je1sV6kgVwUrvk", + "tax_rates": [ + + ] + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/subscription_items?subscription=sub_Je1sV6kgVwUrvk" + }, + "latest_invoice": "in_1J0jon2sOmf47Nz9bYTcnRDE", + "livemode": false, + "metadata": { + }, + "next_pending_invoice_item_invoice": null, + "pause_collection": null, + "pending_invoice_item_interval": null, + "pending_setup_intent": null, + "pending_update": null, + "plan": { + "id": "price_1J0jom2sOmf47Nz9vOd89w4d", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623315892, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "quantity": 1, + "schedule": null, + "start": 1623315893, + "start_date": 1623315893, + "status": "active", + "tax_percent": null, + "transfer_data": null, + "trial_end": null, + "trial_start": null + }, + { + "id": "sub_Jdmkqa8igz2TCX", + "object": "subscription", + "application_fee_percent": null, + "billing": "charge_automatically", + "billing_cycle_anchor": 1623259583, + "billing_thresholds": null, + "cancel_at": 1652376381, + "cancel_at_period_end": false, + "canceled_at": 1623259583, + "collection_method": "charge_automatically", + "created": 1623259583, + "current_period_end": 1625851583, + "current_period_start": 1623259583, + "customer": "cus_8E2ys9zDZgetWX", + "days_until_due": null, + "default_payment_method": null, + "default_source": null, + "default_tax_rates": [ + + ], + "discount": null, + "ended_at": null, + "invoice_customer_balance_settings": { + "consume_applied_balance_on_void": true + }, + "items": { + "object": "list", + "data": [ + { + "id": "si_Jdmkjklfs7PnAW", + "object": "subscription_item", + "billing_thresholds": null, + "created": 1623259584, + "metadata": { + }, + "plan": { + "id": "price_1J0VAY2sOmf47Nz9j4YQVst6", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623259582, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "price": { + "id": "price_1J0VAY2sOmf47Nz9j4YQVst6", + "object": "price", + "active": true, + "billing_scheme": "per_unit", + "created": 1623259582, + "currency": "usd", + "livemode": false, + "lookup_key": null, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "recurring": { + "aggregate_usage": null, + "interval": "month", + "interval_count": 1, + "trial_period_days": null, + "usage_type": "licensed" + }, + "tiers_mode": null, + "transform_quantity": null, + "type": "recurring", + "unit_amount": 9466, + "unit_amount_decimal": "9466" + }, + "quantity": 1, + "subscription": "sub_Jdmkqa8igz2TCX", + "tax_rates": [ + + ] + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/subscription_items?subscription=sub_Jdmkqa8igz2TCX" + }, + "latest_invoice": "in_1J0VAa2sOmf47Nz91OlagP56", + "livemode": false, + "metadata": { + }, + "next_pending_invoice_item_invoice": null, + "pause_collection": null, + "pending_invoice_item_interval": null, + "pending_setup_intent": null, + "pending_update": null, + "plan": { + "id": "price_1J0VAY2sOmf47Nz9j4YQVst6", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623259582, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "quantity": 1, + "schedule": null, + "start": 1623259583, + "start_date": 1623259583, + "status": "active", + "tax_percent": null, + "transfer_data": null, + "trial_end": null, + "trial_start": null + }, + { + "id": "sub_Jdlr0opdwWOKe3", + "object": "subscription", + "application_fee_percent": null, + "billing": "charge_automatically", + "billing_cycle_anchor": 1623256314, + "billing_thresholds": null, + "cancel_at": 1652373112, + "cancel_at_period_end": false, + "canceled_at": 1623256314, + "collection_method": "charge_automatically", + "created": 1623256314, + "current_period_end": 1625848314, + "current_period_start": 1623256314, + "customer": "cus_8E2ys9zDZgetWX", + "days_until_due": null, + "default_payment_method": null, + "default_source": null, + "default_tax_rates": [ + + ], + "discount": null, + "ended_at": null, + "invoice_customer_balance_settings": { + "consume_applied_balance_on_void": true + }, + "items": { + "object": "list", + "data": [ + { + "id": "si_JdlrPvF329bOo4", + "object": "subscription_item", + "billing_thresholds": null, + "created": 1623256315, + "metadata": { + }, + "plan": { + "id": "price_1J0UJp2sOmf47Nz9L3lV9Vpj", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623256313, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "price": { + "id": "price_1J0UJp2sOmf47Nz9L3lV9Vpj", + "object": "price", + "active": true, + "billing_scheme": "per_unit", + "created": 1623256313, + "currency": "usd", + "livemode": false, + "lookup_key": null, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "recurring": { + "aggregate_usage": null, + "interval": "month", + "interval_count": 1, + "trial_period_days": null, + "usage_type": "licensed" + }, + "tiers_mode": null, + "transform_quantity": null, + "type": "recurring", + "unit_amount": 9466, + "unit_amount_decimal": "9466" + }, + "quantity": 1, + "subscription": "sub_Jdlr0opdwWOKe3", + "tax_rates": [ + + ] + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/subscription_items?subscription=sub_Jdlr0opdwWOKe3" + }, + "latest_invoice": "in_1J0UJr2sOmf47Nz9JwYQxL7T", + "livemode": false, + "metadata": { + }, + "next_pending_invoice_item_invoice": null, + "pause_collection": null, + "pending_invoice_item_interval": null, + "pending_setup_intent": null, + "pending_update": null, + "plan": { + "id": "price_1J0UJp2sOmf47Nz9L3lV9Vpj", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623256313, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "quantity": 1, + "schedule": null, + "start": 1623256314, + "start_date": 1623256314, + "status": "active", + "tax_percent": null, + "transfer_data": null, + "trial_end": null, + "trial_start": null + }, + { + "id": "sub_JdlYOIWmLbUDTg", + "object": "subscription", + "application_fee_percent": null, + "billing": "charge_automatically", + "billing_cycle_anchor": 1623255182, + "billing_thresholds": null, + "cancel_at": 1652371979, + "cancel_at_period_end": false, + "canceled_at": 1623255182, + "collection_method": "charge_automatically", + "created": 1623255182, + "current_period_end": 1625847182, + "current_period_start": 1623255182, + "customer": "cus_8E2ys9zDZgetWX", + "days_until_due": null, + "default_payment_method": null, + "default_source": null, + "default_tax_rates": [ + + ], + "discount": null, + "ended_at": null, + "invoice_customer_balance_settings": { + "consume_applied_balance_on_void": true + }, + "items": { + "object": "list", + "data": [ + { + "id": "si_JdlY8CvNxkO4RE", + "object": "subscription_item", + "billing_thresholds": null, + "created": 1623255183, + "metadata": { + }, + "plan": { + "id": "price_1J0U1Z2sOmf47Nz9ZaPLOQ9J", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623255181, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "price": { + "id": "price_1J0U1Z2sOmf47Nz9ZaPLOQ9J", + "object": "price", + "active": true, + "billing_scheme": "per_unit", + "created": 1623255181, + "currency": "usd", + "livemode": false, + "lookup_key": null, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "recurring": { + "aggregate_usage": null, + "interval": "month", + "interval_count": 1, + "trial_period_days": null, + "usage_type": "licensed" + }, + "tiers_mode": null, + "transform_quantity": null, + "type": "recurring", + "unit_amount": 9466, + "unit_amount_decimal": "9466" + }, + "quantity": 1, + "subscription": "sub_JdlYOIWmLbUDTg", + "tax_rates": [ + + ] + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/subscription_items?subscription=sub_JdlYOIWmLbUDTg" + }, + "latest_invoice": "in_1J0U1a2sOmf47Nz9FDdAARrf", + "livemode": false, + "metadata": { + }, + "next_pending_invoice_item_invoice": null, + "pause_collection": null, + "pending_invoice_item_interval": null, + "pending_setup_intent": null, + "pending_update": null, + "plan": { + "id": "price_1J0U1Z2sOmf47Nz9ZaPLOQ9J", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623255181, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "quantity": 1, + "schedule": null, + "start": 1623255182, + "start_date": 1623255182, + "status": "active", + "tax_percent": null, + "transfer_data": null, + "trial_end": null, + "trial_start": null + }, + { + "id": "sub_JdkdoCnvBpd4Ak", + "object": "subscription", + "application_fee_percent": null, + "billing": "charge_automatically", + "billing_cycle_anchor": 1623251750, + "billing_thresholds": null, + "cancel_at": 1652368547, + "cancel_at_period_end": false, + "canceled_at": 1623251750, + "collection_method": "charge_automatically", + "created": 1623251750, + "current_period_end": 1625843750, + "current_period_start": 1623251750, + "customer": "cus_8E2ys9zDZgetWX", + "days_until_due": null, + "default_payment_method": null, + "default_source": null, + "default_tax_rates": [ + + ], + "discount": null, + "ended_at": null, + "invoice_customer_balance_settings": { + "consume_applied_balance_on_void": true + }, + "items": { + "object": "list", + "data": [ + { + "id": "si_Jdkd69PWGuIvEb", + "object": "subscription_item", + "billing_thresholds": null, + "created": 1623251750, + "metadata": { + }, + "plan": { + "id": "price_1J0T8D2sOmf47Nz96Ohhxb3c", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623251749, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "price": { + "id": "price_1J0T8D2sOmf47Nz96Ohhxb3c", + "object": "price", + "active": true, + "billing_scheme": "per_unit", + "created": 1623251749, + "currency": "usd", + "livemode": false, + "lookup_key": null, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "recurring": { + "aggregate_usage": null, + "interval": "month", + "interval_count": 1, + "trial_period_days": null, + "usage_type": "licensed" + }, + "tiers_mode": null, + "transform_quantity": null, + "type": "recurring", + "unit_amount": 9466, + "unit_amount_decimal": "9466" + }, + "quantity": 1, + "subscription": "sub_JdkdoCnvBpd4Ak", + "tax_rates": [ + + ] + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/subscription_items?subscription=sub_JdkdoCnvBpd4Ak" + }, + "latest_invoice": "in_1J0T8E2sOmf47Nz9tuVIRxj6", + "livemode": false, + "metadata": { + }, + "next_pending_invoice_item_invoice": null, + "pause_collection": null, + "pending_invoice_item_interval": null, + "pending_setup_intent": null, + "pending_update": null, + "plan": { + "id": "price_1J0T8D2sOmf47Nz96Ohhxb3c", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623251749, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "quantity": 1, + "schedule": null, + "start": 1623251750, + "start_date": 1623251750, + "status": "active", + "tax_percent": null, + "transfer_data": null, + "trial_end": null, + "trial_start": null + } + ], + "has_more": true, + "total_count": 77, + "url": "/v1/customers/cus_8E2ys9zDZgetWX/subscriptions" + }, + "tax_exempt": "none", + "tax_ids": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/customers/cus_8E2ys9zDZgetWX/tax_ids" + }, + "tax_info": null, + "tax_info_verification": null + } + recorded_at: Fri, 11 Jun 2021 12:10:30 GMT +- request: + method: get + uri: https://api.stripe.com/v1/setup_intents/seti_1J19Bu2sOmf47Nz9BfLWQchb + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_2QIKcvMiGhgH9X","request_duration_ms":1042}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:30 GMT + Content-Type: + - application/json + Content-Length: + - '767' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_KUlaNTa9jhgxnL + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "seti_1J19Bu2sOmf47Nz9BfLWQchb", + "object": "setup_intent", + "application": null, + "cancellation_reason": null, + "client_secret": "seti_1J19Bu2sOmf47Nz9BfLWQchb_secret_JeS6YolgTbPvCcjRt7PKEjGx4QnU2YR", + "created": 1623413426, + "customer": "cus_8E2ys9zDZgetWX", + "description": null, + "last_setup_error": null, + "latest_attempt": "setatt_1J19Bv2sOmf47Nz9BNjAtrI4", + "livemode": false, + "mandate": null, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Bv2sOmf47Nz95pa9Kosw", + "payment_method_options": { + "card": { + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "single_use_mandate": null, + "status": "succeeded", + "usage": "off_session" + } + recorded_at: Fri, 11 Jun 2021 12:10:30 GMT +- request: + method: post + uri: https://api.stripe.com/v1/prices + body: + encoding: UTF-8 + string: unit_amount=9466¤cy=usd&product=prod_IZQAhb9nLu4jfN&recurring[interval]=month&recurring[interval_count]=1 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_KUlaNTa9jhgxnL","request_duration_ms":387}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:30 GMT + Content-Type: + - application/json + Content-Length: + - '574' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_D0fQxTCk4FelfE + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "price_1J19By2sOmf47Nz9KVhsAQuQ", + "object": "price", + "active": true, + "billing_scheme": "per_unit", + "created": 1623413430, + "currency": "usd", + "livemode": false, + "lookup_key": null, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "recurring": { + "aggregate_usage": null, + "interval": "month", + "interval_count": 1, + "trial_period_days": null, + "usage_type": "licensed" + }, + "tiers_mode": null, + "transform_quantity": null, + "type": "recurring", + "unit_amount": 9466, + "unit_amount_decimal": "9466" + } + recorded_at: Fri, 11 Jun 2021 12:10:30 GMT +- request: + method: post + uri: https://api.stripe.com/v1/prices + body: + encoding: UTF-8 + string: unit_amount=8¤cy=usd&product=prod_IZQAhb9nLu4jfN&nickname=Price+adjustment+for+payment+schedule+5 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_D0fQxTCk4FelfE","request_duration_ms":405}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:31 GMT + Content-Type: + - application/json + Content-Length: + - '464' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_zKIsh8lrMFOIBv + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "price_1J19Bz2sOmf47Nz9tj2Y133y", + "object": "price", + "active": true, + "billing_scheme": "per_unit", + "created": 1623413431, + "currency": "usd", + "livemode": false, + "lookup_key": null, + "metadata": { + }, + "nickname": "Price adjustment for payment schedule 5", + "product": "prod_IZQAhb9nLu4jfN", + "recurring": null, + "tiers_mode": null, + "transform_quantity": null, + "type": "one_time", + "unit_amount": 8, + "unit_amount_decimal": "8" + } + recorded_at: Fri, 11 Jun 2021 12:10:31 GMT +- request: + method: post + uri: https://api.stripe.com/v1/prices + body: + encoding: UTF-8 + string: unit_amount=1000¤cy=usd&product=prod_IZPyHpMCl38iQl&nickname=Reservations+for+payment+schedule+5 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_zKIsh8lrMFOIBv","request_duration_ms":370}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:31 GMT + Content-Type: + - application/json + Content-Length: + - '466' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_CgvKpyLNeMIrZx + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "price_1J19Bz2sOmf47Nz9dLBSXfqB", + "object": "price", + "active": true, + "billing_scheme": "per_unit", + "created": 1623413431, + "currency": "usd", + "livemode": false, + "lookup_key": null, + "metadata": { + }, + "nickname": "Reservations for payment schedule 5", + "product": "prod_IZPyHpMCl38iQl", + "recurring": null, + "tiers_mode": null, + "transform_quantity": null, + "type": "one_time", + "unit_amount": 1000, + "unit_amount_decimal": "1000" + } + recorded_at: Fri, 11 Jun 2021 12:10:31 GMT +- request: + method: post + uri: https://api.stripe.com/v1/subscriptions + body: + encoding: UTF-8 + string: customer=cus_8E2ys9zDZgetWX&cancel_at=1652530228&add_invoice_items[0][price]=price_1J19Bz2sOmf47Nz9tj2Y133y&add_invoice_items[1][price]=price_1J19Bz2sOmf47Nz9dLBSXfqB&coupon=GIME3EUR&items[0][price]=price_1J19By2sOmf47Nz9KVhsAQuQ&default_payment_method=pm_1J19Bv2sOmf47Nz95pa9Kosw + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_CgvKpyLNeMIrZx","request_duration_ms":379}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:33 GMT + Content-Type: + - application/json + Content-Length: + - '3720' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_gqkPH6CSd618Au + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '2' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "sub_JeS63F3gpNRyDK", + "object": "subscription", + "application_fee_percent": null, + "billing": "charge_automatically", + "billing_cycle_anchor": 1623413431, + "billing_thresholds": null, + "cancel_at": 1652530228, + "cancel_at_period_end": false, + "canceled_at": 1623413431, + "collection_method": "charge_automatically", + "created": 1623413431, + "current_period_end": 1626005431, + "current_period_start": 1623413431, + "customer": "cus_8E2ys9zDZgetWX", + "days_until_due": null, + "default_payment_method": "pm_1J19Bv2sOmf47Nz95pa9Kosw", + "default_source": null, + "default_tax_rates": [ + + ], + "discount": null, + "ended_at": null, + "invoice_customer_balance_settings": { + "consume_applied_balance_on_void": true + }, + "items": { + "object": "list", + "data": [ + { + "id": "si_JeS6YPrUZsMh08", + "object": "subscription_item", + "billing_thresholds": null, + "created": 1623413432, + "metadata": { + }, + "plan": { + "id": "price_1J19By2sOmf47Nz9KVhsAQuQ", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623413430, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "price": { + "id": "price_1J19By2sOmf47Nz9KVhsAQuQ", + "object": "price", + "active": true, + "billing_scheme": "per_unit", + "created": 1623413430, + "currency": "usd", + "livemode": false, + "lookup_key": null, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "recurring": { + "aggregate_usage": null, + "interval": "month", + "interval_count": 1, + "trial_period_days": null, + "usage_type": "licensed" + }, + "tiers_mode": null, + "transform_quantity": null, + "type": "recurring", + "unit_amount": 9466, + "unit_amount_decimal": "9466" + }, + "quantity": 1, + "subscription": "sub_JeS63F3gpNRyDK", + "tax_rates": [ + + ] + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/subscription_items?subscription=sub_JeS63F3gpNRyDK" + }, + "latest_invoice": "in_1J19C02sOmf47Nz9FTsNKlC1", + "livemode": false, + "metadata": { + }, + "next_pending_invoice_item_invoice": null, + "pause_collection": null, + "pending_invoice_item_interval": null, + "pending_setup_intent": null, + "pending_update": null, + "plan": { + "id": "price_1J19By2sOmf47Nz9KVhsAQuQ", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623413430, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "quantity": 1, + "schedule": null, + "start": 1623413431, + "start_date": 1623413431, + "status": "active", + "tax_percent": null, + "transfer_data": null, + "trial_end": null, + "trial_start": null + } + recorded_at: Fri, 11 Jun 2021 12:10:33 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/reservations_training_subscription_with_payment_schedule.yml b/test/vcr_cassettes/reservations_training_subscription_with_payment_schedule.yml new file mode 100644 index 000000000..b712fcf84 --- /dev/null +++ b/test/vcr_cassettes/reservations_training_subscription_with_payment_schedule.yml @@ -0,0 +1,397 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.stripe.com/v1/setup_intents + body: + encoding: UTF-8 + string: customer=cus_8Di1wjdVktv5kt + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_594w2n9sMJ04sb","request_duration_ms":2412}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:07 GMT + Content-Type: + - application/json + Content-Length: + - '727' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_VmaVgUNab5kWyE + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "seti_1J19Bb2sOmf47Nz9e5fWkyQr", + "object": "setup_intent", + "application": null, + "cancellation_reason": null, + "client_secret": "seti_1J19Bb2sOmf47Nz9e5fWkyQr_secret_JeS5s1YAE1RSK0U0YE649p5Q1odHNji", + "created": 1623413407, + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "last_setup_error": null, + "latest_attempt": null, + "livemode": false, + "mandate": null, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": null, + "payment_method_options": { + "card": { + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "single_use_mandate": null, + "status": "requires_payment_method", + "usage": "off_session" + } + recorded_at: Fri, 11 Jun 2021 12:10:07 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_methods + body: + encoding: UTF-8 + string: type=card&card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_VmaVgUNab5kWyE","request_duration_ms":512}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:08 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_VVwdaGEN6s7X13 + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19Bb2sOmf47Nz9QJOVaEG2", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413408, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:10:08 GMT +- request: + method: post + uri: https://api.stripe.com/v1/setup_intents/seti_1J19Bb2sOmf47Nz9e5fWkyQr/confirm + body: + encoding: UTF-8 + string: payment_method=pm_1J19Bb2sOmf47Nz9QJOVaEG2 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_VVwdaGEN6s7X13","request_duration_ms":770}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:09 GMT + Content-Type: + - application/json + Content-Length: + - '767' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_XfPKIodlhEruhr + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "seti_1J19Bb2sOmf47Nz9e5fWkyQr", + "object": "setup_intent", + "application": null, + "cancellation_reason": null, + "client_secret": "seti_1J19Bb2sOmf47Nz9e5fWkyQr_secret_JeS5s1YAE1RSK0U0YE649p5Q1odHNji", + "created": 1623413407, + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "last_setup_error": null, + "latest_attempt": "setatt_1J19Bc2sOmf47Nz9AHdFck7H", + "livemode": false, + "mandate": null, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Bb2sOmf47Nz9QJOVaEG2", + "payment_method_options": { + "card": { + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "single_use_mandate": null, + "status": "succeeded", + "usage": "off_session" + } + recorded_at: Fri, 11 Jun 2021 12:10:09 GMT +- request: + method: get + uri: https://api.stripe.com/v1/setup_intents/seti_1J19Bb2sOmf47Nz9e5fWkyQr + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_XfPKIodlhEruhr","request_duration_ms":1460}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:10 GMT + Content-Type: + - application/json + Content-Length: + - '767' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_CTkdNA8UVkIfpV + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "seti_1J19Bb2sOmf47Nz9e5fWkyQr", + "object": "setup_intent", + "application": null, + "cancellation_reason": null, + "client_secret": "seti_1J19Bb2sOmf47Nz9e5fWkyQr_secret_JeS5s1YAE1RSK0U0YE649p5Q1odHNji", + "created": 1623413407, + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "last_setup_error": null, + "latest_attempt": "setatt_1J19Bc2sOmf47Nz9AHdFck7H", + "livemode": false, + "mandate": null, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Bb2sOmf47Nz9QJOVaEG2", + "payment_method_options": { + "card": { + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "single_use_mandate": null, + "status": "succeeded", + "usage": "off_session" + } + recorded_at: Fri, 11 Jun 2021 12:10:10 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/reservations_training_with_expired_coupon_error.yml b/test/vcr_cassettes/reservations_training_with_expired_coupon_error.yml new file mode 100644 index 000000000..7714730ce --- /dev/null +++ b/test/vcr_cassettes/reservations_training_with_expired_coupon_error.yml @@ -0,0 +1,227 @@ +--- +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]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_gqkPH6CSd618Au","request_duration_ms":1478}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:34 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_FcgDWIq3kqS48H + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19C12sOmf47Nz99tmSZZBw", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413434, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:10:34 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_methods + body: + encoding: UTF-8 + string: type=card&card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_FcgDWIq3kqS48H","request_duration_ms":729}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:35 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_iLsFVasH8kGMo7 + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19C22sOmf47Nz9mziFAxkf", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413434, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:10:35 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/reserve_event_with_many_prices_and_payment_means.yml b/test/vcr_cassettes/reserve_event_with_many_prices_and_payment_means.yml new file mode 100644 index 000000000..2c9280cee --- /dev/null +++ b/test/vcr_cassettes/reserve_event_with_many_prices_and_payment_means.yml @@ -0,0 +1,545 @@ +--- +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]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_L7oB3NXiThfKHq","request_duration_ms":495}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:43 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_fSlilY4QmcRBrG + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19CA2sOmf47Nz9QAcGcmzm", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413443, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:10:43 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: payment_method=pm_1J19CA2sOmf47Nz9QAcGcmzm&amount=42350¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8CzNtM08NVlSGN + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_fSlilY4QmcRBrG","request_duration_ms":667}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:44 GMT + Content-Type: + - application/json + Content-Length: + - '4263' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_qczTpZHX696x1C + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '8' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19CB2sOmf47Nz95Pnue8GO", + "object": "payment_intent", + "amount": 42350, + "amount_capturable": 0, + "amount_received": 42350, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19CC2sOmf47Nz9zKzuGzaE", + "object": "charge", + "amount": 42350, + "amount_captured": 42350, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19CC2sOmf47Nz9Ho6vuXlz", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413444, + "currency": "usd", + "customer": "cus_8CzNtM08NVlSGN", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 25, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19CB2sOmf47Nz95Pnue8GO", + "payment_method": "pm_1J19CA2sOmf47Nz9QAcGcmzm", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19CC2sOmf47Nz9zKzuGzaE/rcpt_JeS6wGn2PItr5O1sd4ygQPfg69amR09", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19CC2sOmf47Nz9zKzuGzaE/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19CB2sOmf47Nz95Pnue8GO" + }, + "client_secret": "pi_1J19CB2sOmf47Nz95Pnue8GO_secret_3BnhHPZLeU5k60tmFnNxF7rHD", + "confirmation_method": "manual", + "created": 1623413443, + "currency": "usd", + "customer": "cus_8CzNtM08NVlSGN", + "description": null, + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19CA2sOmf47Nz9QAcGcmzm", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:10:45 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents/pi_1J19CB2sOmf47Nz95Pnue8GO + body: + encoding: UTF-8 + string: description=Invoice+reference%3A+2106001%2FVL + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_qczTpZHX696x1C","request_duration_ms":1604}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:45 GMT + Content-Type: + - application/json + Content-Length: + - '4290' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_LGyzZDOSFlxowU + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19CB2sOmf47Nz95Pnue8GO", + "object": "payment_intent", + "amount": 42350, + "amount_capturable": 0, + "amount_received": 42350, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19CC2sOmf47Nz9zKzuGzaE", + "object": "charge", + "amount": 42350, + "amount_captured": 42350, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19CC2sOmf47Nz9Ho6vuXlz", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413444, + "currency": "usd", + "customer": "cus_8CzNtM08NVlSGN", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 25, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19CB2sOmf47Nz95Pnue8GO", + "payment_method": "pm_1J19CA2sOmf47Nz9QAcGcmzm", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19CC2sOmf47Nz9zKzuGzaE/rcpt_JeS6wGn2PItr5O1sd4ygQPfg69amR09", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19CC2sOmf47Nz9zKzuGzaE/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19CB2sOmf47Nz95Pnue8GO" + }, + "client_secret": "pi_1J19CB2sOmf47Nz95Pnue8GO_secret_3BnhHPZLeU5k60tmFnNxF7rHD", + "confirmation_method": "manual", + "created": 1623413443, + "currency": "usd", + "customer": "cus_8CzNtM08NVlSGN", + "description": "Invoice reference: 2106001/VL", + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19CA2sOmf47Nz9QAcGcmzm", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:10:45 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/reserve_event_with_many_prices_and_payment_means_retrieve_invoice_from_stripe.yml b/test/vcr_cassettes/reserve_event_with_many_prices_and_payment_means_retrieve_invoice_from_stripe.yml new file mode 100644 index 000000000..f8ae08482 --- /dev/null +++ b/test/vcr_cassettes/reserve_event_with_many_prices_and_payment_means_retrieve_invoice_from_stripe.yml @@ -0,0 +1,218 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.stripe.com/v1/payment_intents/pi_1J19CB2sOmf47Nz95Pnue8GO + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_LGyzZDOSFlxowU","request_duration_ms":464}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:10:46 GMT + Content-Type: + - application/json + Content-Length: + - '4290' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_oXt918i1vLvnCA + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19CB2sOmf47Nz95Pnue8GO", + "object": "payment_intent", + "amount": 42350, + "amount_capturable": 0, + "amount_received": 42350, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19CC2sOmf47Nz9zKzuGzaE", + "object": "charge", + "amount": 42350, + "amount_captured": 42350, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19CC2sOmf47Nz9Ho6vuXlz", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413444, + "currency": "usd", + "customer": "cus_8CzNtM08NVlSGN", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 25, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19CB2sOmf47Nz95Pnue8GO", + "payment_method": "pm_1J19CA2sOmf47Nz9QAcGcmzm", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19CC2sOmf47Nz9zKzuGzaE/rcpt_JeS6wGn2PItr5O1sd4ygQPfg69amR09", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19CC2sOmf47Nz9zKzuGzaE/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19CB2sOmf47Nz95Pnue8GO" + }, + "client_secret": "pi_1J19CB2sOmf47Nz95Pnue8GO_secret_3BnhHPZLeU5k60tmFnNxF7rHD", + "confirmation_method": "manual", + "created": 1623413443, + "currency": "usd", + "customer": "cus_8CzNtM08NVlSGN", + "description": "Invoice reference: 2106001/VL", + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19CA2sOmf47Nz9QAcGcmzm", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:10:46 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/subscriptions_admin_create_with_payment_schedule.yml b/test/vcr_cassettes/subscriptions_admin_create_with_payment_schedule.yml new file mode 100644 index 000000000..000e84b99 --- /dev/null +++ b/test/vcr_cassettes/subscriptions_admin_create_with_payment_schedule.yml @@ -0,0 +1,867 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.stripe.com/v1/setup_intents + body: + encoding: UTF-8 + string: customer=cus_8Di1wjdVktv5kt + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_inpFMpgIbPrF6S","request_duration_ms":494}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:09:15 GMT + Content-Type: + - application/json + Content-Length: + - '727' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_6M7lDp965gpF82 + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "seti_1J19Al2sOmf47Nz9beDznSBK", + "object": "setup_intent", + "application": null, + "cancellation_reason": null, + "client_secret": "seti_1J19Al2sOmf47Nz9beDznSBK_secret_JeS4dfGgFMQD3H6WynlWJei1Itpi0Na", + "created": 1623413355, + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "last_setup_error": null, + "latest_attempt": null, + "livemode": false, + "mandate": null, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": null, + "payment_method_options": { + "card": { + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "single_use_mandate": null, + "status": "requires_payment_method", + "usage": "off_session" + } + recorded_at: Fri, 11 Jun 2021 12:09:15 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_methods + body: + encoding: UTF-8 + string: type=card&card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_6M7lDp965gpF82","request_duration_ms":409}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:09:16 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_fZzQCNV669EXoP + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19Am2sOmf47Nz9JfmnAIrS", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413356, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:09:16 GMT +- request: + method: post + uri: https://api.stripe.com/v1/setup_intents/seti_1J19Al2sOmf47Nz9beDznSBK/confirm + body: + encoding: UTF-8 + string: payment_method=pm_1J19Am2sOmf47Nz9JfmnAIrS + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_fZzQCNV669EXoP","request_duration_ms":615}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:09:17 GMT + Content-Type: + - application/json + Content-Length: + - '767' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_WemVZGuhC43fCy + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "seti_1J19Al2sOmf47Nz9beDznSBK", + "object": "setup_intent", + "application": null, + "cancellation_reason": null, + "client_secret": "seti_1J19Al2sOmf47Nz9beDznSBK_secret_JeS4dfGgFMQD3H6WynlWJei1Itpi0Na", + "created": 1623413355, + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "last_setup_error": null, + "latest_attempt": "setatt_1J19Am2sOmf47Nz9sgVG2rWN", + "livemode": false, + "mandate": null, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Am2sOmf47Nz9JfmnAIrS", + "payment_method_options": { + "card": { + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "single_use_mandate": null, + "status": "succeeded", + "usage": "off_session" + } + recorded_at: Fri, 11 Jun 2021 12:09:17 GMT +- request: + method: get + uri: https://api.stripe.com/v1/setup_intents/seti_1J19Al2sOmf47Nz9beDznSBK + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_WemVZGuhC43fCy","request_duration_ms":1147}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:09:18 GMT + Content-Type: + - application/json + Content-Length: + - '767' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_w6JI1oJhcSXQ8X + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "seti_1J19Al2sOmf47Nz9beDznSBK", + "object": "setup_intent", + "application": null, + "cancellation_reason": null, + "client_secret": "seti_1J19Al2sOmf47Nz9beDznSBK_secret_JeS4dfGgFMQD3H6WynlWJei1Itpi0Na", + "created": 1623413355, + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "last_setup_error": null, + "latest_attempt": "setatt_1J19Am2sOmf47Nz9sgVG2rWN", + "livemode": false, + "mandate": null, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Am2sOmf47Nz9JfmnAIrS", + "payment_method_options": { + "card": { + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "single_use_mandate": null, + "status": "succeeded", + "usage": "off_session" + } + recorded_at: Fri, 11 Jun 2021 12:09:18 GMT +- request: + method: get + uri: https://api.stripe.com/v1/setup_intents/seti_1J19Al2sOmf47Nz9beDznSBK + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_w6JI1oJhcSXQ8X","request_duration_ms":406}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:09:18 GMT + Content-Type: + - application/json + Content-Length: + - '767' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_jkI9KMhzvN1qkB + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "seti_1J19Al2sOmf47Nz9beDznSBK", + "object": "setup_intent", + "application": null, + "cancellation_reason": null, + "client_secret": "seti_1J19Al2sOmf47Nz9beDznSBK_secret_JeS4dfGgFMQD3H6WynlWJei1Itpi0Na", + "created": 1623413355, + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "last_setup_error": null, + "latest_attempt": "setatt_1J19Am2sOmf47Nz9sgVG2rWN", + "livemode": false, + "mandate": null, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Am2sOmf47Nz9JfmnAIrS", + "payment_method_options": { + "card": { + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "single_use_mandate": null, + "status": "succeeded", + "usage": "off_session" + } + recorded_at: Fri, 11 Jun 2021 12:09:18 GMT +- request: + method: post + uri: https://api.stripe.com/v1/prices + body: + encoding: UTF-8 + string: unit_amount=9466¤cy=usd&product=prod_IZQAhb9nLu4jfN&recurring[interval]=month&recurring[interval_count]=1 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_jkI9KMhzvN1qkB","request_duration_ms":366}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:09:19 GMT + Content-Type: + - application/json + Content-Length: + - '574' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_wEV0utkuydCzBS + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "price_1J19Ao2sOmf47Nz9CKS2E04T", + "object": "price", + "active": true, + "billing_scheme": "per_unit", + "created": 1623413358, + "currency": "usd", + "livemode": false, + "lookup_key": null, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "recurring": { + "aggregate_usage": null, + "interval": "month", + "interval_count": 1, + "trial_period_days": null, + "usage_type": "licensed" + }, + "tiers_mode": null, + "transform_quantity": null, + "type": "recurring", + "unit_amount": 9466, + "unit_amount_decimal": "9466" + } + recorded_at: Fri, 11 Jun 2021 12:09:19 GMT +- request: + method: post + uri: https://api.stripe.com/v1/prices + body: + encoding: UTF-8 + string: unit_amount=8¤cy=usd&product=prod_IZQAhb9nLu4jfN&nickname=Price+adjustment+for+payment+schedule+3 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_wEV0utkuydCzBS","request_duration_ms":427}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:09:19 GMT + Content-Type: + - application/json + Content-Length: + - '464' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_jFKCIQI2qbN32x + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "price_1J19Ap2sOmf47Nz9XPnavXfk", + "object": "price", + "active": true, + "billing_scheme": "per_unit", + "created": 1623413359, + "currency": "usd", + "livemode": false, + "lookup_key": null, + "metadata": { + }, + "nickname": "Price adjustment for payment schedule 3", + "product": "prod_IZQAhb9nLu4jfN", + "recurring": null, + "tiers_mode": null, + "transform_quantity": null, + "type": "one_time", + "unit_amount": 8, + "unit_amount_decimal": "8" + } + recorded_at: Fri, 11 Jun 2021 12:09:19 GMT +- request: + method: post + uri: https://api.stripe.com/v1/subscriptions + body: + encoding: UTF-8 + string: customer=cus_8Di1wjdVktv5kt&cancel_at=1652530158&add_invoice_items[0][price]=price_1J19Ap2sOmf47Nz9XPnavXfk&items[0][price]=price_1J19Ao2sOmf47Nz9CKS2E04T&default_payment_method=pm_1J19Am2sOmf47Nz9JfmnAIrS + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_jFKCIQI2qbN32x","request_duration_ms":373}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:09:21 GMT + Content-Type: + - application/json + Content-Length: + - '3720' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_594w2n9sMJ04sb + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '9' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "sub_JeS4yyUKfhPlFm", + "object": "subscription", + "application_fee_percent": null, + "billing": "charge_automatically", + "billing_cycle_anchor": 1623413359, + "billing_thresholds": null, + "cancel_at": 1652530158, + "cancel_at_period_end": false, + "canceled_at": 1623413359, + "collection_method": "charge_automatically", + "created": 1623413359, + "current_period_end": 1626005359, + "current_period_start": 1623413359, + "customer": "cus_8Di1wjdVktv5kt", + "days_until_due": null, + "default_payment_method": "pm_1J19Am2sOmf47Nz9JfmnAIrS", + "default_source": null, + "default_tax_rates": [ + + ], + "discount": null, + "ended_at": null, + "invoice_customer_balance_settings": { + "consume_applied_balance_on_void": true + }, + "items": { + "object": "list", + "data": [ + { + "id": "si_JeS44tuhbqzlrx", + "object": "subscription_item", + "billing_thresholds": null, + "created": 1623413360, + "metadata": { + }, + "plan": { + "id": "price_1J19Ao2sOmf47Nz9CKS2E04T", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623413358, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "price": { + "id": "price_1J19Ao2sOmf47Nz9CKS2E04T", + "object": "price", + "active": true, + "billing_scheme": "per_unit", + "created": 1623413358, + "currency": "usd", + "livemode": false, + "lookup_key": null, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "recurring": { + "aggregate_usage": null, + "interval": "month", + "interval_count": 1, + "trial_period_days": null, + "usage_type": "licensed" + }, + "tiers_mode": null, + "transform_quantity": null, + "type": "recurring", + "unit_amount": 9466, + "unit_amount_decimal": "9466" + }, + "quantity": 1, + "subscription": "sub_JeS4yyUKfhPlFm", + "tax_rates": [ + + ] + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/subscription_items?subscription=sub_JeS4yyUKfhPlFm" + }, + "latest_invoice": "in_1J19Ap2sOmf47Nz9ys8nxdYf", + "livemode": false, + "metadata": { + }, + "next_pending_invoice_item_invoice": null, + "pause_collection": null, + "pending_invoice_item_interval": null, + "pending_setup_intent": null, + "pending_update": null, + "plan": { + "id": "price_1J19Ao2sOmf47Nz9CKS2E04T", + "object": "plan", + "active": true, + "aggregate_usage": null, + "amount": 9466, + "amount_decimal": "9466", + "billing_scheme": "per_unit", + "created": 1623413358, + "currency": "usd", + "interval": "month", + "interval_count": 1, + "livemode": false, + "metadata": { + }, + "nickname": null, + "product": "prod_IZQAhb9nLu4jfN", + "tiers": null, + "tiers_mode": null, + "transform_usage": null, + "trial_period_days": null, + "usage_type": "licensed" + }, + "quantity": 1, + "schedule": null, + "start": 1623413359, + "start_date": 1623413359, + "status": "active", + "tax_percent": null, + "transfer_data": null, + "trial_end": null, + "trial_start": null + } + recorded_at: Fri, 11 Jun 2021 12:09:21 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/subscriptions_user_create_failed.yml b/test/vcr_cassettes/subscriptions_user_create_failed.yml new file mode 100644 index 000000000..068d31cfc --- /dev/null +++ b/test/vcr_cassettes/subscriptions_user_create_failed.yml @@ -0,0 +1,115 @@ +--- +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]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_qIUfIdUDRc3Mw0","request_duration_ms":692}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:09:04 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_HBrUqwklJKtARM + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19Aa2sOmf47Nz9YYSWwQVx", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413344, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:09:04 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/subscriptions_user_create_success.yml b/test/vcr_cassettes/subscriptions_user_create_success.yml new file mode 100644 index 000000000..ef5a70fff --- /dev/null +++ b/test/vcr_cassettes/subscriptions_user_create_success.yml @@ -0,0 +1,545 @@ +--- +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]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_0V6xYAVUmDrPet","request_duration_ms":625}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:09:12 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_tYL1AMKfStlO8R + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19Ai2sOmf47Nz9uWHuxZ8k", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413352, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:09:12 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: payment_method=pm_1J19Ai2sOmf47Nz9uWHuxZ8k&amount=3000¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8Di1wjdVktv5kt + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_tYL1AMKfStlO8R","request_duration_ms":625}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:09:14 GMT + Content-Type: + - application/json + Content-Length: + - '4259' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_Ul7gAWa5VKha6H + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '8' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19Ai2sOmf47Nz9pZqIwkFg", + "object": "payment_intent", + "amount": 3000, + "amount_capturable": 0, + "amount_received": 3000, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19Aj2sOmf47Nz91o4BAj1T", + "object": "charge", + "amount": 3000, + "amount_captured": 3000, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19Aj2sOmf47Nz9b4Lksm36", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413353, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 39, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19Ai2sOmf47Nz9pZqIwkFg", + "payment_method": "pm_1J19Ai2sOmf47Nz9uWHuxZ8k", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19Aj2sOmf47Nz91o4BAj1T/rcpt_JeS4hKozkNLtAZ8PW5b64g5PWK56hFY", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19Aj2sOmf47Nz91o4BAj1T/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19Ai2sOmf47Nz9pZqIwkFg" + }, + "client_secret": "pi_1J19Ai2sOmf47Nz9pZqIwkFg_secret_hFTrCs4qBeKreBGaNBJYLoCAv", + "confirmation_method": "manual", + "created": 1623413352, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Ai2sOmf47Nz9uWHuxZ8k", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:09:14 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents/pi_1J19Ai2sOmf47Nz9pZqIwkFg + body: + encoding: UTF-8 + string: description=Invoice+reference%3A+2106001%2FVL + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_Ul7gAWa5VKha6H","request_duration_ms":1542}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:09:14 GMT + Content-Type: + - application/json + Content-Length: + - '4286' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_inpFMpgIbPrF6S + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19Ai2sOmf47Nz9pZqIwkFg", + "object": "payment_intent", + "amount": 3000, + "amount_capturable": 0, + "amount_received": 3000, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19Aj2sOmf47Nz91o4BAj1T", + "object": "charge", + "amount": 3000, + "amount_captured": 3000, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19Aj2sOmf47Nz9b4Lksm36", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413353, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 39, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19Ai2sOmf47Nz9pZqIwkFg", + "payment_method": "pm_1J19Ai2sOmf47Nz9uWHuxZ8k", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19Aj2sOmf47Nz91o4BAj1T/rcpt_JeS4hKozkNLtAZ8PW5b64g5PWK56hFY", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19Aj2sOmf47Nz91o4BAj1T/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19Ai2sOmf47Nz9pZqIwkFg" + }, + "client_secret": "pi_1J19Ai2sOmf47Nz9pZqIwkFg_secret_hFTrCs4qBeKreBGaNBJYLoCAv", + "confirmation_method": "manual", + "created": 1623413352, + "currency": "usd", + "customer": "cus_8Di1wjdVktv5kt", + "description": "Invoice reference: 2106001/VL", + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Ai2sOmf47Nz9uWHuxZ8k", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:09:14 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/subscriptions_user_create_success_with_wallet.yml b/test/vcr_cassettes/subscriptions_user_create_success_with_wallet.yml new file mode 100644 index 000000000..1c74f368c --- /dev/null +++ b/test/vcr_cassettes/subscriptions_user_create_success_with_wallet.yml @@ -0,0 +1,545 @@ +--- +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]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_G0tnm0VQO3r3dU","request_duration_ms":373}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:09:08 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_X40OMk9FvKQB5A + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19Ae2sOmf47Nz9yua627ey", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413348, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:09:08 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: payment_method=pm_1J19Ae2sOmf47Nz9yua627ey&amount=1000¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_8CzNtM08NVlSGN + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_X40OMk9FvKQB5A","request_duration_ms":773}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:09:10 GMT + Content-Type: + - application/json + Content-Length: + - '4259' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_wLEuitfaayuEHb + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '8' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19Af2sOmf47Nz9VOsV5HkN", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_received": 1000, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19Af2sOmf47Nz9MYMkV7UD", + "object": "charge", + "amount": 1000, + "amount_captured": 1000, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19Ag2sOmf47Nz9fTiNaIh8", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413349, + "currency": "usd", + "customer": "cus_8CzNtM08NVlSGN", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 45, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19Af2sOmf47Nz9VOsV5HkN", + "payment_method": "pm_1J19Ae2sOmf47Nz9yua627ey", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19Af2sOmf47Nz9MYMkV7UD/rcpt_JeS4Sb4relsWCBTazwYV1SQ77PqL9NY", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19Af2sOmf47Nz9MYMkV7UD/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19Af2sOmf47Nz9VOsV5HkN" + }, + "client_secret": "pi_1J19Af2sOmf47Nz9VOsV5HkN_secret_UjJa9Jo5YhvxAF9e0Q7by6VoI", + "confirmation_method": "manual", + "created": 1623413349, + "currency": "usd", + "customer": "cus_8CzNtM08NVlSGN", + "description": null, + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Ae2sOmf47Nz9yua627ey", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:09:10 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents/pi_1J19Af2sOmf47Nz9VOsV5HkN + body: + encoding: UTF-8 + string: description=Invoice+reference%3A+2106001%2FVL + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_wLEuitfaayuEHb","request_duration_ms":2080}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:09:11 GMT + Content-Type: + - application/json + Content-Length: + - '4286' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_0V6xYAVUmDrPet + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19Af2sOmf47Nz9VOsV5HkN", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_received": 1000, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19Af2sOmf47Nz9MYMkV7UD", + "object": "charge", + "amount": 1000, + "amount_captured": 1000, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19Ag2sOmf47Nz9fTiNaIh8", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413349, + "currency": "usd", + "customer": "cus_8CzNtM08NVlSGN", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 45, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19Af2sOmf47Nz9VOsV5HkN", + "payment_method": "pm_1J19Ae2sOmf47Nz9yua627ey", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19Af2sOmf47Nz9MYMkV7UD/rcpt_JeS4Sb4relsWCBTazwYV1SQ77PqL9NY", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19Af2sOmf47Nz9MYMkV7UD/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19Af2sOmf47Nz9VOsV5HkN" + }, + "client_secret": "pi_1J19Af2sOmf47Nz9VOsV5HkN_secret_UjJa9Jo5YhvxAF9e0Q7by6VoI", + "confirmation_method": "manual", + "created": 1623413349, + "currency": "usd", + "customer": "cus_8CzNtM08NVlSGN", + "description": "Invoice reference: 2106001/VL", + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Ae2sOmf47Nz9yua627ey", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:09:11 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/subscriptions_user_create_with_payment_schedule.yml b/test/vcr_cassettes/subscriptions_user_create_with_payment_schedule.yml new file mode 100644 index 000000000..b3704139d --- /dev/null +++ b/test/vcr_cassettes/subscriptions_user_create_with_payment_schedule.yml @@ -0,0 +1,397 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.stripe.com/v1/setup_intents + body: + encoding: UTF-8 + string: customer=cus_8Di1wjdVktv5kt + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_HBrUqwklJKtARM","request_duration_ms":767}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:09:05 GMT + Content-Type: + - application/json + Content-Length: + - '727' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_p6Apfsnlx1CpbR + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "seti_1J19Ab2sOmf47Nz9h2tL8C07", + "object": "setup_intent", + "application": null, + "cancellation_reason": null, + "client_secret": "seti_1J19Ab2sOmf47Nz9h2tL8C07_secret_JeS401DqKAd2VXxeMxzsxTpnaO6MeEt", + "created": 1623413345, + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "last_setup_error": null, + "latest_attempt": null, + "livemode": false, + "mandate": null, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": null, + "payment_method_options": { + "card": { + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "single_use_mandate": null, + "status": "requires_payment_method", + "usage": "off_session" + } + recorded_at: Fri, 11 Jun 2021 12:09:05 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_methods + body: + encoding: UTF-8 + string: type=card&card[number]=4242424242424242&card[exp_month]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_p6Apfsnlx1CpbR","request_duration_ms":379}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:09:05 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_kAlVB5R4y03z5o + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19Ab2sOmf47Nz9nz3zz3IE", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413345, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:09:06 GMT +- request: + method: post + uri: https://api.stripe.com/v1/setup_intents/seti_1J19Ab2sOmf47Nz9h2tL8C07/confirm + body: + encoding: UTF-8 + string: payment_method=pm_1J19Ab2sOmf47Nz9nz3zz3IE + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_kAlVB5R4y03z5o","request_duration_ms":663}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:09:07 GMT + Content-Type: + - application/json + Content-Length: + - '767' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_XvzkN1j4rxaOYm + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "seti_1J19Ab2sOmf47Nz9h2tL8C07", + "object": "setup_intent", + "application": null, + "cancellation_reason": null, + "client_secret": "seti_1J19Ab2sOmf47Nz9h2tL8C07_secret_JeS401DqKAd2VXxeMxzsxTpnaO6MeEt", + "created": 1623413345, + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "last_setup_error": null, + "latest_attempt": "setatt_1J19Ac2sOmf47Nz9TIyXetTy", + "livemode": false, + "mandate": null, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Ab2sOmf47Nz9nz3zz3IE", + "payment_method_options": { + "card": { + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "single_use_mandate": null, + "status": "succeeded", + "usage": "off_session" + } + recorded_at: Fri, 11 Jun 2021 12:09:07 GMT +- request: + method: get + uri: https://api.stripe.com/v1/setup_intents/seti_1J19Ab2sOmf47Nz9h2tL8C07 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_XvzkN1j4rxaOYm","request_duration_ms":1279}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:09:07 GMT + Content-Type: + - application/json + Content-Length: + - '767' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_G0tnm0VQO3r3dU + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "seti_1J19Ab2sOmf47Nz9h2tL8C07", + "object": "setup_intent", + "application": null, + "cancellation_reason": null, + "client_secret": "seti_1J19Ab2sOmf47Nz9h2tL8C07_secret_JeS401DqKAd2VXxeMxzsxTpnaO6MeEt", + "created": 1623413345, + "customer": "cus_8Di1wjdVktv5kt", + "description": null, + "last_setup_error": null, + "latest_attempt": "setatt_1J19Ac2sOmf47Nz9TIyXetTy", + "livemode": false, + "mandate": null, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19Ab2sOmf47Nz9nz3zz3IE", + "payment_method_options": { + "card": { + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "single_use_mandate": null, + "status": "succeeded", + "usage": "off_session" + } + recorded_at: Fri, 11 Jun 2021 12:09:07 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/subscriptions_user_renew_failed.yml b/test/vcr_cassettes/subscriptions_user_renew_failed.yml new file mode 100644 index 000000000..ded98b81c --- /dev/null +++ b/test/vcr_cassettes/subscriptions_user_renew_failed.yml @@ -0,0 +1,443 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.stripe.com/v1/payment_methods + body: + encoding: UTF-8 + string: type=card&card[number]=4000000000000002&card[exp_month]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_GFlLvxvRfOubCx","request_duration_ms":550}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:08:52 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_qIUfIdUDRc3Mw0 + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19AN2sOmf47Nz9q4BTJ3Xx", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "xsVM9Mfv9kfwhRSL", + "funding": "credit", + "generated_from": null, + "last4": "0002", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413331, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:08:52 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: payment_method=pm_1J19AN2sOmf47Nz9q4BTJ3Xx&amount=3000¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_IhIynmoJbzLpwX + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_qIUfIdUDRc3Mw0","request_duration_ms":692}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 402 + message: Payment Required + headers: + Server: + - nginx + Date: + - Fri, 11 Jun 2021 12:08:53 GMT + Content-Type: + - application/json + Content-Length: + - '7831' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_CpPzkd37QFGb1n + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '7' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "error": { + "charge": "ch_1J19AO2sOmf47Nz9Ko0nAR2K", + "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_1J19AO2sOmf47Nz9owzfK8w8", + "object": "payment_intent", + "amount": 3000, + "amount_capturable": 0, + "amount_received": 0, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19AO2sOmf47Nz9Ko0nAR2K", + "object": "charge", + "amount": 3000, + "amount_captured": 0, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": null, + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": false, + "created": 1623413332, + "currency": "usd", + "customer": "cus_IhIynmoJbzLpwX", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": "card_declined", + "failure_message": "Your card was declined.", + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "declined_by_network", + "reason": "generic_decline", + "risk_level": "normal", + "risk_score": 62, + "seller_message": "The bank did not return any further details with this decline.", + "type": "issuer_declined" + }, + "paid": false, + "payment_intent": "pi_1J19AO2sOmf47Nz9owzfK8w8", + "payment_method": "pm_1J19AN2sOmf47Nz9q4BTJ3Xx", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "xsVM9Mfv9kfwhRSL", + "funding": "credit", + "installments": null, + "last4": "0002", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": null, + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19AO2sOmf47Nz9Ko0nAR2K/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "failed", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19AO2sOmf47Nz9owzfK8w8" + }, + "client_secret": "pi_1J19AO2sOmf47Nz9owzfK8w8_secret_wm0gJAp5vBQX2rMzNFzBSGbhh", + "confirmation_method": "manual", + "created": 1623413332, + "currency": "usd", + "customer": "cus_IhIynmoJbzLpwX", + "description": null, + "invoice": null, + "last_payment_error": { + "charge": "ch_1J19AO2sOmf47Nz9Ko0nAR2K", + "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_1J19AN2sOmf47Nz9q4BTJ3Xx", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "xsVM9Mfv9kfwhRSL", + "funding": "credit", + "generated_from": null, + "last4": "0002", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413331, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + }, + "type": "card_error" + }, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": null, + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "requires_payment_method", + "transfer_data": null, + "transfer_group": null + }, + "payment_method": { + "id": "pm_1J19AN2sOmf47Nz9q4BTJ3Xx", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "xsVM9Mfv9kfwhRSL", + "funding": "credit", + "generated_from": null, + "last4": "0002", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413331, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + }, + "type": "card_error" + } + } + recorded_at: Fri, 11 Jun 2021 12:08:53 GMT +recorded_with: VCR 6.0.0 diff --git a/test/vcr_cassettes/subscriptions_user_renew_success.yml b/test/vcr_cassettes/subscriptions_user_renew_success.yml new file mode 100644 index 000000000..7c268d5b3 --- /dev/null +++ b/test/vcr_cassettes/subscriptions_user_renew_success.yml @@ -0,0 +1,545 @@ +--- +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]=4&card[exp_year]=2022&card[cvc]=314 + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_MaUUH4M7ExplWM","request_duration_ms":1}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:08:48 GMT + Content-Type: + - application/json + Content-Length: + - '934' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_4vUJStZEVaRu25 + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '4' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pm_1J19AK2sOmf47Nz99SmIMRsZ", + "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", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "generated_from": null, + "last4": "4242", + "networks": { + "available": [ + "visa" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1623413328, + "customer": null, + "livemode": false, + "metadata": { + }, + "type": "card" + } + recorded_at: Fri, 11 Jun 2021 12:08:48 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: payment_method=pm_1J19AK2sOmf47Nz99SmIMRsZ&amount=3000¤cy=usd&confirmation_method=manual&confirm=true&customer=cus_IhIynmoJbzLpwX + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_4vUJStZEVaRu25","request_duration_ms":721}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:08:50 GMT + Content-Type: + - application/json + Content-Length: + - '4259' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_pAhJGqI87wbmeo + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '8' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19AL2sOmf47Nz9Ni5vAjHE", + "object": "payment_intent", + "amount": 3000, + "amount_capturable": 0, + "amount_received": 3000, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19AL2sOmf47Nz9dl7fx35v", + "object": "charge", + "amount": 3000, + "amount_captured": 3000, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19AL2sOmf47Nz9GmyGY5vi", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413329, + "currency": "usd", + "customer": "cus_IhIynmoJbzLpwX", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 47, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19AL2sOmf47Nz9Ni5vAjHE", + "payment_method": "pm_1J19AK2sOmf47Nz99SmIMRsZ", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19AL2sOmf47Nz9dl7fx35v/rcpt_JeS4Q6iG2LjP7BNQdlMwvy12ZrLbCDV", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19AL2sOmf47Nz9dl7fx35v/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19AL2sOmf47Nz9Ni5vAjHE" + }, + "client_secret": "pi_1J19AL2sOmf47Nz9Ni5vAjHE_secret_7cKwvm1EkX9mb1mqnf5V3CibJ", + "confirmation_method": "manual", + "created": 1623413329, + "currency": "usd", + "customer": "cus_IhIynmoJbzLpwX", + "description": null, + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19AK2sOmf47Nz99SmIMRsZ", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:08:50 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents/pi_1J19AL2sOmf47Nz9Ni5vAjHE + body: + encoding: UTF-8 + string: description=Invoice+reference%3A+2106001%2FVL + headers: + User-Agent: + - Stripe/v1 RubyBindings/5.29.0 + Authorization: + - Bearer sk_test_testfaketestfaketestfake + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_pAhJGqI87wbmeo","request_duration_ms":1524}}' + Stripe-Version: + - '2019-08-14' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"5.29.0","lang":"ruby","lang_version":"2.6.7 p197 (2021-04-05)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.12.9-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) + 2.36.1) #1 SMP PREEMPT Thu, 03 Jun 2021 11:36:13 +0000","hostname":"Sylvain-desktop"}' + 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: + - Fri, 11 Jun 2021 12:08:50 GMT + Content-Type: + - application/json + Content-Length: + - '4286' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET, POST, HEAD, OPTIONS, DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Request-Id: + - req_GFlLvxvRfOubCx + Stripe-Version: + - '2019-08-14' + X-Stripe-C-Cost: + - '0' + Strict-Transport-Security: + - max-age=31556926; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + { + "id": "pi_1J19AL2sOmf47Nz9Ni5vAjHE", + "object": "payment_intent", + "amount": 3000, + "amount_capturable": 0, + "amount_received": 3000, + "application": null, + "application_fee_amount": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_1J19AL2sOmf47Nz9dl7fx35v", + "object": "charge", + "amount": 3000, + "amount_captured": 3000, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_1J19AL2sOmf47Nz9GmyGY5vi", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "calculated_statement_descriptor": "Stripe", + "captured": true, + "created": 1623413329, + "currency": "usd", + "customer": "cus_IhIynmoJbzLpwX", + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_code": null, + "failure_message": null, + "fraud_details": { + }, + "invoice": null, + "livemode": false, + "metadata": { + }, + "on_behalf_of": null, + "order": null, + "outcome": { + "network_status": "approved_by_network", + "reason": null, + "risk_level": "normal", + "risk_score": 47, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_1J19AL2sOmf47Nz9Ni5vAjHE", + "payment_method": "pm_1J19AK2sOmf47Nz99SmIMRsZ", + "payment_method_details": { + "card": { + "brand": "visa", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 4, + "exp_year": 2022, + "fingerprint": "o52jybR7bnmNn6AT", + "funding": "credit", + "installments": null, + "last4": "4242", + "network": "visa", + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/acct_103rE62sOmf47Nz9/ch_1J19AL2sOmf47Nz9dl7fx35v/rcpt_JeS4Q6iG2LjP7BNQdlMwvy12ZrLbCDV", + "refunded": false, + "refunds": { + "object": "list", + "data": [ + + ], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_1J19AL2sOmf47Nz9dl7fx35v/refunds" + }, + "review": null, + "shipping": null, + "source": null, + "source_transfer": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges?payment_intent=pi_1J19AL2sOmf47Nz9Ni5vAjHE" + }, + "client_secret": "pi_1J19AL2sOmf47Nz9Ni5vAjHE_secret_7cKwvm1EkX9mb1mqnf5V3CibJ", + "confirmation_method": "manual", + "created": 1623413329, + "currency": "usd", + "customer": "cus_IhIynmoJbzLpwX", + "description": "Invoice reference: 2106001/VL", + "invoice": null, + "last_payment_error": null, + "livemode": false, + "metadata": { + }, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1J19AK2sOmf47Nz99SmIMRsZ", + "payment_method_options": { + "card": { + "installments": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Fri, 11 Jun 2021 12:08:50 GMT +recorded_with: VCR 6.0.0