diff --git a/app/models/spree/gateway/stripe_sca.rb b/app/models/spree/gateway/stripe_sca.rb index b4a3ea95b4..c137734ba2 100644 --- a/app/models/spree/gateway/stripe_sca.rb +++ b/app/models/spree/gateway/stripe_sca.rb @@ -4,7 +4,6 @@ require 'stripe/profile_storer' require 'stripe/credit_card_cloner' require 'stripe/authorize_response_patcher' require 'stripe/payment_intent_validator' -require 'active_merchant/billing/gateways/stripe_payment_intents_decorator' require 'active_merchant/billing/gateways/stripe' module Spree @@ -87,6 +86,7 @@ module Spree # NOTE: the name of this method is determined by Spree::Payment::Processing def void(response_code, _creditcard, gateway_options) payment_intent_id = response_code + payment_intent_response = Stripe::PaymentIntent.retrieve(payment_intent_id, stripe_account: stripe_account_id) gateway_options[:stripe_account] = stripe_account_id @@ -95,8 +95,7 @@ module Spree if voidable?(payment_intent_response) provider.void(response_code, gateway_options) else - provider.refund(refundable_amount(payment_intent_response), response_code, - gateway_options) + provider.refund(payment_intent_response.amount_received, response_code, gateway_options) end end @@ -119,11 +118,6 @@ module Spree VOIDABLE_STATES.include? payment_intent_response.status end - def refundable_amount(payment_intent_response) - payment_intent_response.amount_received - - payment_intent_response.charges.data.map(&:amount_refunded).sum - end - # In this gateway, what we call 'secret_key' is the 'login' def options options = super diff --git a/lib/active_merchant/billing/gateways/stripe_payment_intents_decorator.rb b/lib/active_merchant/billing/gateways/stripe_payment_intents_decorator.rb deleted file mode 100644 index bee22c7082..0000000000 --- a/lib/active_merchant/billing/gateways/stripe_payment_intents_decorator.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -ActiveMerchant::Billing::StripePaymentIntentsGateway.class_eval do - CREATE_INTENT_ATTRIBUTES = - %i[description statement_descriptor receipt_email save_payment_method].freeze - - def refund(money, intent_id, options = {}) - intent = commit(:get, "payment_intents/#{intent_id}", nil, options) - charge_id = intent.params.dig('charges', 'data')[0]['id'] - super(money, charge_id, options) - end - - private - - def add_connected_account(post, options = {}) - return unless transfer_data = options[:transfer_data] - - post[:transfer_data] = {} - if transfer_data[:destination] - post[:transfer_data][:destination] = transfer_data[:destination] - end - post[:transfer_data][:amount] = transfer_data[:amount] if transfer_data[:amount] - post[:on_behalf_of] = options[:on_behalf_of] if options[:on_behalf_of] - post[:transfer_group] = options[:transfer_group] if options[:transfer_group] - post[:application_fee_amount] = options[:application_fee] if options[:application_fee] - post - end -end diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.2.0/Spree_Gateway_StripeSCA/_void/with_a_confirmed_payment/refunds_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v10.2.0/Spree_Gateway_StripeSCA/_void/with_a_confirmed_payment/refunds_the_payment.yml new file mode 100644 index 0000000000..c3cce8b8a6 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/Stripe-v10.2.0/Spree_Gateway_StripeSCA/_void/with_a_confirmed_payment/refunds_the_payment.yml @@ -0,0 +1,1149 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.stripe.com/v1/payment_methods/pm_card_mastercard + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/10.2.0 + Authorization: + - Bearer + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_RQ4tnyZMxaTrfg","request_duration_ms":920}}' + Stripe-Version: + - '2023-10-16' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"10.2.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 12 Feb 2024 03:46:37 GMT + Content-Type: + - application/json + Content-Length: + - '942' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods%2F%3Apayment_method; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Request-Id: + - req_AMPupOEWxQpMvJ + Stripe-Version: + - '2023-10-16' + Vary: + - Origin + X-Stripe-Non-Api-Overhead-Duration-Ms: + - '140.0' + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pm_1OiqTZGkyVbTBiYeSbdHHVBU", + "object": "payment_method", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "card": { + "brand": "mastercard", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "unchecked" + }, + "country": "US", + "exp_month": 2, + "exp_year": 2025, + "fingerprint": "1Zr75a6zBSZLu0Zp", + "funding": "credit", + "generated_from": null, + "last4": "4444", + "networks": { + "available": [ + "mastercard" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1707709597, + "customer": null, + "livemode": false, + "metadata": {}, + "type": "card" + } + recorded_at: Mon, 12 Feb 2024 03:46:37 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: amount=1000¤cy=aud&payment_method=pm_card_mastercard&payment_method_types[0]=card&capture_method=manual + headers: + User-Agent: + - Stripe/v1 RubyBindings/10.2.0 + Authorization: + - Bearer + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_AMPupOEWxQpMvJ","request_duration_ms":356}}' + Stripe-Version: + - '2023-10-16' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"10.2.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + Stripe-Account: + - acct_1APQreGkyVbTBiYe + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 12 Feb 2024 03:46:38 GMT + Content-Type: + - application/json + Content-Length: + - '1344' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Idempotency-Key: + - 65755257-63df-450c-9bf4-90d6512d869a + Original-Request: + - req_Y9z6pafg0X39IU + Request-Id: + - req_Y9z6pafg0X39IU + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2023-10-16' + Vary: + - Origin + X-Stripe-Non-Api-Overhead-Duration-Ms: + - '306.0' + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pi_3OiqTaGkyVbTBiYe0nUcBPZV", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_details": { + "tip": {} + }, + "amount_received": 0, + "application": null, + "application_fee_amount": null, + "automatic_payment_methods": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "manual", + "client_secret": "pi_3OiqTaGkyVbTBiYe0nUcBPZV_secret_2KT0oh8uYFUeQONViEq7ZWLgN", + "confirmation_method": "automatic", + "created": 1707709598, + "currency": "aud", + "customer": null, + "description": null, + "invoice": null, + "last_payment_error": null, + "latest_charge": null, + "livemode": false, + "metadata": {}, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1OiqTaGkyVbTBiYeLv5l0zWX", + "payment_method_configuration_details": null, + "payment_method_options": { + "card": { + "installments": null, + "mandate_options": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "processing": null, + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "requires_confirmation", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Mon, 12 Feb 2024 03:46:38 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents/pi_3OiqTaGkyVbTBiYe0nUcBPZV/confirm + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/10.2.0 + Authorization: + - Bearer + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_Y9z6pafg0X39IU","request_duration_ms":528}}' + Stripe-Version: + - '2023-10-16' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"10.2.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 12 Feb 2024 03:46:39 GMT + Content-Type: + - application/json + Content-Length: + - '1367' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents%2F%3Aintent%2Fconfirm; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Idempotency-Key: + - 43c15925-cb4a-4302-8ba7-1c60c45a4148 + Original-Request: + - req_nFqQkMl1tz0Za6 + Request-Id: + - req_nFqQkMl1tz0Za6 + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2023-10-16' + Vary: + - Origin + X-Stripe-Non-Api-Overhead-Duration-Ms: + - '722.0' + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pi_3OiqTaGkyVbTBiYe0nUcBPZV", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 1000, + "amount_details": { + "tip": {} + }, + "amount_received": 0, + "application": null, + "application_fee_amount": null, + "automatic_payment_methods": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "manual", + "client_secret": "pi_3OiqTaGkyVbTBiYe0nUcBPZV_secret_2KT0oh8uYFUeQONViEq7ZWLgN", + "confirmation_method": "automatic", + "created": 1707709598, + "currency": "aud", + "customer": null, + "description": null, + "invoice": null, + "last_payment_error": null, + "latest_charge": "ch_3OiqTaGkyVbTBiYe0O6Hj6zD", + "livemode": false, + "metadata": {}, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1OiqTaGkyVbTBiYeLv5l0zWX", + "payment_method_configuration_details": null, + "payment_method_options": { + "card": { + "installments": null, + "mandate_options": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "processing": null, + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "requires_capture", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Mon, 12 Feb 2024 03:46:39 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents/pi_3OiqTaGkyVbTBiYe0nUcBPZV/capture + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/10.2.0 + Authorization: + - Bearer + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_nFqQkMl1tz0Za6","request_duration_ms":1012}}' + Stripe-Version: + - '2023-10-16' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"10.2.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 12 Feb 2024 03:46:40 GMT + Content-Type: + - application/json + Content-Length: + - '1360' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents%2F%3Aintent%2Fcapture; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Idempotency-Key: + - 369fad8e-e4ff-4766-a931-602e295519d8 + Original-Request: + - req_UkosKenQjluRqt + Request-Id: + - req_UkosKenQjluRqt + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2023-10-16' + Vary: + - Origin + X-Stripe-Non-Api-Overhead-Duration-Ms: + - '676.0' + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pi_3OiqTaGkyVbTBiYe0nUcBPZV", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_details": { + "tip": {} + }, + "amount_received": 1000, + "application": null, + "application_fee_amount": null, + "automatic_payment_methods": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "manual", + "client_secret": "pi_3OiqTaGkyVbTBiYe0nUcBPZV_secret_2KT0oh8uYFUeQONViEq7ZWLgN", + "confirmation_method": "automatic", + "created": 1707709598, + "currency": "aud", + "customer": null, + "description": null, + "invoice": null, + "last_payment_error": null, + "latest_charge": "ch_3OiqTaGkyVbTBiYe0O6Hj6zD", + "livemode": false, + "metadata": {}, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1OiqTaGkyVbTBiYeLv5l0zWX", + "payment_method_configuration_details": null, + "payment_method_options": { + "card": { + "installments": null, + "mandate_options": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "processing": null, + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Mon, 12 Feb 2024 03:46:40 GMT +- request: + method: get + uri: https://api.stripe.com/v1/payment_intents/pi_3OiqTaGkyVbTBiYe0nUcBPZV + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/10.2.0 + Authorization: + - Bearer + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_UkosKenQjluRqt","request_duration_ms":869}}' + Stripe-Version: + - '2023-10-16' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"10.2.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + Stripe-Account: + - acct_1APQreGkyVbTBiYe + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 12 Feb 2024 03:46:41 GMT + Content-Type: + - application/json + Content-Length: + - '1360' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents%2F%3Aintent; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Request-Id: + - req_bkByviWmLTQOfW + Stripe-Version: + - '2023-10-16' + Vary: + - Origin + X-Stripe-Non-Api-Overhead-Duration-Ms: + - '60.0' + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pi_3OiqTaGkyVbTBiYe0nUcBPZV", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_details": { + "tip": {} + }, + "amount_received": 1000, + "application": null, + "application_fee_amount": null, + "automatic_payment_methods": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "manual", + "client_secret": "pi_3OiqTaGkyVbTBiYe0nUcBPZV_secret_2KT0oh8uYFUeQONViEq7ZWLgN", + "confirmation_method": "automatic", + "created": 1707709598, + "currency": "aud", + "customer": null, + "description": null, + "invoice": null, + "last_payment_error": null, + "latest_charge": "ch_3OiqTaGkyVbTBiYe0O6Hj6zD", + "livemode": false, + "metadata": {}, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1OiqTaGkyVbTBiYeLv5l0zWX", + "payment_method_configuration_details": null, + "payment_method_options": { + "card": { + "installments": null, + "mandate_options": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "processing": null, + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Mon, 12 Feb 2024 03:46:41 GMT +- request: + method: get + uri: https://api.stripe.com/v1/payment_intents/pi_3OiqTaGkyVbTBiYe0nUcBPZV + body: + encoding: US-ASCII + string: '' + headers: + Authorization: + - Basic c2tfdGVzdF9HRlFXMnU4c2xsbmxBTzYxN2FUODFRdko6 + User-Agent: + - Stripe/v1 ActiveMerchantBindings/1.133.0 + Stripe-Version: + - '2020-08-27' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"1.133.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","publisher":"active_merchant"}' + X-Stripe-Client-User-Metadata: + - '{"ip":null}' + Stripe-Account: + - acct_1APQreGkyVbTBiYe + Connection: + - close + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 12 Feb 2024 03:46:41 GMT + Content-Type: + - application/json + Content-Length: + - '5139' + Connection: + - close + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents%2F%3Aintent; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Request-Id: + - req_UtyUK1MQapAOEz + Stripe-Version: + - '2020-08-27' + Vary: + - Origin + X-Stripe-Non-Api-Overhead-Duration-Ms: + - '117.0' + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pi_3OiqTaGkyVbTBiYe0nUcBPZV", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_details": { + "tip": {} + }, + "amount_received": 1000, + "application": null, + "application_fee_amount": null, + "automatic_payment_methods": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "manual", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_3OiqTaGkyVbTBiYe0O6Hj6zD", + "object": "charge", + "amount": 1000, + "amount_captured": 1000, + "amount_refunded": 0, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_3OiqTaGkyVbTBiYe0AQLBi3e", + "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": "OPENFOODNETWORK", + "captured": true, + "created": 1707709599, + "currency": "aud", + "customer": null, + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_balance_transaction": null, + "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": 13, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_3OiqTaGkyVbTBiYe0nUcBPZV", + "payment_method": "pm_1OiqTaGkyVbTBiYeLv5l0zWX", + "payment_method_details": { + "card": { + "amount_authorized": 1000, + "brand": "mastercard", + "capture_before": 1708314399, + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 2, + "exp_year": 2025, + "extended_authorization": { + "status": "disabled" + }, + "fingerprint": "1Zr75a6zBSZLu0Zp", + "funding": "credit", + "incremental_authorization": { + "status": "unavailable" + }, + "installments": null, + "last4": "4444", + "mandate": null, + "multicapture": { + "status": "unavailable" + }, + "network": "mastercard", + "network_token": { + "used": false + }, + "overcapture": { + "maximum_amount_capturable": 1000, + "status": "unavailable" + }, + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "radar_options": {}, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xQVBRcmVHa3lWYlRCaVllKKGppq4GMgYKu9Q4B5A6LBaTUzdg_aQZMp9WlQueacwdHTSVg_dxKop9ZZpxY9MYvYW5Q-ZabNXYn7dp", + "refunded": false, + "refunds": { + "object": "list", + "data": [], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_3OiqTaGkyVbTBiYe0O6Hj6zD/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_3OiqTaGkyVbTBiYe0nUcBPZV" + }, + "client_secret": "pi_3OiqTaGkyVbTBiYe0nUcBPZV_secret_2KT0oh8uYFUeQONViEq7ZWLgN", + "confirmation_method": "automatic", + "created": 1707709598, + "currency": "aud", + "customer": null, + "description": null, + "invoice": null, + "last_payment_error": null, + "latest_charge": "ch_3OiqTaGkyVbTBiYe0O6Hj6zD", + "livemode": false, + "metadata": {}, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1OiqTaGkyVbTBiYeLv5l0zWX", + "payment_method_configuration_details": null, + "payment_method_options": { + "card": { + "installments": null, + "mandate_options": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "processing": null, + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Mon, 12 Feb 2024 03:46:41 GMT +- request: + method: post + uri: https://api.stripe.com/v1/charges/ch_3OiqTaGkyVbTBiYe0O6Hj6zD/refunds + body: + encoding: UTF-8 + string: amount=1000&expand[0]=charge + headers: + Content-Type: + - application/x-www-form-urlencoded + Authorization: + - Basic c2tfdGVzdF9HRlFXMnU4c2xsbmxBTzYxN2FUODFRdko6 + User-Agent: + - Stripe/v1 ActiveMerchantBindings/1.133.0 + Stripe-Version: + - '2020-08-27' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"1.133.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","publisher":"active_merchant"}' + X-Stripe-Client-User-Metadata: + - '{"ip":null}' + Stripe-Account: + - acct_1APQreGkyVbTBiYe + Connection: + - close + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 12 Feb 2024 03:46:42 GMT + Content-Type: + - application/json + Content-Length: + - '4547' + Connection: + - close + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fcharges%2F%3Acharge%2Frefunds; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Idempotency-Key: + - 5fd98021-2934-4a23-a462-2686b02d6be4 + Original-Request: + - req_GrOgrUV9vyH0dN + Request-Id: + - req_GrOgrUV9vyH0dN + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2020-08-27' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "re_3OiqTaGkyVbTBiYe0K4k5Khy", + "object": "refund", + "amount": 1000, + "balance_transaction": "txn_3OiqTaGkyVbTBiYe09TPiL12", + "charge": { + "id": "ch_3OiqTaGkyVbTBiYe0O6Hj6zD", + "object": "charge", + "amount": 1000, + "amount_captured": 1000, + "amount_refunded": 1000, + "application": null, + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_3OiqTaGkyVbTBiYe0AQLBi3e", + "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": "OPENFOODNETWORK", + "captured": true, + "created": 1707709599, + "currency": "aud", + "customer": null, + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_balance_transaction": null, + "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": 13, + "seller_message": "Payment complete.", + "type": "authorized" + }, + "paid": true, + "payment_intent": "pi_3OiqTaGkyVbTBiYe0nUcBPZV", + "payment_method": "pm_1OiqTaGkyVbTBiYeLv5l0zWX", + "payment_method_details": { + "card": { + "amount_authorized": 1000, + "brand": "mastercard", + "capture_before": 1708314399, + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 2, + "exp_year": 2025, + "extended_authorization": { + "status": "disabled" + }, + "fingerprint": "1Zr75a6zBSZLu0Zp", + "funding": "credit", + "incremental_authorization": { + "status": "unavailable" + }, + "installments": null, + "last4": "4444", + "mandate": null, + "multicapture": { + "status": "unavailable" + }, + "network": "mastercard", + "network_token": { + "used": false + }, + "overcapture": { + "maximum_amount_capturable": 1000, + "status": "unavailable" + }, + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "radar_options": {}, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xQVBRcmVHa3lWYlRCaVllKKKppq4GMgbB94RxQuw6LBajaUJ_Nzh33IT18N1M4-HhSrvYWIOIFfijUMVA2zy0iqBh8K2_OWFkLTEf", + "refunded": true, + "refunds": { + "object": "list", + "data": [ + { + "id": "re_3OiqTaGkyVbTBiYe0K4k5Khy", + "object": "refund", + "amount": 1000, + "balance_transaction": "txn_3OiqTaGkyVbTBiYe09TPiL12", + "charge": "ch_3OiqTaGkyVbTBiYe0O6Hj6zD", + "created": 1707709602, + "currency": "aud", + "destination_details": { + "card": { + "reference_status": "pending", + "reference_type": "acquirer_reference_number", + "type": "refund" + }, + "type": "card" + }, + "metadata": {}, + "payment_intent": "pi_3OiqTaGkyVbTBiYe0nUcBPZV", + "reason": null, + "receipt_number": null, + "source_transfer_reversal": null, + "status": "succeeded", + "transfer_reversal": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges/ch_3OiqTaGkyVbTBiYe0O6Hj6zD/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 + }, + "created": 1707709602, + "currency": "aud", + "destination_details": { + "card": { + "reference_status": "pending", + "reference_type": "acquirer_reference_number", + "type": "refund" + }, + "type": "card" + }, + "metadata": {}, + "payment_intent": "pi_3OiqTaGkyVbTBiYe0nUcBPZV", + "reason": null, + "receipt_number": null, + "source_transfer_reversal": null, + "status": "succeeded", + "transfer_reversal": null + } + recorded_at: Mon, 12 Feb 2024 03:46:42 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.2.0/Spree_Gateway_StripeSCA/_void/with_a_voidable_payment/void_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v10.2.0/Spree_Gateway_StripeSCA/_void/with_a_voidable_payment/void_the_payment.yml new file mode 100644 index 0000000000..24fb9dc483 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/Stripe-v10.2.0/Spree_Gateway_StripeSCA/_void/with_a_voidable_payment/void_the_payment.yml @@ -0,0 +1,524 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.stripe.com/v1/payment_methods/pm_card_mastercard + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/10.2.0 + Authorization: + - Bearer + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_bkByviWmLTQOfW","request_duration_ms":359}}' + Stripe-Version: + - '2023-10-16' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"10.2.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 12 Feb 2024 03:46:43 GMT + Content-Type: + - application/json + Content-Length: + - '942' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods%2F%3Apayment_method; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Request-Id: + - req_XABjvmIDq8zdLB + Stripe-Version: + - '2023-10-16' + Vary: + - Origin + X-Stripe-Non-Api-Overhead-Duration-Ms: + - '167.0' + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pm_1OiqTfGkyVbTBiYe3NHcuFzj", + "object": "payment_method", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "card": { + "brand": "mastercard", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "unchecked" + }, + "country": "US", + "exp_month": 2, + "exp_year": 2025, + "fingerprint": "1Zr75a6zBSZLu0Zp", + "funding": "credit", + "generated_from": null, + "last4": "4444", + "networks": { + "available": [ + "mastercard" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1707709603, + "customer": null, + "livemode": false, + "metadata": {}, + "type": "card" + } + recorded_at: Mon, 12 Feb 2024 03:46:43 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: amount=1000¤cy=aud&payment_method=pm_1OiqTfGkyVbTBiYe3NHcuFzj&payment_method_types[0]=card&capture_method=manual + headers: + User-Agent: + - Stripe/v1 RubyBindings/10.2.0 + Authorization: + - Bearer + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_XABjvmIDq8zdLB","request_duration_ms":484}}' + Stripe-Version: + - '2023-10-16' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"10.2.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 12 Feb 2024 03:46:44 GMT + Content-Type: + - application/json + Content-Length: + - '1344' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Idempotency-Key: + - 5e88c180-041d-449f-821d-34f26e16ca9e + Original-Request: + - req_tQWBPCGhiMCP0g + Request-Id: + - req_tQWBPCGhiMCP0g + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2023-10-16' + Vary: + - Origin + X-Stripe-Non-Api-Overhead-Duration-Ms: + - '193.0' + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pi_3OiqTgGkyVbTBiYe0de0qJ91", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_details": { + "tip": {} + }, + "amount_received": 0, + "application": null, + "application_fee_amount": null, + "automatic_payment_methods": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "manual", + "client_secret": "pi_3OiqTgGkyVbTBiYe0de0qJ91_secret_d6ozPrnET7mJAXHuW1mZlOxB6", + "confirmation_method": "automatic", + "created": 1707709604, + "currency": "aud", + "customer": null, + "description": null, + "invoice": null, + "last_payment_error": null, + "latest_charge": null, + "livemode": false, + "metadata": {}, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1OiqTfGkyVbTBiYe3NHcuFzj", + "payment_method_configuration_details": null, + "payment_method_options": { + "card": { + "installments": null, + "mandate_options": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "processing": null, + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "requires_confirmation", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Mon, 12 Feb 2024 03:46:44 GMT +- request: + method: get + uri: https://api.stripe.com/v1/payment_intents/pi_3OiqTgGkyVbTBiYe0de0qJ91 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/10.2.0 + Authorization: + - Bearer + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_tQWBPCGhiMCP0g","request_duration_ms":509}}' + Stripe-Version: + - '2023-10-16' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"10.2.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 12 Feb 2024 03:46:44 GMT + Content-Type: + - application/json + Content-Length: + - '1344' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents%2F%3Aintent; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Request-Id: + - req_3zPIl85xE98iJP + Stripe-Version: + - '2023-10-16' + Vary: + - Origin + X-Stripe-Non-Api-Overhead-Duration-Ms: + - '63.0' + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pi_3OiqTgGkyVbTBiYe0de0qJ91", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_details": { + "tip": {} + }, + "amount_received": 0, + "application": null, + "application_fee_amount": null, + "automatic_payment_methods": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "manual", + "client_secret": "pi_3OiqTgGkyVbTBiYe0de0qJ91_secret_d6ozPrnET7mJAXHuW1mZlOxB6", + "confirmation_method": "automatic", + "created": 1707709604, + "currency": "aud", + "customer": null, + "description": null, + "invoice": null, + "last_payment_error": null, + "latest_charge": null, + "livemode": false, + "metadata": {}, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1OiqTfGkyVbTBiYe3NHcuFzj", + "payment_method_configuration_details": null, + "payment_method_options": { + "card": { + "installments": null, + "mandate_options": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "processing": null, + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "requires_confirmation", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Mon, 12 Feb 2024 03:46:44 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents/pi_3OiqTgGkyVbTBiYe0de0qJ91/cancel + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/x-www-form-urlencoded + Authorization: + - Basic c2tfdGVzdF9HRlFXMnU4c2xsbmxBTzYxN2FUODFRdko6 + User-Agent: + - Stripe/v1 ActiveMerchantBindings/1.133.0 + Stripe-Version: + - '2020-08-27' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"1.133.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","publisher":"active_merchant"}' + X-Stripe-Client-User-Metadata: + - '{"ip":null}' + Connection: + - close + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 12 Feb 2024 03:46:45 GMT + Content-Type: + - application/json + Content-Length: + - '1508' + Connection: + - close + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents%2F%3Aintent%2Fcancel; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Idempotency-Key: + - dd6026b4-78e9-49c7-a4af-365d48f10eb8 + Original-Request: + - req_Ez0PQVQfU8IYRv + Request-Id: + - req_Ez0PQVQfU8IYRv + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2020-08-27' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pi_3OiqTgGkyVbTBiYe0de0qJ91", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_details": { + "tip": {} + }, + "amount_received": 0, + "application": null, + "application_fee_amount": null, + "automatic_payment_methods": null, + "canceled_at": 1707709605, + "cancellation_reason": null, + "capture_method": "manual", + "charges": { + "object": "list", + "data": [], + "has_more": false, + "total_count": 0, + "url": "/v1/charges?payment_intent=pi_3OiqTgGkyVbTBiYe0de0qJ91" + }, + "client_secret": "pi_3OiqTgGkyVbTBiYe0de0qJ91_secret_d6ozPrnET7mJAXHuW1mZlOxB6", + "confirmation_method": "automatic", + "created": 1707709604, + "currency": "aud", + "customer": null, + "description": null, + "invoice": null, + "last_payment_error": null, + "latest_charge": null, + "livemode": false, + "metadata": {}, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1OiqTfGkyVbTBiYe3NHcuFzj", + "payment_method_configuration_details": null, + "payment_method_options": { + "card": { + "installments": null, + "mandate_options": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "processing": null, + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "canceled", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Mon, 12 Feb 2024 03:46:45 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.6.0/Spree_Gateway_StripeSCA/_void/with_a_confirmed_payment/refunds_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v10.6.0/Spree_Gateway_StripeSCA/_void/with_a_confirmed_payment/refunds_the_payment.yml new file mode 100644 index 0000000000..91615dbb4a --- /dev/null +++ b/spec/fixtures/vcr_cassettes/Stripe-v10.6.0/Spree_Gateway_StripeSCA/_void/with_a_confirmed_payment/refunds_the_payment.yml @@ -0,0 +1,877 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: amount=1000¤cy=aud&payment_method=pm_card_mastercard&payment_method_types[0]=card&capture_method=automatic&confirm=true + headers: + User-Agent: + - Stripe/v1 RubyBindings/10.6.0 + Authorization: + - Bearer + Content-Type: + - application/x-www-form-urlencoded + Stripe-Version: + - '2023-10-16' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"10.6.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + Stripe-Account: + - acct_1OhZ9lQQeZbvfZRJ + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 12 Feb 2024 22:53:08 GMT + Content-Type: + - application/json + Content-Length: + - '1396' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Idempotency-Key: + - 9f9ede9d-96ac-4441-b545-e1eb438336d2 + Original-Request: + - req_lB6oA68zTMJrpJ + Request-Id: + - req_lB6oA68zTMJrpJ + Stripe-Account: + - acct_1OhZ9lQQeZbvfZRJ + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2023-10-16' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pi_3Oj8N5QQeZbvfZRJ0DWbfoMx", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_details": { + "tip": {} + }, + "amount_received": 1000, + "application": "", + "application_fee_amount": null, + "automatic_payment_methods": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "client_secret": "pi_3Oj8N5QQeZbvfZRJ0DWbfoMx_secret_nvjdOSvBf3LuhqkJsaRlmiouk", + "confirmation_method": "automatic", + "created": 1707778387, + "currency": "aud", + "customer": null, + "description": null, + "invoice": null, + "last_payment_error": null, + "latest_charge": "ch_3Oj8N5QQeZbvfZRJ0jNdFIT8", + "livemode": false, + "metadata": {}, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1Oj8N5QQeZbvfZRJQ6Qh4CtB", + "payment_method_configuration_details": null, + "payment_method_options": { + "card": { + "installments": null, + "mandate_options": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "processing": null, + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Mon, 12 Feb 2024 22:53:09 GMT +- request: + method: get + uri: https://api.stripe.com/v1/payment_methods/pm_card_mastercard + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/10.6.0 + Authorization: + - Bearer + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_lB6oA68zTMJrpJ","request_duration_ms":1832}}' + Stripe-Version: + - '2023-10-16' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"10.6.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 12 Feb 2024 22:53:11 GMT + Content-Type: + - application/json + Content-Length: + - '942' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods%2F%3Apayment_method; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Request-Id: + - req_MPSEbWRjRHc1xo + Stripe-Version: + - '2023-10-16' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pm_1Oj8N8KuuB1fWySnY2lqbAGk", + "object": "payment_method", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "card": { + "brand": "mastercard", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "unchecked" + }, + "country": "US", + "exp_month": 2, + "exp_year": 2025, + "fingerprint": "BL35fEFVcTTS5wpE", + "funding": "credit", + "generated_from": null, + "last4": "4444", + "networks": { + "available": [ + "mastercard" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1707778390, + "customer": null, + "livemode": false, + "metadata": {}, + "type": "card" + } + recorded_at: Mon, 12 Feb 2024 22:53:11 GMT +- request: + method: get + uri: https://api.stripe.com/v1/payment_intents/pi_3Oj8N5QQeZbvfZRJ0DWbfoMx + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/10.6.0 + Authorization: + - Bearer + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_MPSEbWRjRHc1xo","request_duration_ms":1078}}' + Stripe-Version: + - '2023-10-16' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"10.6.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + Stripe-Account: + - acct_1OhZ9lQQeZbvfZRJ + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 12 Feb 2024 22:53:11 GMT + Content-Type: + - application/json + Content-Length: + - '1396' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents%2F%3Aintent; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Request-Id: + - req_kqqjMU3wRPfz7h + Stripe-Account: + - acct_1OhZ9lQQeZbvfZRJ + Stripe-Version: + - '2023-10-16' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pi_3Oj8N5QQeZbvfZRJ0DWbfoMx", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_details": { + "tip": {} + }, + "amount_received": 1000, + "application": "", + "application_fee_amount": null, + "automatic_payment_methods": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "client_secret": "pi_3Oj8N5QQeZbvfZRJ0DWbfoMx_secret_nvjdOSvBf3LuhqkJsaRlmiouk", + "confirmation_method": "automatic", + "created": 1707778387, + "currency": "aud", + "customer": null, + "description": null, + "invoice": null, + "last_payment_error": null, + "latest_charge": "ch_3Oj8N5QQeZbvfZRJ0jNdFIT8", + "livemode": false, + "metadata": {}, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1Oj8N5QQeZbvfZRJQ6Qh4CtB", + "payment_method_configuration_details": null, + "payment_method_options": { + "card": { + "installments": null, + "mandate_options": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "processing": null, + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Mon, 12 Feb 2024 22:53:11 GMT +- request: + method: get + uri: https://api.stripe.com/v1/payment_intents/pi_3Oj8N5QQeZbvfZRJ0DWbfoMx + body: + encoding: US-ASCII + string: '' + headers: + Authorization: + - Basic c2tfdGVzdF94RmdKUU9sWHBNQUZzb3p0endGQlRGaFAwMEhHN0J1Q0ptOg== + User-Agent: + - Stripe/v1 ActiveMerchantBindings/1.133.0 + Stripe-Version: + - '2020-08-27' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"1.133.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","publisher":"active_merchant"}' + X-Stripe-Client-User-Metadata: + - '{"ip":null}' + Stripe-Account: + - acct_1OhZ9lQQeZbvfZRJ + Connection: + - close + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 12 Feb 2024 22:53:12 GMT + Content-Type: + - application/json + Content-Length: + - '5159' + Connection: + - close + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents%2F%3Aintent; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Request-Id: + - req_2ZdR6OrOajgOec + Stripe-Account: + - acct_1OhZ9lQQeZbvfZRJ + Stripe-Version: + - '2020-08-27' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pi_3Oj8N5QQeZbvfZRJ0DWbfoMx", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_details": { + "tip": {} + }, + "amount_received": 1000, + "application": "", + "application_fee_amount": null, + "automatic_payment_methods": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "automatic", + "charges": { + "object": "list", + "data": [ + { + "id": "ch_3Oj8N5QQeZbvfZRJ0jNdFIT8", + "object": "charge", + "amount": 1000, + "amount_captured": 1000, + "amount_refunded": 0, + "application": "", + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_3Oj8N5QQeZbvfZRJ0VVf4rtO", + "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": "OFNOFNOFN", + "captured": true, + "created": 1707778388, + "currency": "aud", + "customer": null, + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_balance_transaction": null, + "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_3Oj8N5QQeZbvfZRJ0DWbfoMx", + "payment_method": "pm_1Oj8N5QQeZbvfZRJQ6Qh4CtB", + "payment_method_details": { + "card": { + "amount_authorized": 1000, + "brand": "mastercard", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 2, + "exp_year": 2025, + "extended_authorization": { + "status": "disabled" + }, + "fingerprint": "BL35fEFVcTTS5wpE", + "funding": "credit", + "incremental_authorization": { + "status": "unavailable" + }, + "installments": null, + "last4": "4444", + "mandate": null, + "multicapture": { + "status": "unavailable" + }, + "network": "mastercard", + "network_token": { + "used": false + }, + "overcapture": { + "maximum_amount_capturable": 1000, + "status": "unavailable" + }, + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "radar_options": {}, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xT2haOWxRUWVaYnZmWlJKKNjCqq4GMgZz3nu_-qs6LBbP4HIvOO9vohwzYRZA73lI9cjv8LnAaahU-8StFSQ0AW4v1eUKfrTSCc8c", + "refunded": false, + "refunds": { + "object": "list", + "data": [], + "has_more": false, + "total_count": 0, + "url": "/v1/charges/ch_3Oj8N5QQeZbvfZRJ0jNdFIT8/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_3Oj8N5QQeZbvfZRJ0DWbfoMx" + }, + "client_secret": "pi_3Oj8N5QQeZbvfZRJ0DWbfoMx_secret_nvjdOSvBf3LuhqkJsaRlmiouk", + "confirmation_method": "automatic", + "created": 1707778387, + "currency": "aud", + "customer": null, + "description": null, + "invoice": null, + "last_payment_error": null, + "latest_charge": "ch_3Oj8N5QQeZbvfZRJ0jNdFIT8", + "livemode": false, + "metadata": {}, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1Oj8N5QQeZbvfZRJQ6Qh4CtB", + "payment_method_configuration_details": null, + "payment_method_options": { + "card": { + "installments": null, + "mandate_options": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "processing": null, + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "succeeded", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Mon, 12 Feb 2024 22:53:12 GMT +- request: + method: post + uri: https://api.stripe.com/v1/charges/ch_3Oj8N5QQeZbvfZRJ0jNdFIT8/refunds + body: + encoding: UTF-8 + string: amount=1000&expand[0]=charge + headers: + Content-Type: + - application/x-www-form-urlencoded + Authorization: + - Basic c2tfdGVzdF94RmdKUU9sWHBNQUZzb3p0endGQlRGaFAwMEhHN0J1Q0ptOg== + User-Agent: + - Stripe/v1 ActiveMerchantBindings/1.133.0 + Stripe-Version: + - '2020-08-27' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"1.133.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","publisher":"active_merchant"}' + X-Stripe-Client-User-Metadata: + - '{"ip":null}' + Stripe-Account: + - acct_1OhZ9lQQeZbvfZRJ + Connection: + - close + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 12 Feb 2024 22:53:13 GMT + Content-Type: + - application/json + Content-Length: + - '4535' + Connection: + - close + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fcharges%2F%3Acharge%2Frefunds; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Idempotency-Key: + - cf4f970c-f6b3-4e76-b233-4eab0e385c71 + Original-Request: + - req_38Iu12IYZJwYz3 + Request-Id: + - req_38Iu12IYZJwYz3 + Stripe-Account: + - acct_1OhZ9lQQeZbvfZRJ + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2020-08-27' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "re_3Oj8N5QQeZbvfZRJ0x3xrJep", + "object": "refund", + "amount": 1000, + "balance_transaction": "txn_3Oj8N5QQeZbvfZRJ0446g84e", + "charge": { + "id": "ch_3Oj8N5QQeZbvfZRJ0jNdFIT8", + "object": "charge", + "amount": 1000, + "amount_captured": 1000, + "amount_refunded": 1000, + "application": "", + "application_fee": null, + "application_fee_amount": null, + "balance_transaction": "txn_3Oj8N5QQeZbvfZRJ0VVf4rtO", + "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": "OFNOFNOFN", + "captured": true, + "created": 1707778388, + "currency": "aud", + "customer": null, + "description": null, + "destination": null, + "dispute": null, + "disputed": false, + "failure_balance_transaction": null, + "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_3Oj8N5QQeZbvfZRJ0DWbfoMx", + "payment_method": "pm_1Oj8N5QQeZbvfZRJQ6Qh4CtB", + "payment_method_details": { + "card": { + "amount_authorized": 1000, + "brand": "mastercard", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "pass" + }, + "country": "US", + "exp_month": 2, + "exp_year": 2025, + "extended_authorization": { + "status": "disabled" + }, + "fingerprint": "BL35fEFVcTTS5wpE", + "funding": "credit", + "incremental_authorization": { + "status": "unavailable" + }, + "installments": null, + "last4": "4444", + "mandate": null, + "multicapture": { + "status": "unavailable" + }, + "network": "mastercard", + "network_token": { + "used": false + }, + "overcapture": { + "maximum_amount_capturable": 1000, + "status": "unavailable" + }, + "three_d_secure": null, + "wallet": null + }, + "type": "card" + }, + "radar_options": {}, + "receipt_email": null, + "receipt_number": null, + "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xT2haOWxRUWVaYnZmWlJKKNnCqq4GMgYb2YoorMU6LBZPiModP9pA5IE5ehBQl5Kwr5IwrCYjcU1OlRxOtlsEdsxBrK09r38JrH1o", + "refunded": true, + "refunds": { + "object": "list", + "data": [ + { + "id": "re_3Oj8N5QQeZbvfZRJ0x3xrJep", + "object": "refund", + "amount": 1000, + "balance_transaction": "txn_3Oj8N5QQeZbvfZRJ0446g84e", + "charge": "ch_3Oj8N5QQeZbvfZRJ0jNdFIT8", + "created": 1707778392, + "currency": "aud", + "destination_details": { + "card": { + "reference_status": "pending", + "reference_type": "acquirer_reference_number", + "type": "refund" + }, + "type": "card" + }, + "metadata": {}, + "payment_intent": "pi_3Oj8N5QQeZbvfZRJ0DWbfoMx", + "reason": null, + "receipt_number": null, + "source_transfer_reversal": null, + "status": "succeeded", + "transfer_reversal": null + } + ], + "has_more": false, + "total_count": 1, + "url": "/v1/charges/ch_3Oj8N5QQeZbvfZRJ0jNdFIT8/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 + }, + "created": 1707778392, + "currency": "aud", + "destination_details": { + "card": { + "reference_status": "pending", + "reference_type": "acquirer_reference_number", + "type": "refund" + }, + "type": "card" + }, + "metadata": {}, + "payment_intent": "pi_3Oj8N5QQeZbvfZRJ0DWbfoMx", + "reason": null, + "receipt_number": null, + "source_transfer_reversal": null, + "status": "succeeded", + "transfer_reversal": null + } + recorded_at: Mon, 12 Feb 2024 22:53:13 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.6.0/Spree_Gateway_StripeSCA/_void/with_a_voidable_payment/void_the_payment.yml b/spec/fixtures/vcr_cassettes/Stripe-v10.6.0/Spree_Gateway_StripeSCA/_void/with_a_voidable_payment/void_the_payment.yml new file mode 100644 index 0000000000..f8eb537ca2 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/Stripe-v10.6.0/Spree_Gateway_StripeSCA/_void/with_a_voidable_payment/void_the_payment.yml @@ -0,0 +1,530 @@ +--- +http_interactions: +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents + body: + encoding: UTF-8 + string: amount=1000¤cy=aud&payment_method=pm_card_mastercard&payment_method_types[0]=card&capture_method=manual + headers: + User-Agent: + - Stripe/v1 RubyBindings/10.6.0 + Authorization: + - Bearer + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_kqqjMU3wRPfz7h","request_duration_ms":485}}' + Stripe-Version: + - '2023-10-16' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"10.6.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + Stripe-Account: + - acct_1OhZ9lQQeZbvfZRJ + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 12 Feb 2024 22:53:14 GMT + Content-Type: + - application/json + Content-Length: + - '1377' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents; block-all-mixed-content; + default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; + img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' + Idempotency-Key: + - 816e3630-03dc-4f3a-b4c6-5e88e3322536 + Original-Request: + - req_6jrnUl6aZNQxLk + Request-Id: + - req_6jrnUl6aZNQxLk + Stripe-Account: + - acct_1OhZ9lQQeZbvfZRJ + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2023-10-16' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pi_3Oj8NCQQeZbvfZRJ1ahXc6sm", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_details": { + "tip": {} + }, + "amount_received": 0, + "application": "", + "application_fee_amount": null, + "automatic_payment_methods": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "manual", + "client_secret": "pi_3Oj8NCQQeZbvfZRJ1ahXc6sm_secret_S6BFb7CunuRZPNoXb2GSmSUsh", + "confirmation_method": "automatic", + "created": 1707778394, + "currency": "aud", + "customer": null, + "description": null, + "invoice": null, + "last_payment_error": null, + "latest_charge": null, + "livemode": false, + "metadata": {}, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1Oj8NCQQeZbvfZRJUrdNo9RL", + "payment_method_configuration_details": null, + "payment_method_options": { + "card": { + "installments": null, + "mandate_options": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "processing": null, + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "requires_confirmation", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Mon, 12 Feb 2024 22:53:14 GMT +- request: + method: get + uri: https://api.stripe.com/v1/payment_methods/pm_card_mastercard + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/10.6.0 + Authorization: + - Bearer + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_6jrnUl6aZNQxLk","request_duration_ms":572}}' + Stripe-Version: + - '2023-10-16' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"10.6.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 12 Feb 2024 22:53:15 GMT + Content-Type: + - application/json + Content-Length: + - '942' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods%2F%3Apayment_method; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Request-Id: + - req_fiClXhKKwaSAmy + Stripe-Version: + - '2023-10-16' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pm_1Oj8NDKuuB1fWySnzaxDjTO2", + "object": "payment_method", + "billing_details": { + "address": { + "city": null, + "country": null, + "line1": null, + "line2": null, + "postal_code": null, + "state": null + }, + "email": null, + "name": null, + "phone": null + }, + "card": { + "brand": "mastercard", + "checks": { + "address_line1_check": null, + "address_postal_code_check": null, + "cvc_check": "unchecked" + }, + "country": "US", + "exp_month": 2, + "exp_year": 2025, + "fingerprint": "BL35fEFVcTTS5wpE", + "funding": "credit", + "generated_from": null, + "last4": "4444", + "networks": { + "available": [ + "mastercard" + ], + "preferred": null + }, + "three_d_secure_usage": { + "supported": true + }, + "wallet": null + }, + "created": 1707778395, + "customer": null, + "livemode": false, + "metadata": {}, + "type": "card" + } + recorded_at: Mon, 12 Feb 2024 22:53:15 GMT +- request: + method: get + uri: https://api.stripe.com/v1/payment_intents/pi_3Oj8NCQQeZbvfZRJ1ahXc6sm + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Stripe/v1 RubyBindings/10.6.0 + Authorization: + - Bearer + Content-Type: + - application/x-www-form-urlencoded + X-Stripe-Client-Telemetry: + - '{"last_request_metrics":{"request_id":"req_fiClXhKKwaSAmy","request_duration_ms":535}}' + Stripe-Version: + - '2023-10-16' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"10.6.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' + Stripe-Account: + - acct_1OhZ9lQQeZbvfZRJ + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 12 Feb 2024 22:53:15 GMT + Content-Type: + - application/json + Content-Length: + - '1377' + Connection: + - keep-alive + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents%2F%3Aintent; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Request-Id: + - req_mclrPggiyKYO9S + Stripe-Account: + - acct_1OhZ9lQQeZbvfZRJ + Stripe-Version: + - '2023-10-16' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pi_3Oj8NCQQeZbvfZRJ1ahXc6sm", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_details": { + "tip": {} + }, + "amount_received": 0, + "application": "", + "application_fee_amount": null, + "automatic_payment_methods": null, + "canceled_at": null, + "cancellation_reason": null, + "capture_method": "manual", + "client_secret": "pi_3Oj8NCQQeZbvfZRJ1ahXc6sm_secret_S6BFb7CunuRZPNoXb2GSmSUsh", + "confirmation_method": "automatic", + "created": 1707778394, + "currency": "aud", + "customer": null, + "description": null, + "invoice": null, + "last_payment_error": null, + "latest_charge": null, + "livemode": false, + "metadata": {}, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1Oj8NCQQeZbvfZRJUrdNo9RL", + "payment_method_configuration_details": null, + "payment_method_options": { + "card": { + "installments": null, + "mandate_options": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "processing": null, + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "requires_confirmation", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Mon, 12 Feb 2024 22:53:15 GMT +- request: + method: post + uri: https://api.stripe.com/v1/payment_intents/pi_3Oj8NCQQeZbvfZRJ1ahXc6sm/cancel + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/x-www-form-urlencoded + Authorization: + - Basic c2tfdGVzdF94RmdKUU9sWHBNQUZzb3p0endGQlRGaFAwMEhHN0J1Q0ptOg== + User-Agent: + - Stripe/v1 ActiveMerchantBindings/1.133.0 + Stripe-Version: + - '2020-08-27' + X-Stripe-Client-User-Agent: + - '{"bindings_version":"1.133.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","publisher":"active_merchant"}' + X-Stripe-Client-User-Metadata: + - '{"ip":null}' + Stripe-Account: + - acct_1OhZ9lQQeZbvfZRJ + Connection: + - close + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + response: + status: + code: 200 + message: OK + headers: + Server: + - nginx + Date: + - Mon, 12 Feb 2024 22:53:16 GMT + Content-Type: + - application/json + Content-Length: + - '1541' + Connection: + - close + Access-Control-Allow-Credentials: + - 'true' + Access-Control-Allow-Methods: + - GET,HEAD,PUT,PATCH,POST,DELETE + Access-Control-Allow-Origin: + - "*" + Access-Control-Expose-Headers: + - Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, + X-Stripe-Privileged-Session-Required + Access-Control-Max-Age: + - '300' + Cache-Control: + - no-cache, no-store + Content-Security-Policy: + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_intents%2F%3Aintent%2Fcancel; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' + Idempotency-Key: + - 3e00f853-05da-4290-86df-fad9bca9d5ea + Original-Request: + - req_clYJJBeUWvA3Fe + Request-Id: + - req_clYJJBeUWvA3Fe + Stripe-Account: + - acct_1OhZ9lQQeZbvfZRJ + Stripe-Should-Retry: + - 'false' + Stripe-Version: + - '2020-08-27' + Vary: + - Origin + X-Stripe-Routing-Context-Priority-Tier: + - api-testmode + Strict-Transport-Security: + - max-age=63072000; includeSubDomains; preload + body: + encoding: UTF-8 + string: |- + { + "id": "pi_3Oj8NCQQeZbvfZRJ1ahXc6sm", + "object": "payment_intent", + "amount": 1000, + "amount_capturable": 0, + "amount_details": { + "tip": {} + }, + "amount_received": 0, + "application": "", + "application_fee_amount": null, + "automatic_payment_methods": null, + "canceled_at": 1707778396, + "cancellation_reason": null, + "capture_method": "manual", + "charges": { + "object": "list", + "data": [], + "has_more": false, + "total_count": 0, + "url": "/v1/charges?payment_intent=pi_3Oj8NCQQeZbvfZRJ1ahXc6sm" + }, + "client_secret": "pi_3Oj8NCQQeZbvfZRJ1ahXc6sm_secret_S6BFb7CunuRZPNoXb2GSmSUsh", + "confirmation_method": "automatic", + "created": 1707778394, + "currency": "aud", + "customer": null, + "description": null, + "invoice": null, + "last_payment_error": null, + "latest_charge": null, + "livemode": false, + "metadata": {}, + "next_action": null, + "on_behalf_of": null, + "payment_method": "pm_1Oj8NCQQeZbvfZRJUrdNo9RL", + "payment_method_configuration_details": null, + "payment_method_options": { + "card": { + "installments": null, + "mandate_options": null, + "network": null, + "request_three_d_secure": "automatic" + } + }, + "payment_method_types": [ + "card" + ], + "processing": null, + "receipt_email": null, + "review": null, + "setup_future_usage": null, + "shipping": null, + "source": null, + "statement_descriptor": null, + "statement_descriptor_suffix": null, + "status": "canceled", + "transfer_data": null, + "transfer_group": null + } + recorded_at: Mon, 12 Feb 2024 22:53:16 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.9.0/Spree_Gateway_StripeSCA/_error_message/when_payment_intent_state_is_not_in_requires_capture_state/does_not_succeed_if_payment_intent_state_is_not_requires_capture.yml b/spec/fixtures/vcr_cassettes/Stripe-v10.9.0/Spree_Gateway_StripeSCA/_error_message/when_payment_intent_state_is_not_in_requires_capture_state/does_not_succeed_if_payment_intent_state_is_not_requires_capture.yml index 5073c404dc..0aaa88dca0 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.9.0/Spree_Gateway_StripeSCA/_error_message/when_payment_intent_state_is_not_in_requires_capture_state/does_not_succeed_if_payment_intent_state_is_not_requires_capture.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v10.9.0/Spree_Gateway_StripeSCA/_error_message/when_payment_intent_state_is_not_in_requires_capture_state/does_not_succeed_if_payment_intent_state_is_not_requires_capture.yml @@ -1,27 +1,27 @@ --- http_interactions: - request: - method: post - uri: https://api.stripe.com/v1/payment_methods + method: get + uri: https://api.stripe.com/v1/payment_methods/pm_card_mastercard body: - encoding: UTF-8 - string: type=card&card[number]=4242424242424242&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 + encoding: US-ASCII + string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.9.0 + - Stripe/v1 RubyBindings/10.2.0 Authorization: - - Bearer + - Bearer Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_0uMthnY2adDsVr","request_duration_ms":955}}' + - '{"last_request_metrics":{"request_id":"req_3zPIl85xE98iJP","request_duration_ms":295}}' Stripe-Version: - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.9.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 6.1.0-17-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) - 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian - 6.1.69-1 (2023-12-30)","hostname":"blackbox"}' + - '{"bindings_version":"10.2.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +34,11 @@ http_interactions: Server: - nginx Date: - - Sun, 18 Feb 2024 23:01:48 GMT + - Mon, 12 Feb 2024 03:46:46 GMT Content-Type: - application/json Content-Length: - - '960' + - '942' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -55,21 +55,18 @@ http_interactions: Cache-Control: - no-cache, no-store Content-Security-Policy: - - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; - default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; - img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' - Idempotency-Key: - - 16efe530-35f3-4b4d-b07e-d8d8b1862ced - Original-Request: - - req_s7XlUZYvwV7DRk + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods%2F%3Apayment_method; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' Request-Id: - - req_s7XlUZYvwV7DRk - Stripe-Should-Retry: - - 'false' + - req_cTgKnTotXU2m08 Stripe-Version: - '2023-10-16' Vary: - Origin + X-Stripe-Non-Api-Overhead-Duration-Ms: + - '177.00000000000003' X-Stripe-Routing-Context-Priority-Tier: - api-testmode Strict-Transport-Security: @@ -78,7 +75,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OlJMmKuuB1fWySnHNgcZaCT", + "id": "pm_1OiqThGkyVbTBiYe79xZ1M6F", "object": "payment_method", "billing_details": { "address": { @@ -94,23 +91,22 @@ http_interactions: "phone": null }, "card": { - "brand": "visa", + "brand": "mastercard", "checks": { "address_line1_check": null, "address_postal_code_check": null, "cvc_check": "unchecked" }, "country": "US", - "display_brand": "visa", - "exp_month": 12, + "exp_month": 2, "exp_year": 2025, - "fingerprint": "6E6tgVjx6U65iHFV", + "fingerprint": "1Zr75a6zBSZLu0Zp", "funding": "credit", "generated_from": null, - "last4": "4242", + "last4": "4444", "networks": { "available": [ - "visa" + "mastercard" ], "preferred": null }, @@ -119,35 +115,35 @@ http_interactions: }, "wallet": null }, - "created": 1708297308, + "created": 1707709605, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Sun, 18 Feb 2024 23:01:49 GMT + recorded_at: Mon, 12 Feb 2024 03:46:46 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=1000¤cy=aud&payment_method=pm_1OlJMmKuuB1fWySnHNgcZaCT&payment_method_types[0]=card&capture_method=manual + string: amount=1000¤cy=aud&payment_method=pm_1OiqThGkyVbTBiYe79xZ1M6F&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.9.0 + - Stripe/v1 RubyBindings/10.2.0 Authorization: - - Bearer + - Bearer Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_s7XlUZYvwV7DRk","request_duration_ms":609}}' + - '{"last_request_metrics":{"request_id":"req_cTgKnTotXU2m08","request_duration_ms":414}}' Stripe-Version: - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.9.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 6.1.0-17-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) - 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian - 6.1.69-1 (2023-12-30)","hostname":"blackbox"}' + - '{"bindings_version":"10.2.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +156,7 @@ http_interactions: Server: - nginx Date: - - Sun, 18 Feb 2024 23:01:49 GMT + - Mon, 12 Feb 2024 03:46:46 GMT Content-Type: - application/json Content-Length: @@ -185,17 +181,19 @@ http_interactions: default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' Idempotency-Key: - - b94f241f-9070-4cde-a9ba-ca5f5fa4c266 + - cbee6ab9-167f-4f87-bf9b-e756850cf038 Original-Request: - - req_C5dAJYEOBGfyxt + - req_1DypHzrDYgsR9w Request-Id: - - req_C5dAJYEOBGfyxt + - req_1DypHzrDYgsR9w Stripe-Should-Retry: - 'false' Stripe-Version: - '2023-10-16' Vary: - Origin + X-Stripe-Non-Api-Overhead-Duration-Ms: + - '184.0' X-Stripe-Routing-Context-Priority-Tier: - api-testmode Strict-Transport-Security: @@ -204,7 +202,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OlJMnKuuB1fWySn0OktZ9W6", + "id": "pi_3OiqTiGkyVbTBiYe1e33LyXE", "object": "payment_intent", "amount": 1000, "amount_capturable": 0, @@ -218,9 +216,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OlJMnKuuB1fWySn0OktZ9W6_secret_3fSpa587arHfeA8BNEORln5Me", + "client_secret": "pi_3OiqTiGkyVbTBiYe1e33LyXE_secret_Xv2XJAG5i7druXN4lekU5771E", "confirmation_method": "automatic", - "created": 1708297309, + "created": 1707709606, "currency": "aud", "customer": null, "description": null, @@ -231,7 +229,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OlJMmKuuB1fWySnHNgcZaCT", + "payment_method": "pm_1OiqThGkyVbTBiYe79xZ1M6F", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +254,29 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Sun, 18 Feb 2024 23:01:49 GMT + recorded_at: Mon, 12 Feb 2024 03:46:46 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OlJMnKuuB1fWySn0OktZ9W6 + uri: https://api.stripe.com/v1/payment_intents/pi_3OiqTiGkyVbTBiYe1e33LyXE body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.9.0 + - Stripe/v1 RubyBindings/10.2.0 Authorization: - - Bearer + - Bearer Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_C5dAJYEOBGfyxt","request_duration_ms":403}}' + - '{"last_request_metrics":{"request_id":"req_1DypHzrDYgsR9w","request_duration_ms":387}}' Stripe-Version: - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.9.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 6.1.0-17-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) - 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian - 6.1.69-1 (2023-12-30)","hostname":"blackbox"}' + - '{"bindings_version":"10.2.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +289,7 @@ http_interactions: Server: - nginx Date: - - Sun, 18 Feb 2024 23:01:49 GMT + - Mon, 12 Feb 2024 03:46:46 GMT Content-Type: - application/json Content-Length: @@ -317,11 +315,13 @@ http_interactions: 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' Request-Id: - - req_x4tAh20i3zA59E + - req_41RUDZ0JcBgpJK Stripe-Version: - '2023-10-16' Vary: - Origin + X-Stripe-Non-Api-Overhead-Duration-Ms: + - '57.99999999999999' X-Stripe-Routing-Context-Priority-Tier: - api-testmode Strict-Transport-Security: @@ -330,7 +330,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OlJMnKuuB1fWySn0OktZ9W6", + "id": "pi_3OiqTiGkyVbTBiYe1e33LyXE", "object": "payment_intent", "amount": 1000, "amount_capturable": 0, @@ -344,9 +344,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OlJMnKuuB1fWySn0OktZ9W6_secret_3fSpa587arHfeA8BNEORln5Me", + "client_secret": "pi_3OiqTiGkyVbTBiYe1e33LyXE_secret_Xv2XJAG5i7druXN4lekU5771E", "confirmation_method": "automatic", - "created": 1708297309, + "created": 1707709606, "currency": "aud", "customer": null, "description": null, @@ -357,7 +357,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OlJMmKuuB1fWySnHNgcZaCT", + "payment_method": "pm_1OiqThGkyVbTBiYe79xZ1M6F", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -382,5 +382,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Sun, 18 Feb 2024 23:01:49 GMT + recorded_at: Mon, 12 Feb 2024 03:46:46 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.9.0/Spree_Gateway_StripeSCA/_purchase/completes_the_purchase.yml b/spec/fixtures/vcr_cassettes/Stripe-v10.9.0/Spree_Gateway_StripeSCA/_purchase/completes_the_purchase.yml index 197a6890f9..9cb825d16d 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.9.0/Spree_Gateway_StripeSCA/_purchase/completes_the_purchase.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v10.9.0/Spree_Gateway_StripeSCA/_purchase/completes_the_purchase.yml @@ -1,27 +1,25 @@ --- http_interactions: - request: - method: post - uri: https://api.stripe.com/v1/payment_methods + method: get + uri: https://api.stripe.com/v1/payment_methods/pm_card_mastercard body: - encoding: UTF-8 - string: type=card&card[number]=4242424242424242&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 + encoding: US-ASCII + string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.9.0 + - Stripe/v1 RubyBindings/10.2.0 Authorization: - - Bearer + - Bearer Content-Type: - application/x-www-form-urlencoded - X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_51om1IRAHFZCV6","request_duration_ms":496}}' Stripe-Version: - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.9.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 6.1.0-17-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) - 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian - 6.1.69-1 (2023-12-30)","hostname":"blackbox"}' + - '{"bindings_version":"10.2.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +32,11 @@ http_interactions: Server: - nginx Date: - - Sun, 18 Feb 2024 23:01:39 GMT + - Mon, 12 Feb 2024 03:46:31 GMT Content-Type: - application/json Content-Length: - - '960' + - '942' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -55,21 +53,18 @@ http_interactions: Cache-Control: - no-cache, no-store Content-Security-Policy: - - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; - default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; - img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' - Idempotency-Key: - - 1544bce0-8504-40ae-85e6-99567c05a81f - Original-Request: - - req_ZZHpIWmt0Tb9QC + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods%2F%3Apayment_method; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' Request-Id: - - req_ZZHpIWmt0Tb9QC - Stripe-Should-Retry: - - 'false' + - req_hFFx1UFSv39xhy Stripe-Version: - '2023-10-16' Vary: - Origin + X-Stripe-Non-Api-Overhead-Duration-Ms: + - '138.0' X-Stripe-Routing-Context-Priority-Tier: - api-testmode Strict-Transport-Security: @@ -78,7 +73,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OlJMdKuuB1fWySnSN7kwt4O", + "id": "pm_1OiqTSGkyVbTBiYegXlSZpe8", "object": "payment_method", "billing_details": { "address": { @@ -94,23 +89,22 @@ http_interactions: "phone": null }, "card": { - "brand": "visa", + "brand": "mastercard", "checks": { "address_line1_check": null, "address_postal_code_check": null, "cvc_check": "unchecked" }, "country": "US", - "display_brand": "visa", - "exp_month": 12, + "exp_month": 2, "exp_year": 2025, - "fingerprint": "6E6tgVjx6U65iHFV", + "fingerprint": "1Zr75a6zBSZLu0Zp", "funding": "credit", "generated_from": null, - "last4": "4242", + "last4": "4444", "networks": { "available": [ - "visa" + "mastercard" ], "preferred": null }, @@ -119,35 +113,35 @@ http_interactions: }, "wallet": null }, - "created": 1708297299, + "created": 1707709590, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Sun, 18 Feb 2024 23:01:39 GMT + recorded_at: Mon, 12 Feb 2024 03:46:31 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=1000¤cy=aud&payment_method=pm_1OlJMdKuuB1fWySnSN7kwt4O&payment_method_types[0]=card&capture_method=manual + string: amount=1000¤cy=aud&payment_method=pm_1OiqTSGkyVbTBiYegXlSZpe8&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.9.0 + - Stripe/v1 RubyBindings/10.2.0 Authorization: - - Bearer + - Bearer Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_ZZHpIWmt0Tb9QC","request_duration_ms":571}}' + - '{"last_request_metrics":{"request_id":"req_hFFx1UFSv39xhy","request_duration_ms":531}}' Stripe-Version: - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.9.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 6.1.0-17-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) - 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian - 6.1.69-1 (2023-12-30)","hostname":"blackbox"}' + - '{"bindings_version":"10.2.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +154,7 @@ http_interactions: Server: - nginx Date: - - Sun, 18 Feb 2024 23:01:40 GMT + - Mon, 12 Feb 2024 03:46:31 GMT Content-Type: - application/json Content-Length: @@ -185,17 +179,19 @@ http_interactions: default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' Idempotency-Key: - - 948c081d-dd9b-42fe-8904-c66806ba6ced + - 00d5f1c9-b2ef-4a0c-b3ca-91336529c64a Original-Request: - - req_gWoQz3c7XBT7zK + - req_6LkNIZildZ9rlK Request-Id: - - req_gWoQz3c7XBT7zK + - req_6LkNIZildZ9rlK Stripe-Should-Retry: - 'false' Stripe-Version: - '2023-10-16' Vary: - Origin + X-Stripe-Non-Api-Overhead-Duration-Ms: + - '178.0' X-Stripe-Routing-Context-Priority-Tier: - api-testmode Strict-Transport-Security: @@ -204,7 +200,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OlJMdKuuB1fWySn1mC3Z7lL", + "id": "pi_3OiqTTGkyVbTBiYe0oEyxvMp", "object": "payment_intent", "amount": 1000, "amount_capturable": 0, @@ -218,9 +214,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OlJMdKuuB1fWySn1mC3Z7lL_secret_A5cHGtk5DKIuxGVjMQtq0RMlA", + "client_secret": "pi_3OiqTTGkyVbTBiYe0oEyxvMp_secret_fEWUt67pPAN7ia8aNL7R1ePM9", "confirmation_method": "automatic", - "created": 1708297299, + "created": 1707709591, "currency": "aud", "customer": null, "description": null, @@ -231,7 +227,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OlJMdKuuB1fWySnSN7kwt4O", + "payment_method": "pm_1OiqTSGkyVbTBiYegXlSZpe8", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +252,29 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Sun, 18 Feb 2024 23:01:40 GMT + recorded_at: Mon, 12 Feb 2024 03:46:31 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OlJMdKuuB1fWySn1mC3Z7lL/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3OiqTTGkyVbTBiYe0oEyxvMp/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.9.0 + - Stripe/v1 RubyBindings/10.2.0 Authorization: - - Bearer + - Bearer Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_gWoQz3c7XBT7zK","request_duration_ms":580}}' + - '{"last_request_metrics":{"request_id":"req_6LkNIZildZ9rlK","request_duration_ms":484}}' Stripe-Version: - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.9.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 6.1.0-17-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) - 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian - 6.1.69-1 (2023-12-30)","hostname":"blackbox"}' + - '{"bindings_version":"10.2.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +287,7 @@ http_interactions: Server: - nginx Date: - - Sun, 18 Feb 2024 23:01:41 GMT + - Mon, 12 Feb 2024 03:46:32 GMT Content-Type: - application/json Content-Length: @@ -317,17 +313,19 @@ http_interactions: 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' Idempotency-Key: - - 870a6954-88b1-467c-8fa9-277015f3722e + - cad3cbd3-85ec-45d6-af7e-db634c5396be Original-Request: - - req_afZee7GuNtasTS + - req_c0YFD1rixOGBNW Request-Id: - - req_afZee7GuNtasTS + - req_c0YFD1rixOGBNW Stripe-Should-Retry: - 'false' Stripe-Version: - '2023-10-16' Vary: - Origin + X-Stripe-Non-Api-Overhead-Duration-Ms: + - '713.0' X-Stripe-Routing-Context-Priority-Tier: - api-testmode Strict-Transport-Security: @@ -336,7 +334,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OlJMdKuuB1fWySn1mC3Z7lL", + "id": "pi_3OiqTTGkyVbTBiYe0oEyxvMp", "object": "payment_intent", "amount": 1000, "amount_capturable": 1000, @@ -350,20 +348,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OlJMdKuuB1fWySn1mC3Z7lL_secret_A5cHGtk5DKIuxGVjMQtq0RMlA", + "client_secret": "pi_3OiqTTGkyVbTBiYe0oEyxvMp_secret_fEWUt67pPAN7ia8aNL7R1ePM9", "confirmation_method": "automatic", - "created": 1708297299, + "created": 1707709591, "currency": "aud", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OlJMdKuuB1fWySn1Si9UkuX", + "latest_charge": "ch_3OiqTTGkyVbTBiYe0jeLlsRt", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OlJMdKuuB1fWySnSN7kwt4O", + "payment_method": "pm_1OiqTSGkyVbTBiYegXlSZpe8", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,29 +386,29 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Sun, 18 Feb 2024 23:01:41 GMT + recorded_at: Mon, 12 Feb 2024 03:46:32 GMT - request: method: get - uri: https://api.stripe.com/v1/payment_intents/pi_3OlJMdKuuB1fWySn1mC3Z7lL + uri: https://api.stripe.com/v1/payment_intents/pi_3OiqTTGkyVbTBiYe0oEyxvMp body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.9.0 + - Stripe/v1 RubyBindings/10.2.0 Authorization: - - Bearer + - Bearer Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_afZee7GuNtasTS","request_duration_ms":1147}}' + - '{"last_request_metrics":{"request_id":"req_c0YFD1rixOGBNW","request_duration_ms":921}}' Stripe-Version: - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.9.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 6.1.0-17-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) - 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian - 6.1.69-1 (2023-12-30)","hostname":"blackbox"}' + - '{"bindings_version":"10.2.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -423,7 +421,7 @@ http_interactions: Server: - nginx Date: - - Sun, 18 Feb 2024 23:01:43 GMT + - Mon, 12 Feb 2024 03:46:34 GMT Content-Type: - application/json Content-Length: @@ -449,11 +447,13 @@ http_interactions: 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' Request-Id: - - req_nvxMljuYGpNN36 + - req_SnM5lbQViqtjbG Stripe-Version: - '2023-10-16' Vary: - Origin + X-Stripe-Non-Api-Overhead-Duration-Ms: + - '70.0' X-Stripe-Routing-Context-Priority-Tier: - api-testmode Strict-Transport-Security: @@ -462,7 +462,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OlJMdKuuB1fWySn1mC3Z7lL", + "id": "pi_3OiqTTGkyVbTBiYe0oEyxvMp", "object": "payment_intent", "amount": 1000, "amount_capturable": 1000, @@ -476,20 +476,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OlJMdKuuB1fWySn1mC3Z7lL_secret_A5cHGtk5DKIuxGVjMQtq0RMlA", + "client_secret": "pi_3OiqTTGkyVbTBiYe0oEyxvMp_secret_fEWUt67pPAN7ia8aNL7R1ePM9", "confirmation_method": "automatic", - "created": 1708297299, + "created": 1707709591, "currency": "aud", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OlJMdKuuB1fWySn1Si9UkuX", + "latest_charge": "ch_3OiqTTGkyVbTBiYe0jeLlsRt", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OlJMdKuuB1fWySnSN7kwt4O", + "payment_method": "pm_1OiqTSGkyVbTBiYegXlSZpe8", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -514,10 +514,10 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Sun, 18 Feb 2024 23:01:43 GMT + recorded_at: Mon, 12 Feb 2024 03:46:34 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OlJMdKuuB1fWySn1mC3Z7lL/capture + uri: https://api.stripe.com/v1/payment_intents/pi_3OiqTTGkyVbTBiYe0oEyxvMp/capture body: encoding: UTF-8 string: amount_to_capture=1000 @@ -525,13 +525,13 @@ http_interactions: Content-Type: - application/x-www-form-urlencoded Authorization: - - Basic c2tfdGVzdF94RmdKUU9sWHBNQUZzb3p0endGQlRGaFAwMEhHN0J1Q0ptOg== + - Basic c2tfdGVzdF9HRlFXMnU4c2xsbmxBTzYxN2FUODFRdko6 User-Agent: - - Stripe/v1 ActiveMerchantBindings/1.123.0 + - Stripe/v1 ActiveMerchantBindings/1.133.0 Stripe-Version: - - '2019-05-16' + - '2020-08-27' X-Stripe-Client-User-Agent: - - '{"bindings_version":"1.123.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","publisher":"active_merchant"}' + - '{"bindings_version":"1.133.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","publisher":"active_merchant"}' X-Stripe-Client-User-Metadata: - '{"ip":null}' Connection: @@ -548,11 +548,11 @@ http_interactions: Server: - nginx Date: - - Sun, 18 Feb 2024 23:01:44 GMT + - Mon, 12 Feb 2024 03:46:35 GMT Content-Type: - application/json Content-Length: - - '5152' + - '5138' Connection: - close Access-Control-Allow-Credentials: @@ -574,17 +574,19 @@ http_interactions: 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' Idempotency-Key: - - 517a8ae3-9501-48d9-9225-51eb365643bb + - 180b5f53-661c-4d2b-acb6-24bde086c561 Original-Request: - - req_OIwCtiBaYsGTF8 + - req_1hdxqRBMl4cNHD Request-Id: - - req_OIwCtiBaYsGTF8 + - req_1hdxqRBMl4cNHD Stripe-Should-Retry: - 'false' Stripe-Version: - - '2019-05-16' + - '2020-08-27' Vary: - Origin + X-Stripe-Non-Api-Overhead-Duration-Ms: + - '778.0' X-Stripe-Routing-Context-Priority-Tier: - api-testmode Strict-Transport-Security: @@ -593,7 +595,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OlJMdKuuB1fWySn1mC3Z7lL", + "id": "pi_3OiqTTGkyVbTBiYe0oEyxvMp", "object": "payment_intent", "amount": 1000, "amount_capturable": 0, @@ -611,16 +613,15 @@ http_interactions: "object": "list", "data": [ { - "id": "ch_3OlJMdKuuB1fWySn1Si9UkuX", + "id": "ch_3OiqTTGkyVbTBiYe0jeLlsRt", "object": "charge", "amount": 1000, "amount_captured": 1000, "amount_refunded": 0, - "amount_updates": [], "application": null, "application_fee": null, "application_fee_amount": null, - "balance_transaction": "txn_3OlJMdKuuB1fWySn1EtKks3E", + "balance_transaction": "txn_3OiqTTGkyVbTBiYe068H10eP", "billing_details": { "address": { "city": null, @@ -634,9 +635,9 @@ http_interactions: "name": null, "phone": null }, - "calculated_statement_descriptor": "OFNOFNOFN", + "calculated_statement_descriptor": "OPENFOODNETWORK", "captured": true, - "created": 1708297300, + "created": 1707709592, "currency": "aud", "customer": null, "description": null, @@ -656,41 +657,41 @@ http_interactions: "network_status": "approved_by_network", "reason": null, "risk_level": "normal", - "risk_score": 50, + "risk_score": 2, "seller_message": "Payment complete.", "type": "authorized" }, "paid": true, - "payment_intent": "pi_3OlJMdKuuB1fWySn1mC3Z7lL", - "payment_method": "pm_1OlJMdKuuB1fWySnSN7kwt4O", + "payment_intent": "pi_3OiqTTGkyVbTBiYe0oEyxvMp", + "payment_method": "pm_1OiqTSGkyVbTBiYegXlSZpe8", "payment_method_details": { "card": { "amount_authorized": 1000, - "brand": "visa", - "capture_before": 1708902100, + "brand": "mastercard", + "capture_before": 1708314392, "checks": { "address_line1_check": null, "address_postal_code_check": null, "cvc_check": "pass" }, "country": "US", - "exp_month": 12, + "exp_month": 2, "exp_year": 2025, "extended_authorization": { "status": "disabled" }, - "fingerprint": "6E6tgVjx6U65iHFV", + "fingerprint": "1Zr75a6zBSZLu0Zp", "funding": "credit", "incremental_authorization": { "status": "unavailable" }, "installments": null, - "last4": "4242", + "last4": "4444", "mandate": null, "multicapture": { "status": "unavailable" }, - "network": "visa", + "network": "mastercard", "network_token": { "used": false }, @@ -706,14 +707,14 @@ http_interactions: "radar_options": {}, "receipt_email": null, "receipt_number": null, - "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xRmlxRXNLdXVCMWZXeVNuKNiYyq4GMgaRL-XiUw86LBZE508pdjPqCQjn3Qti4m-zS9ApaX9PdD7COJl9LEw4dcNQKFdVD-7D8l3g", + "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xQVBRcmVHa3lWYlRCaVllKJuppq4GMgZqhtW4UmU6LBb6C-hm4GQkFY_GabTkAfy0cZ1SwjrcaIGPt4NbAQObuJfLF2dsVRziJCiV", "refunded": false, "refunds": { "object": "list", "data": [], "has_more": false, "total_count": 0, - "url": "/v1/charges/ch_3OlJMdKuuB1fWySn1Si9UkuX/refunds" + "url": "/v1/charges/ch_3OiqTTGkyVbTBiYe0jeLlsRt/refunds" }, "review": null, "shipping": null, @@ -728,22 +729,22 @@ http_interactions: ], "has_more": false, "total_count": 1, - "url": "/v1/charges?payment_intent=pi_3OlJMdKuuB1fWySn1mC3Z7lL" + "url": "/v1/charges?payment_intent=pi_3OiqTTGkyVbTBiYe0oEyxvMp" }, - "client_secret": "pi_3OlJMdKuuB1fWySn1mC3Z7lL_secret_A5cHGtk5DKIuxGVjMQtq0RMlA", + "client_secret": "pi_3OiqTTGkyVbTBiYe0oEyxvMp_secret_fEWUt67pPAN7ia8aNL7R1ePM9", "confirmation_method": "automatic", - "created": 1708297299, + "created": 1707709591, "currency": "aud", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OlJMdKuuB1fWySn1Si9UkuX", + "latest_charge": "ch_3OiqTTGkyVbTBiYe0jeLlsRt", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OlJMdKuuB1fWySnSN7kwt4O", + "payment_method": "pm_1OiqTSGkyVbTBiYegXlSZpe8", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -768,5 +769,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Sun, 18 Feb 2024 23:01:44 GMT + recorded_at: Mon, 12 Feb 2024 03:46:35 GMT recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/Stripe-v10.9.0/Spree_Gateway_StripeSCA/_purchase/provides_an_error_message_to_help_developer_debug.yml b/spec/fixtures/vcr_cassettes/Stripe-v10.9.0/Spree_Gateway_StripeSCA/_purchase/provides_an_error_message_to_help_developer_debug.yml index c5a0be7f7d..4353de244d 100644 --- a/spec/fixtures/vcr_cassettes/Stripe-v10.9.0/Spree_Gateway_StripeSCA/_purchase/provides_an_error_message_to_help_developer_debug.yml +++ b/spec/fixtures/vcr_cassettes/Stripe-v10.9.0/Spree_Gateway_StripeSCA/_purchase/provides_an_error_message_to_help_developer_debug.yml @@ -1,27 +1,27 @@ --- http_interactions: - request: - method: post - uri: https://api.stripe.com/v1/payment_methods + method: get + uri: https://api.stripe.com/v1/payment_methods/pm_card_mastercard body: - encoding: UTF-8 - string: type=card&card[number]=4242424242424242&card[exp_month]=12&card[exp_year]=2025&card[cvc]=314 + encoding: US-ASCII + string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.9.0 + - Stripe/v1 RubyBindings/10.2.0 Authorization: - - Bearer + - Bearer Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_nvxMljuYGpNN36","request_duration_ms":417}}' + - '{"last_request_metrics":{"request_id":"req_SnM5lbQViqtjbG","request_duration_ms":358}}' Stripe-Version: - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.9.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 6.1.0-17-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) - 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian - 6.1.69-1 (2023-12-30)","hostname":"blackbox"}' + - '{"bindings_version":"10.2.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -34,11 +34,11 @@ http_interactions: Server: - nginx Date: - - Sun, 18 Feb 2024 23:01:45 GMT + - Mon, 12 Feb 2024 03:46:35 GMT Content-Type: - application/json Content-Length: - - '960' + - '942' Connection: - keep-alive Access-Control-Allow-Credentials: @@ -55,21 +55,18 @@ http_interactions: Cache-Control: - no-cache, no-store Content-Security-Policy: - - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods; block-all-mixed-content; - default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; - img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' - Idempotency-Key: - - '0840ae80-e34d-4ca4-9b24-4872ef60a47b' - Original-Request: - - req_JdKtYmo8F5PGGZ + - report-uri https://q.stripe.com/csp-report?p=v1%2Fpayment_methods%2F%3Apayment_method; + block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action + 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; + style-src 'self' Request-Id: - - req_JdKtYmo8F5PGGZ - Stripe-Should-Retry: - - 'false' + - req_Wr1CrKPOYhGknI Stripe-Version: - '2023-10-16' Vary: - Origin + X-Stripe-Non-Api-Overhead-Duration-Ms: + - '144.00000000000003' X-Stripe-Routing-Context-Priority-Tier: - api-testmode Strict-Transport-Security: @@ -78,7 +75,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pm_1OlJMiKuuB1fWySn9UkunsGB", + "id": "pm_1OiqTXGkyVbTBiYeyvRuXFKv", "object": "payment_method", "billing_details": { "address": { @@ -94,23 +91,22 @@ http_interactions: "phone": null }, "card": { - "brand": "visa", + "brand": "mastercard", "checks": { "address_line1_check": null, "address_postal_code_check": null, "cvc_check": "unchecked" }, "country": "US", - "display_brand": "visa", - "exp_month": 12, + "exp_month": 2, "exp_year": 2025, - "fingerprint": "6E6tgVjx6U65iHFV", + "fingerprint": "1Zr75a6zBSZLu0Zp", "funding": "credit", "generated_from": null, - "last4": "4242", + "last4": "4444", "networks": { "available": [ - "visa" + "mastercard" ], "preferred": null }, @@ -119,35 +115,35 @@ http_interactions: }, "wallet": null }, - "created": 1708297305, + "created": 1707709595, "customer": null, "livemode": false, "metadata": {}, "type": "card" } - recorded_at: Sun, 18 Feb 2024 23:01:45 GMT + recorded_at: Mon, 12 Feb 2024 03:46:35 GMT - request: method: post uri: https://api.stripe.com/v1/payment_intents body: encoding: UTF-8 - string: amount=1000¤cy=aud&payment_method=pm_1OlJMiKuuB1fWySn9UkunsGB&payment_method_types[0]=card&capture_method=manual + string: amount=1000¤cy=aud&payment_method=pm_1OiqTXGkyVbTBiYeyvRuXFKv&payment_method_types[0]=card&capture_method=manual headers: User-Agent: - - Stripe/v1 RubyBindings/10.9.0 + - Stripe/v1 RubyBindings/10.2.0 Authorization: - - Bearer + - Bearer Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_JdKtYmo8F5PGGZ","request_duration_ms":479}}' + - '{"last_request_metrics":{"request_id":"req_Wr1CrKPOYhGknI","request_duration_ms":354}}' Stripe-Version: - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.9.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 6.1.0-17-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) - 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian - 6.1.69-1 (2023-12-30)","hostname":"blackbox"}' + - '{"bindings_version":"10.2.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -160,7 +156,7 @@ http_interactions: Server: - nginx Date: - - Sun, 18 Feb 2024 23:01:45 GMT + - Mon, 12 Feb 2024 03:46:35 GMT Content-Type: - application/json Content-Length: @@ -185,17 +181,19 @@ http_interactions: default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' Idempotency-Key: - - b330b83b-e5d0-4df4-805f-b403a0cceac0 + - 451b60a5-f932-46c0-b101-5c67e1a9e6f2 Original-Request: - - req_pUQ6XBsrwBJj7c + - req_mOJcscgCtaoJZB Request-Id: - - req_pUQ6XBsrwBJj7c + - req_mOJcscgCtaoJZB Stripe-Should-Retry: - 'false' Stripe-Version: - '2023-10-16' Vary: - Origin + X-Stripe-Non-Api-Overhead-Duration-Ms: + - '197.0' X-Stripe-Routing-Context-Priority-Tier: - api-testmode Strict-Transport-Security: @@ -204,7 +202,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OlJMjKuuB1fWySn0hkOQ7rg", + "id": "pi_3OiqTXGkyVbTBiYe1KcfbvwC", "object": "payment_intent", "amount": 1000, "amount_capturable": 0, @@ -218,9 +216,9 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OlJMjKuuB1fWySn0hkOQ7rg_secret_jAW17UAwyZyLVD3FVMy2wf3Bh", + "client_secret": "pi_3OiqTXGkyVbTBiYe1KcfbvwC_secret_f7lFpbpOxCMEtBmvrK72gzHU5", "confirmation_method": "automatic", - "created": 1708297305, + "created": 1707709595, "currency": "aud", "customer": null, "description": null, @@ -231,7 +229,7 @@ http_interactions: "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OlJMiKuuB1fWySn9UkunsGB", + "payment_method": "pm_1OiqTXGkyVbTBiYeyvRuXFKv", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -256,29 +254,29 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Sun, 18 Feb 2024 23:01:45 GMT + recorded_at: Mon, 12 Feb 2024 03:46:36 GMT - request: method: post - uri: https://api.stripe.com/v1/payment_intents/pi_3OlJMjKuuB1fWySn0hkOQ7rg/confirm + uri: https://api.stripe.com/v1/payment_intents/pi_3OiqTXGkyVbTBiYe1KcfbvwC/confirm body: encoding: US-ASCII string: '' headers: User-Agent: - - Stripe/v1 RubyBindings/10.9.0 + - Stripe/v1 RubyBindings/10.2.0 Authorization: - - Bearer + - Bearer Content-Type: - application/x-www-form-urlencoded X-Stripe-Client-Telemetry: - - '{"last_request_metrics":{"request_id":"req_pUQ6XBsrwBJj7c","request_duration_ms":508}}' + - '{"last_request_metrics":{"request_id":"req_mOJcscgCtaoJZB","request_duration_ms":432}}' Stripe-Version: - '2023-10-16' X-Stripe-Client-User-Agent: - - '{"bindings_version":"10.9.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux - version 6.1.0-17-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) - 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian - 6.1.69-1 (2023-12-30)","hostname":"blackbox"}' + - '{"bindings_version":"10.2.0","lang":"ruby","lang_version":"3.1.4 p223 (2023-03-30)","platform":"x86_64-linux","engine":"ruby","publisher":"stripe","uname":"Linux + version 5.15.0-92-generic (buildd@lcy02-amd64-002) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) + 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #102~20.04.1-Ubuntu SMP Mon + Jan 15 13:09:14 UTC 2024","hostname":"gaetan-Dell-G15"}' Accept-Encoding: - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 Accept: @@ -291,7 +289,7 @@ http_interactions: Server: - nginx Date: - - Sun, 18 Feb 2024 23:01:46 GMT + - Mon, 12 Feb 2024 03:46:36 GMT Content-Type: - application/json Content-Length: @@ -317,17 +315,19 @@ http_interactions: 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self' Idempotency-Key: - - 97d0bf60-c1e6-4615-ad6c-edb10db55a49 + - e2c61e6c-52f3-428c-b539-6897feb57bd4 Original-Request: - - req_0uMthnY2adDsVr + - req_RQ4tnyZMxaTrfg Request-Id: - - req_0uMthnY2adDsVr + - req_RQ4tnyZMxaTrfg Stripe-Should-Retry: - 'false' Stripe-Version: - '2023-10-16' Vary: - Origin + X-Stripe-Non-Api-Overhead-Duration-Ms: + - '705.0' X-Stripe-Routing-Context-Priority-Tier: - api-testmode Strict-Transport-Security: @@ -336,7 +336,7 @@ http_interactions: encoding: UTF-8 string: |- { - "id": "pi_3OlJMjKuuB1fWySn0hkOQ7rg", + "id": "pi_3OiqTXGkyVbTBiYe1KcfbvwC", "object": "payment_intent", "amount": 1000, "amount_capturable": 1000, @@ -350,20 +350,20 @@ http_interactions: "canceled_at": null, "cancellation_reason": null, "capture_method": "manual", - "client_secret": "pi_3OlJMjKuuB1fWySn0hkOQ7rg_secret_jAW17UAwyZyLVD3FVMy2wf3Bh", + "client_secret": "pi_3OiqTXGkyVbTBiYe1KcfbvwC_secret_f7lFpbpOxCMEtBmvrK72gzHU5", "confirmation_method": "automatic", - "created": 1708297305, + "created": 1707709595, "currency": "aud", "customer": null, "description": null, "invoice": null, "last_payment_error": null, - "latest_charge": "ch_3OlJMjKuuB1fWySn0DrvIzRN", + "latest_charge": "ch_3OiqTXGkyVbTBiYe10IKjyYG", "livemode": false, "metadata": {}, "next_action": null, "on_behalf_of": null, - "payment_method": "pm_1OlJMiKuuB1fWySn9UkunsGB", + "payment_method": "pm_1OiqTXGkyVbTBiYeyvRuXFKv", "payment_method_configuration_details": null, "payment_method_options": { "card": { @@ -388,5 +388,5 @@ http_interactions: "transfer_data": null, "transfer_group": null } - recorded_at: Sun, 18 Feb 2024 23:01:46 GMT + recorded_at: Mon, 12 Feb 2024 03:46:36 GMT recorded_with: VCR 6.2.0 diff --git a/spec/models/spree/gateway/stripe_sca_spec.rb b/spec/models/spree/gateway/stripe_sca_spec.rb index 3c704b80fc..ae19ec324d 100644 --- a/spec/models/spree/gateway/stripe_sca_spec.rb +++ b/spec/models/spree/gateway/stripe_sca_spec.rb @@ -3,7 +3,6 @@ require 'spec_helper' describe Spree::Gateway::StripeSCA, type: :model do - let(:order) { create(:order_ready_for_payment) } let(:year_valid) { Time.zone.now.year.next } @@ -25,17 +24,10 @@ describe Spree::Gateway::StripeSCA, type: :model do { order_id: order.number } } - let(:pm_card) do - Stripe::PaymentMethod.create({ - type: 'card', - card: { - number: '4242424242424242', - exp_month: 12, - exp_year: year_valid, - cvc: '314', - }, - }) - end + # Stripe testing card: + # https://stripe.com/docs/testing?testing-method=payment-methods + let(:pm_card) { Stripe::PaymentMethod.retrieve('pm_card_mastercard') } + let(:payment_intent) do Stripe::PaymentIntent.create({ amount: 1000, # given in AUD cents @@ -71,6 +63,77 @@ describe Spree::Gateway::StripeSCA, type: :model do end end + describe "#void", :vcr, :stripe_version do + # This is the first account retrieved using Stripe::Account.list + let(:stripe_test_account) { "acct_1OhZ9lQQeZbvfZRJ" } + + before do + # Inject our test stripe account + stripe_account = create(:stripe_account, stripe_user_id: stripe_test_account) + allow(StripeAccount).to receive(:find_by).and_return(stripe_account) + end + + context "with a confirmed payment" do + it "refunds the payment" do + # Link the payment intent to our test stripe account, and automatically confirm and capture + # the payment. + payment_intent = Stripe::PaymentIntent.create( + { + amount: 1000, # given in AUD cents + currency: 'aud', # AUD to match order currency + payment_method: 'pm_card_mastercard', + payment_method_types: ['card'], + capture_method: 'automatic', + confirm: true, + }, + stripe_account: stripe_test_account + ) + + payment = create( + :payment, + order:, + amount: order.total, + payment_method: subject, + source: credit_card, + response_code: payment_intent.id + ) + + response = subject.void(payment_intent.id, nil, {}) + + expect(response.success?).to eq true + end + end + + context "with a voidable payment" do + it "void the payment" do + # Link the payment intent to our test stripe account + payment_intent = Stripe::PaymentIntent.create( + { + amount: 1000, # given in AUD cents + currency: 'aud', # AUD to match order currency + payment_method: 'pm_card_mastercard', + payment_method_types: ['card'], + capture_method: 'manual' + }, + stripe_account: stripe_test_account + ) + + payment = create( + :payment, + order:, + amount: order.total, + payment_method: subject, + source: credit_card, + response_code: payment_intent.id + ) + + response = subject.void(payment_intent.id, nil, {}) + + expect(response.success?).to eq true + end + end + end + describe "#error message", :vcr, :stripe_version do context "when payment intent state is not in 'requires_capture' state" do before do