Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
test_stripe: Normalize escape-encoded client_secret values.
Aman Agrawal184a71145a8b
diff --git a/corporate/lib/test_stripe_class.py b/corporate/lib/test_stripe_class.pyindex c951311a040..fa29a77f280 100644--- a/corporate/lib/test_stripe_class.py+++ b/corporate/lib/test_stripe_class.py@@ -211,7 +211,6 @@ def normalize_fixture_data(decorated_function: CallableT) -> None: # nocoverager'"fingerprint": "[A-Za-z0-9]{16}"': '"fingerprint": "NORMALIZED"',r'"number": "[A-Za-z0-9]{7,8}-[A-Za-z0-9]{4}"': '"number": "NORMALIZED"',r'"address": "[A-Za-z0-9]{9}-test_[A-Za-z0-9]{12}"': '"address": "000000000-test_NORMALIZED"',- r'"client_secret": "[\w]+"': '"client_secret": "NORMALIZED"',r'"url": "https://billing.stripe.com/p/session/test_([\w]+)"': "NORMALIZED",r'"url": "https://checkout.stripe.com/c/pay/cs_test_([\w#%]+)"': "NORMALIZED",r'"receipt_url": "https://pay.stripe.com/receipts/invoices/([\w-]+)\?s=[\w]+"': "NORMALIZED",@@ -254,6 +253,13 @@ def normalize_fixture_data(decorated_function: CallableT) -> None: # nocoverager'\1": "00000000-0000-0000-0000-000000000000"',file_content,)+ # client_secret fields appear both at the JSON top-level of fixtures and+ # inside doubly-escaped strings in error fixtures. Match both forms.+ file_content = re.sub(+ r'(\\?")client_secret(\\?": \\?")[^"\\]+(\\?")',+ r"\1client_secret\2NORMALIZED\3",+ file_content,+ )# Datesfile_content = re.sub(r'(?<="Date": )"(.* GMT)"', '"NORMALIZED DATETIME"', file_content)file_content = re.sub(r"[0-3]\d [A-Z][a-z]{2} 20[1-2]\d", "NORMALIZED DATE", file_content)diff --git a/corporate/tests/stripe_fixtures/card_attached_to_customer_but_payment_fails--Invoice.pay.1.json b/corporate/tests/stripe_fixtures/card_attached_to_customer_but_payment_fails--Invoice.pay.1.jsonindex ade1848df27..20a3dec6c4f 100644--- a/corporate/tests/stripe_fixtures/card_attached_to_customer_but_payment_fails--Invoice.pay.1.json+++ b/corporate/tests/stripe_fixtures/card_attached_to_customer_but_payment_fails--Invoice.pay.1.json@@ -211,7 +211,7 @@"X-Stripe-Routing-Context-Priority-Tier": "api-testmode","X-Wc": "ABGHIJ"},- "http_body": "{\n \"error\": {\n \"advice_code\": \"try_again_later\",\n \"charge\": \"ch_NORMALIZED\",\n \"code\": \"card_declined\",\n \"decline_code\": \"generic_decline\",\n \"doc_url\": \"https://stripe.com/docs/error-codes/card-declined\",\n \"message\": \"Your card was declined.\",\n \"network_decline_code\": \"01\",\n \"payment_intent\": {\n \"id\": \"card_attached_to_customer_but_payment_fails--Invoice.pay.1.json\",\n \"object\": \"payment_intent\",\n \"amount\": 48000,\n \"amount_capturable\": 0,\n \"amount_details\": {\n \"tip\": {}\n },\n \"amount_received\": 0,\n \"application\": null,\n \"application_fee_amount\": null,\n \"automatic_payment_methods\": null,\n \"canceled_at\": null,\n \"cancellation_reason\": null,\n \"capture_method\": \"automatic\",\n \"client_secret\": \"card_attached_to_customer_but_payment_fails--Invoice.pay.1.json_secret_LcyGuiYPiDYLEoHhz27stuFUm\",\n \"confirmation_method\": \"automatic\",\n \"created\": 1000000000,\n \"currency\": \"usd\",\n \"customer\": \"cus_NORMALIZED\",\n \"description\": \"Payment for Invoice\",\n \"excluded_payment_method_types\": null,\n \"last_payment_error\": {\n \"advice_code\": \"try_again_later\",\n \"charge\": \"ch_NORMALIZED\",\n \"code\": \"card_declined\",\n \"decline_code\": \"generic_decline\",\n \"doc_url\": \"https://stripe.com/docs/error-codes/card-declined\",\n \"message\": \"Your card was declined.\",\n \"network_decline_code\": \"01\",\n \"payment_method\": {\n \"id\": \"card_attached_to_customer_but_payment_fails--Customer.retrieve.1.json\",\n \"object\": \"payment_method\",\n \"allow_redisplay\": \"unspecified\",\n \"billing_details\": {\n \"address\": {\n \"city\": \"San Francisco\",\n \"country\": \"US\",\n \"line1\": \"123 Main St\",\n \"line2\": null,\n \"postal_code\": \"94105\",\n \"state\": \"CA\"\n },\n \"email\": null,\n \"name\": \"John Doe\",\n \"phone\": null,\n \"tax_id\": null\n },\n \"card\": {\n \"brand\": \"visa\",\n \"checks\": {\n \"address_line1_check\": \"pass\",\n \"address_postal_code_check\": \"pass\",\n \"cvc_check\": \"pass\"\n },\n \"country\": \"US\",\n \"display_brand\": \"visa\",\n \"exp_month\": 11,\n \"exp_year\": 2026,\n \"fingerprint\": \"mZkoRizHb5PdJf0T\",\n \"funding\": \"credit\",\n \"generated_from\": null,\n \"last4\": \"0341\",\n \"networks\": {\n \"available\": [\n \"visa\"\n ],\n \"preferred\": null\n },\n \"regulated_status\": \"unregulated\",\n \"three_d_secure_usage\": {\n \"supported\": true\n },\n \"wallet\": null\n },\n \"created\": 1000000000,\n \"customer\": \"cus_NORMALIZED\",\n \"livemode\": false,\n \"metadata\": {},\n \"type\": \"card\"\n },\n \"type\": \"card_error\"\n },\n \"latest_charge\": \"ch_NORMALIZED\",\n \"livemode\": false,\n \"metadata\": {},\n \"next_action\": null,\n \"on_behalf_of\": null,\n \"payment_details\": {\n \"customer_reference\": null,\n \"order_reference\": \"in_1SVWkwDwzgQ85STgEeCcIY\"\n },\n \"payment_method\": null,\n \"payment_method_configuration_details\": null,\n \"payment_method_options\": {\n \"card\": {\n \"installments\": null,\n \"mandate_options\": null,\n \"network\": null,\n \"request_three_d_secure\": \"automatic\"\n },\n \"link\": {\n \"persistent_token\": null\n }\n },\n \"payment_method_types\": [\n \"card\",\n \"link\"\n ],\n \"processing\": null,\n \"receipt_email\": \"[email protected]\",\n \"review\": null,\n \"setup_future_usage\": null,\n \"shipping\": null,\n \"source\": null,\n \"statement_descriptor\": \"Zulip Cloud Standard\",\n \"statement_descriptor_suffix\": null,\n \"status\": \"requires_payment_method\",\n \"transfer_data\": null,\n \"transfer_group\": null\n },\n \"payment_method\": {\n \"id\": \"card_attached_to_customer_but_payment_fails--Customer.retrieve.1.json\",\n \"object\": \"payment_method\",\n \"allow_redisplay\": \"unspecified\",\n \"billing_details\": {\n \"address\": {\n \"city\": \"San Francisco\",\n \"country\": \"US\",\n \"line1\": \"123 Main St\",\n \"line2\": null,\n \"postal_code\": \"94105\",\n \"state\": \"CA\"\n },\n \"email\": null,\n \"name\": \"John Doe\",\n \"phone\": null,\n \"tax_id\": null\n },\n \"card\": {\n \"brand\": \"visa\",\n \"checks\": {\n \"address_line1_check\": \"pass\",\n \"address_postal_code_check\": \"pass\",\n \"cvc_check\": \"pass\"\n },\n \"country\": \"US\",\n \"display_brand\": \"visa\",\n \"exp_month\": 11,\n \"exp_year\": 2026,\n \"fingerprint\": \"mZkoRizHb5PdJf0T\",\n \"funding\": \"credit\",\n \"generated_from\": null,\n \"last4\": \"0341\",\n \"networks\": {\n \"available\": [\n \"visa\"\n ],\n \"preferred\": null\n },\n \"regulated_status\": \"unregulated\",\n \"three_d_secure_usage\": {\n \"supported\": true\n },\n \"wallet\": null\n },\n \"created\": 1000000000,\n \"customer\": \"cus_NORMALIZED\",\n \"livemode\": false,\n \"metadata\": {},\n \"type\": \"card\"\n },\n \"request_log_url\": \"https://dashboard.stripe.com/test/logs/req_NORMALIZED?t=1763640877\",\n \"type\": \"card_error\"\n }\n}\n",+ "http_body": "{\n \"error\": {\n \"advice_code\": \"try_again_later\",\n \"charge\": \"ch_NORMALIZED\",\n \"code\": \"card_declined\",\n \"decline_code\": \"generic_decline\",\n \"doc_url\": \"https://stripe.com/docs/error-codes/card-declined\",\n \"message\": \"Your card was declined.\",\n \"network_decline_code\": \"01\",\n \"payment_intent\": {\n \"id\": \"card_attached_to_customer_but_payment_fails--Invoice.pay.1.json\",\n \"object\": \"payment_intent\",\n \"amount\": 48000,\n \"amount_capturable\": 0,\n \"amount_details\": {\n \"tip\": {}\n },\n \"amount_received\": 0,\n \"application\": null,\n \"application_fee_amount\": null,\n \"automatic_payment_methods\": null,\n \"canceled_at\": null,\n \"cancellation_reason\": null,\n \"capture_method\": \"automatic\",\n \"client_secret\": \"NORMALIZED\",\n \"confirmation_method\": \"automatic\",\n \"created\": 1000000000,\n \"currency\": \"usd\",\n \"customer\": \"cus_NORMALIZED\",\n \"description\": \"Payment for Invoice\",\n \"excluded_payment_method_types\": null,\n \"last_payment_error\": {\n \"advice_code\": \"try_again_later\",\n \"charge\": \"ch_NORMALIZED\",\n \"code\": \"card_declined\",\n \"decline_code\": \"generic_decline\",\n \"doc_url\": \"https://stripe.com/docs/error-codes/card-declined\",\n \"message\": \"Your card was declined.\",\n \"network_decline_code\": \"01\",\n \"payment_method\": {\n \"id\": \"card_attached_to_customer_but_payment_fails--Customer.retrieve.1.json\",\n \"object\": \"payment_method\",\n \"allow_redisplay\": \"unspecified\",\n \"billing_details\": {\n \"address\": {\n \"city\": \"San Francisco\",\n \"country\": \"US\",\n \"line1\": \"123 Main St\",\n \"line2\": null,\n \"postal_code\": \"94105\",\n \"state\": \"CA\"\n },\n \"email\": null,\n \"name\": \"John Doe\",\n \"phone\": null,\n \"tax_id\": null\n },\n \"card\": {\n \"brand\": \"visa\",\n \"checks\": {\n \"address_line1_check\": \"pass\",\n \"address_postal_code_check\": \"pass\",\n \"cvc_check\": \"pass\"\n },\n \"country\": \"US\",\n \"display_brand\": \"visa\",\n \"exp_month\": 11,\n \"exp_year\": 2026,\n \"fingerprint\": \"mZkoRizHb5PdJf0T\",\n \"funding\": \"credit\",\n \"generated_from\": null,\n \"last4\": \"0341\",\n \"networks\": {\n \"available\": [\n \"visa\"\n ],\n \"preferred\": null\n },\n \"regulated_status\": \"unregulated\",\n \"three_d_secure_usage\": {\n \"supported\": true\n },\n \"wallet\": null\n },\n \"created\": 1000000000,\n \"customer\": \"cus_NORMALIZED\",\n \"livemode\": false,\n \"metadata\": {},\n \"type\": \"card\"\n },\n \"type\": \"card_error\"\n },\n \"latest_charge\": \"ch_NORMALIZED\",\n \"livemode\": false,\n \"metadata\": {},\n \"next_action\": null,\n \"on_behalf_of\": null,\n \"payment_details\": {\n \"customer_reference\": null,\n \"order_reference\": \"in_1SVWkwDwzgQ85STgEeCcIY\"\n },\n \"payment_method\": null,\n \"payment_method_configuration_details\": null,\n \"payment_method_options\": {\n \"card\": {\n \"installments\": null,\n \"mandate_options\": null,\n \"network\": null,\n \"request_three_d_secure\": \"automatic\"\n },\n \"link\": {\n \"persistent_token\": null\n }\n },\n \"payment_method_types\": [\n \"card\",\n \"link\"\n ],\n \"processing\": null,\n \"receipt_email\": \"[email protected]\",\n \"review\": null,\n \"setup_future_usage\": null,\n \"shipping\": null,\n \"source\": null,\n \"statement_descriptor\": \"Zulip Cloud Standard\",\n \"statement_descriptor_suffix\": null,\n \"status\": \"requires_payment_method\",\n \"transfer_data\": null,\n \"transfer_group\": null\n },\n \"payment_method\": {\n \"id\": \"card_attached_to_customer_but_payment_fails--Customer.retrieve.1.json\",\n \"object\": \"payment_method\",\n \"allow_redisplay\": \"unspecified\",\n \"billing_details\": {\n \"address\": {\n \"city\": \"San Francisco\",\n \"country\": \"US\",\n \"line1\": \"123 Main St\",\n \"line2\": null,\n \"postal_code\": \"94105\",\n \"state\": \"CA\"\n },\n \"email\": null,\n \"name\": \"John Doe\",\n \"phone\": null,\n \"tax_id\": null\n },\n \"card\": {\n \"brand\": \"visa\",\n \"checks\": {\n \"address_line1_check\": \"pass\",\n \"address_postal_code_check\": \"pass\",\n \"cvc_check\": \"pass\"\n },\n \"country\": \"US\",\n \"display_brand\": \"visa\",\n \"exp_month\": 11,\n \"exp_year\": 2026,\n \"fingerprint\": \"mZkoRizHb5PdJf0T\",\n \"funding\": \"credit\",\n \"generated_from\": null,\n \"last4\": \"0341\",\n \"networks\": {\n \"available\": [\n \"visa\"\n ],\n \"preferred\": null\n },\n \"regulated_status\": \"unregulated\",\n \"three_d_secure_usage\": {\n \"supported\": true\n },\n \"wallet\": null\n },\n \"created\": 1000000000,\n \"customer\": \"cus_NORMALIZED\",\n \"livemode\": false,\n \"metadata\": {},\n \"type\": \"card\"\n },\n \"request_log_url\": \"https://dashboard.stripe.com/test/logs/req_NORMALIZED?t=1763640877\",\n \"type\": \"card_error\"\n }\n}\n","http_status": 402,"json_body": {"error": {diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.pay.2.json b/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.pay.2.jsonindex 2681b7c9568..563cd729bfe 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.pay.2.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.pay.2.json@@ -211,7 +211,7 @@"X-Stripe-Routing-Context-Priority-Tier": "api-testmode","X-Wc": "ABGHIJ"},- "http_body": "{\n \"error\": {\n \"advice_code\": \"try_again_later\",\n \"charge\": \"ch_NORMALIZED\",\n \"code\": \"card_declined\",\n \"decline_code\": \"generic_decline\",\n \"doc_url\": \"https://stripe.com/docs/error-codes/card-declined\",\n \"message\": \"Your card was declined.\",\n \"network_decline_code\": \"01\",\n \"payment_intent\": {\n \"id\": \"replace_payment_method--Invoice.pay.2.json\",\n \"object\": \"payment_intent\",\n \"amount\": 5000,\n \"amount_capturable\": 0,\n \"amount_details\": {\n \"tip\": {}\n },\n \"amount_received\": 0,\n \"application\": null,\n \"application_fee_amount\": null,\n \"automatic_payment_methods\": null,\n \"canceled_at\": null,\n \"cancellation_reason\": null,\n \"capture_method\": \"automatic\",\n \"client_secret\": \"replace_payment_method--Invoice.pay.2.json_secret_n39n12ZSNVGwO09bGYTwjIJ1S\",\n \"confirmation_method\": \"automatic\",\n \"created\": 1000000000,\n \"currency\": \"usd\",\n \"customer\": \"cus_NORMALIZED\",\n \"description\": \"Payment for Invoice\",\n \"excluded_payment_method_types\": null,\n \"last_payment_error\": {\n \"advice_code\": \"try_again_later\",\n \"charge\": \"ch_NORMALIZED\",\n \"code\": \"card_declined\",\n \"decline_code\": \"generic_decline\",\n \"doc_url\": \"https://stripe.com/docs/error-codes/card-declined\",\n \"message\": \"Your card was declined.\",\n \"network_decline_code\": \"01\",\n \"payment_method\": {\n \"id\": \"replace_payment_method--Customer.retrieve.7.json\",\n \"object\": \"payment_method\",\n \"allow_redisplay\": \"unspecified\",\n \"billing_details\": {\n \"address\": {\n \"city\": \"San Francisco\",\n \"country\": \"US\",\n \"line1\": \"123 Main St\",\n \"line2\": null,\n \"postal_code\": \"94105\",\n \"state\": \"CA\"\n },\n \"email\": null,\n \"name\": \"John Doe\",\n \"phone\": null,\n \"tax_id\": null\n },\n \"card\": {\n \"brand\": \"visa\",\n \"checks\": {\n \"address_line1_check\": \"pass\",\n \"address_postal_code_check\": \"pass\",\n \"cvc_check\": \"pass\"\n },\n \"country\": \"US\",\n \"display_brand\": \"visa\",\n \"exp_month\": 11,\n \"exp_year\": 2026,\n \"fingerprint\": \"mZkoRizHb5PdJf0T\",\n \"funding\": \"credit\",\n \"generated_from\": null,\n \"last4\": \"0341\",\n \"networks\": {\n \"available\": [\n \"visa\"\n ],\n \"preferred\": null\n },\n \"regulated_status\": \"unregulated\",\n \"three_d_secure_usage\": {\n \"supported\": true\n },\n \"wallet\": null\n },\n \"created\": 1000000000,\n \"customer\": \"cus_NORMALIZED\",\n \"livemode\": false,\n \"metadata\": {},\n \"type\": \"card\"\n },\n \"type\": \"card_error\"\n },\n \"latest_charge\": \"ch_NORMALIZED\",\n \"livemode\": false,\n \"metadata\": {},\n \"next_action\": null,\n \"on_behalf_of\": null,\n \"payment_details\": {\n \"customer_reference\": null,\n \"order_reference\": \"in_1SVWoDDwzgQ85STg31e2Dg\"\n },\n \"payment_method\": null,\n \"payment_method_configuration_details\": null,\n \"payment_method_options\": {\n \"card\": {\n \"installments\": null,\n \"mandate_options\": null,\n \"network\": null,\n \"request_three_d_secure\": \"automatic\"\n },\n \"link\": {\n \"persistent_token\": null\n }\n },\n \"payment_method_types\": [\n \"card\",\n \"link\"\n ],\n \"processing\": null,\n \"receipt_email\": \"[email protected]\",\n \"review\": null,\n \"setup_future_usage\": null,\n \"shipping\": null,\n \"source\": null,\n \"statement_descriptor\": null,\n \"statement_descriptor_suffix\": null,\n \"status\": \"requires_payment_method\",\n \"transfer_data\": null,\n \"transfer_group\": null\n },\n \"payment_method\": {\n \"id\": \"replace_payment_method--Customer.retrieve.7.json\",\n \"object\": \"payment_method\",\n \"allow_redisplay\": \"unspecified\",\n \"billing_details\": {\n \"address\": {\n \"city\": \"San Francisco\",\n \"country\": \"US\",\n \"line1\": \"123 Main St\",\n \"line2\": null,\n \"postal_code\": \"94105\",\n \"state\": \"CA\"\n },\n \"email\": null,\n \"name\": \"John Doe\",\n \"phone\": null,\n \"tax_id\": null\n },\n \"card\": {\n \"brand\": \"visa\",\n \"checks\": {\n \"address_line1_check\": \"pass\",\n \"address_postal_code_check\": \"pass\",\n \"cvc_check\": \"pass\"\n },\n \"country\": \"US\",\n \"display_brand\": \"visa\",\n \"exp_month\": 11,\n \"exp_year\": 2026,\n \"fingerprint\": \"mZkoRizHb5PdJf0T\",\n \"funding\": \"credit\",\n \"generated_from\": null,\n \"last4\": \"0341\",\n \"networks\": {\n \"available\": [\n \"visa\"\n ],\n \"preferred\": null\n },\n \"regulated_status\": \"unregulated\",\n \"three_d_secure_usage\": {\n \"supported\": true\n },\n \"wallet\": null\n },\n \"created\": 1000000000,\n \"customer\": \"cus_NORMALIZED\",\n \"livemode\": false,\n \"metadata\": {},\n \"type\": \"card\"\n },\n \"request_log_url\": \"https://dashboard.stripe.com/test/logs/req_NORMALIZED?t=1763641085\",\n \"type\": \"card_error\"\n }\n}\n",+ "http_body": "{\n \"error\": {\n \"advice_code\": \"try_again_later\",\n \"charge\": \"ch_NORMALIZED\",\n \"code\": \"card_declined\",\n \"decline_code\": \"generic_decline\",\n \"doc_url\": \"https://stripe.com/docs/error-codes/card-declined\",\n \"message\": \"Your card was declined.\",\n \"network_decline_code\": \"01\",\n \"payment_intent\": {\n \"id\": \"replace_payment_method--Invoice.pay.2.json\",\n \"object\": \"payment_intent\",\n \"amount\": 5000,\n \"amount_capturable\": 0,\n \"amount_details\": {\n \"tip\": {}\n },\n \"amount_received\": 0,\n \"application\": null,\n \"application_fee_amount\": null,\n \"automatic_payment_methods\": null,\n \"canceled_at\": null,\n \"cancellation_reason\": null,\n \"capture_method\": \"automatic\",\n \"client_secret\": \"NORMALIZED\",\n \"confirmation_method\": \"automatic\",\n \"created\": 1000000000,\n \"currency\": \"usd\",\n \"customer\": \"cus_NORMALIZED\",\n \"description\": \"Payment for Invoice\",\n \"excluded_payment_method_types\": null,\n \"last_payment_error\": {\n \"advice_code\": \"try_again_later\",\n \"charge\": \"ch_NORMALIZED\",\n \"code\": \"card_declined\",\n \"decline_code\": \"generic_decline\",\n \"doc_url\": \"https://stripe.com/docs/error-codes/card-declined\",\n \"message\": \"Your card was declined.\",\n \"network_decline_code\": \"01\",\n \"payment_method\": {\n \"id\": \"replace_payment_method--Customer.retrieve.7.json\",\n \"object\": \"payment_method\",\n \"allow_redisplay\": \"unspecified\",\n \"billing_details\": {\n \"address\": {\n \"city\": \"San Francisco\",\n \"country\": \"US\",\n \"line1\": \"123 Main St\",\n \"line2\": null,\n \"postal_code\": \"94105\",\n \"state\": \"CA\"\n },\n \"email\": null,\n \"name\": \"John Doe\",\n \"phone\": null,\n \"tax_id\": null\n },\n \"card\": {\n \"brand\": \"visa\",\n \"checks\": {\n \"address_line1_check\": \"pass\",\n \"address_postal_code_check\": \"pass\",\n \"cvc_check\": \"pass\"\n },\n \"country\": \"US\",\n \"display_brand\": \"visa\",\n \"exp_month\": 11,\n \"exp_year\": 2026,\n \"fingerprint\": \"mZkoRizHb5PdJf0T\",\n \"funding\": \"credit\",\n \"generated_from\": null,\n \"last4\": \"0341\",\n \"networks\": {\n \"available\": [\n \"visa\"\n ],\n \"preferred\": null\n },\n \"regulated_status\": \"unregulated\",\n \"three_d_secure_usage\": {\n \"supported\": true\n },\n \"wallet\": null\n },\n \"created\": 1000000000,\n \"customer\": \"cus_NORMALIZED\",\n \"livemode\": false,\n \"metadata\": {},\n \"type\": \"card\"\n },\n \"type\": \"card_error\"\n },\n \"latest_charge\": \"ch_NORMALIZED\",\n \"livemode\": false,\n \"metadata\": {},\n \"next_action\": null,\n \"on_behalf_of\": null,\n \"payment_details\": {\n \"customer_reference\": null,\n \"order_reference\": \"in_1SVWoDDwzgQ85STg31e2Dg\"\n },\n \"payment_method\": null,\n \"payment_method_configuration_details\": null,\n \"payment_method_options\": {\n \"card\": {\n \"installments\": null,\n \"mandate_options\": null,\n \"network\": null,\n \"request_three_d_secure\": \"automatic\"\n },\n \"link\": {\n \"persistent_token\": null\n }\n },\n \"payment_method_types\": [\n \"card\",\n \"link\"\n ],\n \"processing\": null,\n \"receipt_email\": \"[email protected]\",\n \"review\": null,\n \"setup_future_usage\": null,\n \"shipping\": null,\n \"source\": null,\n \"statement_descriptor\": null,\n \"statement_descriptor_suffix\": null,\n \"status\": \"requires_payment_method\",\n \"transfer_data\": null,\n \"transfer_group\": null\n },\n \"payment_method\": {\n \"id\": \"replace_payment_method--Customer.retrieve.7.json\",\n \"object\": \"payment_method\",\n \"allow_redisplay\": \"unspecified\",\n \"billing_details\": {\n \"address\": {\n \"city\": \"San Francisco\",\n \"country\": \"US\",\n \"line1\": \"123 Main St\",\n \"line2\": null,\n \"postal_code\": \"94105\",\n \"state\": \"CA\"\n },\n \"email\": null,\n \"name\": \"John Doe\",\n \"phone\": null,\n \"tax_id\": null\n },\n \"card\": {\n \"brand\": \"visa\",\n \"checks\": {\n \"address_line1_check\": \"pass\",\n \"address_postal_code_check\": \"pass\",\n \"cvc_check\": \"pass\"\n },\n \"country\": \"US\",\n \"display_brand\": \"visa\",\n \"exp_month\": 11,\n \"exp_year\": 2026,\n \"fingerprint\": \"mZkoRizHb5PdJf0T\",\n \"funding\": \"credit\",\n \"generated_from\": null,\n \"last4\": \"0341\",\n \"networks\": {\n \"available\": [\n \"visa\"\n ],\n \"preferred\": null\n },\n \"regulated_status\": \"unregulated\",\n \"three_d_secure_usage\": {\n \"supported\": true\n },\n \"wallet\": null\n },\n \"created\": 1000000000,\n \"customer\": \"cus_NORMALIZED\",\n \"livemode\": false,\n \"metadata\": {},\n \"type\": \"card\"\n },\n \"request_log_url\": \"https://dashboard.stripe.com/test/logs/req_NORMALIZED?t=1763641085\",\n \"type\": \"card_error\"\n }\n}\n","http_status": 402,"json_body": {"error": {diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.create.2.json b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.create.2.jsonindex a1b2f92ecdc..4ffbdba6168 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.create.2.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.create.2.json@@ -184,7 +184,7 @@"X-Stripe-Routing-Context-Priority-Tier": "api-testmode","X-Wc": "ABGHIJ"},- "http_body": "{\n \"error\": {\n \"advice_code\": \"try_again_later\",\n \"code\": \"card_declined\",\n \"decline_code\": \"generic_decline\",\n \"doc_url\": \"https://stripe.com/docs/error-codes/card-declined\",\n \"message\": \"Your card was declined.\",\n \"network_decline_code\": \"01\",\n \"payment_method\": {\n \"id\": \"replace_payment_method--PaymentMethod.create.2.json\",\n \"object\": \"payment_method\",\n \"allow_redisplay\": \"unspecified\",\n \"billing_details\": {\n \"address\": {\n \"city\": \"San Francisco\",\n \"country\": \"US\",\n \"line1\": \"123 Main St\",\n \"line2\": null,\n \"postal_code\": \"94105\",\n \"state\": \"CA\"\n },\n \"email\": null,\n \"name\": \"John Doe\",\n \"phone\": null,\n \"tax_id\": null\n },\n \"card\": {\n \"brand\": \"visa\",\n \"checks\": {\n \"address_line1_check\": \"pass\",\n \"address_postal_code_check\": \"pass\",\n \"cvc_check\": \"pass\"\n },\n \"country\": \"US\",\n \"display_brand\": \"visa\",\n \"exp_month\": 11,\n \"exp_year\": 2026,\n \"fingerprint\": \"24NjHKFFK74pI6pi\",\n \"funding\": \"credit\",\n \"generated_from\": null,\n \"last4\": \"0002\",\n \"networks\": {\n \"available\": [\n \"visa\"\n ],\n \"preferred\": null\n },\n \"regulated_status\": \"unregulated\",\n \"three_d_secure_usage\": {\n \"supported\": true\n },\n \"wallet\": null\n },\n \"created\": 1000000000,\n \"customer\": null,\n \"livemode\": false,\n \"metadata\": {},\n \"type\": \"card\"\n },\n \"request_log_url\": \"https://dashboard.stripe.com/test/logs/req_NORMALIZED?t=1763641081\",\n \"setup_intent\": {\n \"id\": \"replace_payment_method--SetupIntent.create.2.json\",\n \"object\": \"setup_intent\",\n \"application\": null,\n \"automatic_payment_methods\": null,\n \"cancellation_reason\": null,\n \"client_secret\": \"replace_payment_method--SetupIntent.create.2.json_secret_TSRhHSE6E6IoVXFQzv5uJoV0BK9ODFb\",\n \"created\": 1000000000,\n \"customer\": \"cus_NORMALIZED\",\n \"description\": null,\n \"excluded_payment_method_types\": null,\n \"flow_directions\": null,\n \"last_setup_error\": {\n \"advice_code\": \"try_again_later\",\n \"code\": \"card_declined\",\n \"decline_code\": \"generic_decline\",\n \"doc_url\": \"https://stripe.com/docs/error-codes/card-declined\",\n \"message\": \"Your card was declined.\",\n \"network_decline_code\": \"01\",\n \"payment_method\": {\n \"id\": \"replace_payment_method--PaymentMethod.create.2.json\",\n \"object\": \"payment_method\",\n \"allow_redisplay\": \"unspecified\",\n \"billing_details\": {\n \"address\": {\n \"city\": \"San Francisco\",\n \"country\": \"US\",\n \"line1\": \"123 Main St\",\n \"line2\": null,\n \"postal_code\": \"94105\",\n \"state\": \"CA\"\n },\n \"email\": null,\n \"name\": \"John Doe\",\n \"phone\": null,\n \"tax_id\": null\n },\n \"card\": {\n \"brand\": \"visa\",\n \"checks\": {\n \"address_line1_check\": \"pass\",\n \"address_postal_code_check\": \"pass\",\n \"cvc_check\": \"pass\"\n },\n \"country\": \"US\",\n \"display_brand\": \"visa\",\n \"exp_month\": 11,\n \"exp_year\": 2026,\n \"fingerprint\": \"24NjHKFFK74pI6pi\",\n \"funding\": \"credit\",\n \"generated_from\": null,\n \"last4\": \"0002\",\n \"networks\": {\n \"available\": [\n \"visa\"\n ],\n \"preferred\": null\n },\n \"regulated_status\": \"unregulated\",\n \"three_d_secure_usage\": {\n \"supported\": true\n },\n \"wallet\": null\n },\n \"created\": 1000000000,\n \"customer\": null,\n \"livemode\": false,\n \"metadata\": {},\n \"type\": \"card\"\n },\n \"type\": \"card_error\"\n },\n \"latest_attempt\": \"setatt_NORMALIZED\",\n \"livemode\": false,\n \"mandate\": null,\n \"metadata\": {},\n \"next_action\": null,\n \"on_behalf_of\": null,\n \"payment_method\": null,\n \"payment_method_configuration_details\": null,\n \"payment_method_options\": {\n \"card\": {\n \"mandate_options\": null,\n \"network\": null,\n \"request_three_d_secure\": \"automatic\"\n }\n },\n \"payment_method_types\": [\n \"card\"\n ],\n \"single_use_mandate\": null,\n \"status\": \"requires_payment_method\",\n \"usage\": \"off_session\"\n },\n \"type\": \"card_error\"\n }\n}\n",+ "http_body": "{\n \"error\": {\n \"advice_code\": \"try_again_later\",\n \"code\": \"card_declined\",\n \"decline_code\": \"generic_decline\",\n \"doc_url\": \"https://stripe.com/docs/error-codes/card-declined\",\n \"message\": \"Your card was declined.\",\n \"network_decline_code\": \"01\",\n \"payment_method\": {\n \"id\": \"replace_payment_method--PaymentMethod.create.2.json\",\n \"object\": \"payment_method\",\n \"allow_redisplay\": \"unspecified\",\n \"billing_details\": {\n \"address\": {\n \"city\": \"San Francisco\",\n \"country\": \"US\",\n \"line1\": \"123 Main St\",\n \"line2\": null,\n \"postal_code\": \"94105\",\n \"state\": \"CA\"\n },\n \"email\": null,\n \"name\": \"John Doe\",\n \"phone\": null,\n \"tax_id\": null\n },\n \"card\": {\n \"brand\": \"visa\",\n \"checks\": {\n \"address_line1_check\": \"pass\",\n \"address_postal_code_check\": \"pass\",\n \"cvc_check\": \"pass\"\n },\n \"country\": \"US\",\n \"display_brand\": \"visa\",\n \"exp_month\": 11,\n \"exp_year\": 2026,\n \"fingerprint\": \"24NjHKFFK74pI6pi\",\n \"funding\": \"credit\",\n \"generated_from\": null,\n \"last4\": \"0002\",\n \"networks\": {\n \"available\": [\n \"visa\"\n ],\n \"preferred\": null\n },\n \"regulated_status\": \"unregulated\",\n \"three_d_secure_usage\": {\n \"supported\": true\n },\n \"wallet\": null\n },\n \"created\": 1000000000,\n \"customer\": null,\n \"livemode\": false,\n \"metadata\": {},\n \"type\": \"card\"\n },\n \"request_log_url\": \"https://dashboard.stripe.com/test/logs/req_NORMALIZED?t=1763641081\",\n \"setup_intent\": {\n \"id\": \"replace_payment_method--SetupIntent.create.2.json\",\n \"object\": \"setup_intent\",\n \"application\": null,\n \"automatic_payment_methods\": null,\n \"cancellation_reason\": null,\n \"client_secret\": \"NORMALIZED\",\n \"created\": 1000000000,\n \"customer\": \"cus_NORMALIZED\",\n \"description\": null,\n \"excluded_payment_method_types\": null,\n \"flow_directions\": null,\n \"last_setup_error\": {\n \"advice_code\": \"try_again_later\",\n \"code\": \"card_declined\",\n \"decline_code\": \"generic_decline\",\n \"doc_url\": \"https://stripe.com/docs/error-codes/card-declined\",\n \"message\": \"Your card was declined.\",\n \"network_decline_code\": \"01\",\n \"payment_method\": {\n \"id\": \"replace_payment_method--PaymentMethod.create.2.json\",\n \"object\": \"payment_method\",\n \"allow_redisplay\": \"unspecified\",\n \"billing_details\": {\n \"address\": {\n \"city\": \"San Francisco\",\n \"country\": \"US\",\n \"line1\": \"123 Main St\",\n \"line2\": null,\n \"postal_code\": \"94105\",\n \"state\": \"CA\"\n },\n \"email\": null,\n \"name\": \"John Doe\",\n \"phone\": null,\n \"tax_id\": null\n },\n \"card\": {\n \"brand\": \"visa\",\n \"checks\": {\n \"address_line1_check\": \"pass\",\n \"address_postal_code_check\": \"pass\",\n \"cvc_check\": \"pass\"\n },\n \"country\": \"US\",\n \"display_brand\": \"visa\",\n \"exp_month\": 11,\n \"exp_year\": 2026,\n \"fingerprint\": \"24NjHKFFK74pI6pi\",\n \"funding\": \"credit\",\n \"generated_from\": null,\n \"last4\": \"0002\",\n \"networks\": {\n \"available\": [\n \"visa\"\n ],\n \"preferred\": null\n },\n \"regulated_status\": \"unregulated\",\n \"three_d_secure_usage\": {\n \"supported\": true\n },\n \"wallet\": null\n },\n \"created\": 1000000000,\n \"customer\": null,\n \"livemode\": false,\n \"metadata\": {},\n \"type\": \"card\"\n },\n \"type\": \"card_error\"\n },\n \"latest_attempt\": \"setatt_NORMALIZED\",\n \"livemode\": false,\n \"mandate\": null,\n \"metadata\": {},\n \"next_action\": null,\n \"on_behalf_of\": null,\n \"payment_method\": null,\n \"payment_method_configuration_details\": null,\n \"payment_method_options\": {\n \"card\": {\n \"mandate_options\": null,\n \"network\": null,\n \"request_three_d_secure\": \"automatic\"\n }\n },\n \"payment_method_types\": [\n \"card\"\n ],\n \"single_use_mandate\": null,\n \"status\": \"requires_payment_method\",\n \"usage\": \"off_session\"\n },\n \"type\": \"card_error\"\n }\n}\n","http_status": 402,"json_body": {"error": {