Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

test_stripe: Normalize fixtures for test_stripe_billing_portal_urls.

Aman Agrawal2a158cb8d980
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Customer.create.1.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Customer.create.1.json
index 593a07ed0c8..b3f430504b0 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Customer.create.1.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Customer.create.1.json
@@ -9,7 +9,7 @@
"description": "zulip (Zulip Dev)",
"discount": null,
"email": "[email protected]",
- "id": "cus_NORMALIZED0001",
+ "id": "NORMALIZED-1",
"invoice_prefix": "NORMA01",
"invoice_settings": {
"custom_fields": null,
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Customer.modify.1.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Customer.modify.1.json
index 1c287f67bce..2295409e1e8 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Customer.modify.1.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Customer.modify.1.json
@@ -9,11 +9,11 @@
"description": "zulip (Zulip Dev)",
"discount": null,
"email": "[email protected]",
- "id": "cus_NORMALIZED0001",
+ "id": "NORMALIZED-1",
"invoice_prefix": "NORMA01",
"invoice_settings": {
"custom_fields": null,
- "default_payment_method": "pm_1P41mkDEQaroqDjsL2RWARi2",
+ "default_payment_method": "pm_NORMALIZED00000000000001",
"footer": null,
"rendering_options": null
},
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Customer.retrieve.1.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Customer.retrieve.1.json
index c4b07439a21..ce311daf976 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Customer.retrieve.1.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Customer.retrieve.1.json
@@ -9,11 +9,12 @@
"description": "zulip (Zulip Dev)",
"discount": null,
"email": "[email protected]",
- "id": "cus_NORMALIZED0001",
+ "id": "NORMALIZED-1",
"invoice_prefix": "NORMA01",
"invoice_settings": {
"custom_fields": null,
"default_payment_method": {
+ "allow_redisplay": "unspecified",
"billing_details": {
"address": {
"city": "San Francisco",
@@ -30,13 +31,13 @@
"card": {
"brand": "visa",
"checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
+ "address_line1_check": "pass",
+ "address_postal_code_check": "pass",
"cvc_check": "pass"
},
"country": "US",
"display_brand": "visa",
- "exp_month": 4,
+ "exp_month": 7,
"exp_year": 2025,
"fingerprint": "NORMALIZED000001",
"funding": "credit",
@@ -54,8 +55,8 @@
"wallet": null
},
"created": 1000000000,
- "customer": "cus_NORMALIZED0001",
- "id": "pm_1P41mkDEQaroqDjsL2RWARi2",
+ "customer": "NORMALIZED-1",
+ "id": "NORMALIZED-2",
"livemode": false,
"metadata": {},
"object": "payment_method",
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Customer.retrieve.2.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Customer.retrieve.2.json
index c4b07439a21..ce311daf976 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Customer.retrieve.2.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Customer.retrieve.2.json
@@ -9,11 +9,12 @@
"description": "zulip (Zulip Dev)",
"discount": null,
"email": "[email protected]",
- "id": "cus_NORMALIZED0001",
+ "id": "NORMALIZED-1",
"invoice_prefix": "NORMA01",
"invoice_settings": {
"custom_fields": null,
"default_payment_method": {
+ "allow_redisplay": "unspecified",
"billing_details": {
"address": {
"city": "San Francisco",
@@ -30,13 +31,13 @@
"card": {
"brand": "visa",
"checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
+ "address_line1_check": "pass",
+ "address_postal_code_check": "pass",
"cvc_check": "pass"
},
"country": "US",
"display_brand": "visa",
- "exp_month": 4,
+ "exp_month": 7,
"exp_year": 2025,
"fingerprint": "NORMALIZED000001",
"funding": "credit",
@@ -54,8 +55,8 @@
"wallet": null
},
"created": 1000000000,
- "customer": "cus_NORMALIZED0001",
- "id": "pm_1P41mkDEQaroqDjsL2RWARi2",
+ "customer": "NORMALIZED-1",
+ "id": "NORMALIZED-2",
"livemode": false,
"metadata": {},
"object": "payment_method",
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Customer.retrieve.3.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Customer.retrieve.3.json
index c4b07439a21..ce311daf976 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Customer.retrieve.3.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Customer.retrieve.3.json
@@ -9,11 +9,12 @@
"description": "zulip (Zulip Dev)",
"discount": null,
"email": "[email protected]",
- "id": "cus_NORMALIZED0001",
+ "id": "NORMALIZED-1",
"invoice_prefix": "NORMA01",
"invoice_settings": {
"custom_fields": null,
"default_payment_method": {
+ "allow_redisplay": "unspecified",
"billing_details": {
"address": {
"city": "San Francisco",
@@ -30,13 +31,13 @@
"card": {
"brand": "visa",
"checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
+ "address_line1_check": "pass",
+ "address_postal_code_check": "pass",
"cvc_check": "pass"
},
"country": "US",
"display_brand": "visa",
- "exp_month": 4,
+ "exp_month": 7,
"exp_year": 2025,
"fingerprint": "NORMALIZED000001",
"funding": "credit",
@@ -54,8 +55,8 @@
"wallet": null
},
"created": 1000000000,
- "customer": "cus_NORMALIZED0001",
- "id": "pm_1P41mkDEQaroqDjsL2RWARi2",
+ "customer": "NORMALIZED-1",
+ "id": "NORMALIZED-2",
"livemode": false,
"metadata": {},
"object": "payment_method",
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Event.list.1.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Event.list.1.json
index d66f80ff37a..be8b18d43b9 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Event.list.1.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Event.list.1.json
@@ -5,26 +5,26 @@
"created": 1000000000,
"data": {
"object": {
- "configuration": "bpc_1P41mnDEQaroqDjsdPjrKGWc",
+ "configuration": "bpc_NORMALIZED00000000000001",
"created": 1000000000,
"customer": "cus_NORMALIZED0001",
"flow": null,
- "id": "bps_1P41mnDEQaroqDjsaGB86E0R",
+ "id": "NORMALIZED-3",
"livemode": false,
"locale": null,
"object": "billing_portal.session",
"on_behalf_of": null,
"return_url": "http://zulip.testserver/upgrade/?manual_license_management=false&tier=1&setup_payment_by_invoice=false",
- "url": "https://billing.stripe.com/p/session/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBSd05nMXduVm8xdVNXcmlWZUo5ZlhpMm8zNVUy0100DkhHAkYQ"
+ "url": "https://billing.stripe.com/p/session/test_NORMALIZED-1"
}
},
- "id": "evt_1P41mnDEQaroqDjsK2ydrI2V",
+ "id": "NORMALIZED-4",
"livemode": false,
"object": "event",
"pending_webhooks": 0,
"request": {
- "id": "req_NORMALIZED0001",
- "idempotency_key": "a2eee6d2-a03a-427f-8d07-dd15558c5874"
+ "id": "NORMALIZED-5",
+ "idempotency_key": "00000000-0000-0000-0000-000000000000"
},
"type": "billing_portal.session.created"
}
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Event.list.2.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Event.list.2.json
index 248a3526d5d..db4677aa5a9 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Event.list.2.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Event.list.2.json
@@ -1,5 +1,202 @@
{
"data": [
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 984000,
+ "amount_paid": 0,
+ "amount_remaining": 984000,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": false,
+ "auto_advance": false,
+ "automatic_tax": {
+ "enabled": false,
+ "liability": null,
+ "status": null
+ },
+ "automatically_finalizes_at": null,
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "send_invoice",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_fields": null,
+ "customer": "NORMALIZED-1",
+ "customer_address": null,
+ "customer_email": "[email protected]",
+ "customer_name": null,
+ "customer_phone": null,
+ "customer_shipping": null,
+ "customer_tax_exempt": "none",
+ "customer_tax_ids": [],
+ "default_payment_method": null,
+ "default_source": null,
+ "default_tax_rates": [],
+ "description": null,
+ "discount": null,
+ "discounts": [],
+ "due_date": 1000000000,
+ "effective_at": 1000000000,
+ "ending_balance": 0,
+ "footer": null,
+ "from_invoice": null,
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED/test_NORMALIZED-1?s=ap",
+ "id": "NORMALIZED-6",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED/test_NORMALIZED-1/pdf?s=ap",
+ "issuer": {
+ "type": "self"
+ },
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 984000,
+ "amount_excluding_tax": 984000,
+ "currency": "usd",
+ "description": "Zulip Cloud Standard",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "NORMALIZED-7",
+ "invoice": "NORMALIZED-6",
+ "invoice_item": "NORMALIZED-19",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1000000000,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "NORMALIZED-8",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0001",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": 8000,
+ "unit_amount_decimal": "8000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 123,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "8000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 1,
+ "url": "/v1/invoices/NORMALIZED-6/lines"
+ },
+ "livemode": false,
+ "metadata": {
+ "billing_schedule": "1",
+ "current_plan_id": "None",
+ "license_management": "manual",
+ "licenses": "123",
+ "on_free_trial": "False",
+ "plan_tier": "1",
+ "user_id": "10"
+ },
+ "next_payment_attempt": null,
+ "number": "NORMALI-0001",
+ "object": "invoice",
+ "on_behalf_of": null,
+ "paid": true,
+ "paid_out_of_band": true,
+ "payment_intent": null,
+ "payment_settings": {
+ "default_mandate": null,
+ "payment_method_options": null,
+ "payment_method_types": null
+ },
+ "period_end": 1000000000,
+ "period_start": 1000000000,
+ "post_payment_credit_notes_amount": 0,
+ "pre_payment_credit_notes_amount": 0,
+ "quote": null,
+ "receipt_number": null,
+ "rendering": {
+ "amount_tax_display": null,
+ "pdf": {
+ "page_size": "letter"
+ }
+ },
+ "rendering_options": null,
+ "shipping_cost": null,
+ "shipping_details": null,
+ "starting_balance": 0,
+ "statement_descriptor": "Zulip Cloud Standard",
+ "status": "paid",
+ "status_transitions": {
+ "finalized_at": 1000000000,
+ "marked_uncollectible_at": null,
+ "paid_at": 1000000000,
+ "voided_at": null
+ },
+ "subscription": null,
+ "subscription_details": {
+ "metadata": null
+ },
+ "subtotal": 984000,
+ "subtotal_excluding_tax": 984000,
+ "tax": null,
+ "test_clock": null,
+ "total": 984000,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 984000,
+ "total_tax_amounts": [],
+ "transfer_data": null,
+ "webhooks_delivered_at": 1000000000
+ },
+ "previous_attributes": {
+ "auto_advance": true,
+ "paid": false,
+ "paid_out_of_band": false,
+ "payment_intent": "NORMALIZED-11",
+ "status": "open",
+ "status_transitions": {
+ "paid_at": null
+ }
+ }
+ },
+ "id": "NORMALIZED-9",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": "NORMALIZED-10",
+ "idempotency_key": "00000000-0000-0000-0000-000000000000"
+ },
+ "type": "invoice.updated"
+ },
{
"api_version": "2020-08-27",
"created": 1000000000,
@@ -22,16 +219,16 @@
"has_more": false,
"object": "list",
"total_count": 0,
- "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000001"
+ "url": "/v1/charges?payment_intent=NORMALIZED-11"
},
- "client_secret": "pi_NORMALIZED00000000000001_secret_KemxJ2cJd1un7jWHxcNhNM2aZ",
+ "client_secret": "NORMALIZED-1",
"confirmation_method": "automatic",
"created": 1000000000,
"currency": "usd",
- "customer": "cus_NORMALIZED0001",
+ "customer": "NORMALIZED-1",
"description": "Payment for Invoice",
- "id": "pi_NORMALIZED00000000000001",
- "invoice": "in_NORMALIZED00000000000001",
+ "id": "NORMALIZED-11",
+ "invoice": "NORMALIZED-6",
"last_payment_error": null,
"latest_charge": null,
"livemode": false,
@@ -39,7 +236,7 @@
"next_action": null,
"object": "payment_intent",
"on_behalf_of": null,
- "payment_method": "pm_1P41mkDEQaroqDjsL2RWARi2",
+ "payment_method": "pm_NORMALIZED00000000000001",
"payment_method_configuration_details": null,
"payment_method_options": {
"card": {
@@ -73,125 +270,15 @@
"transfer_group": null
}
},
- "id": "evt_3P41mqDEQaroqDjs1cIMPVz8",
- "livemode": false,
- "object": "event",
- "pending_webhooks": 2,
- "request": {
- "id": "req_NORMALIZED0002",
- "idempotency_key": "b605567c-f884-4673-9296-a794aaaf2a6b"
- },
- "type": "payment_intent.canceled"
- },
- {
- "api_version": "2020-08-27",
- "created": 1000000000,
- "data": {
- "object": {
- "ach_credit_transfer": {
- "account_number": "test_NORMALIZED02",
- "bank_name": "TEST BANK",
- "fingerprint": "NORMALIZED000002",
- "refund_account_holder_name": null,
- "refund_account_holder_type": null,
- "refund_routing_number": null,
- "routing_number": "110000000",
- "swift_code": "TSTEZ122"
- },
- "amount": null,
- "client_secret": "src_client_secret_NORMALIZED00000000000001",
- "created": 1000000000,
- "currency": "usd",
- "customer": "cus_NORMALIZED0001",
- "flow": "receiver",
- "id": "src_NORMALIZED00000000000001",
- "livemode": false,
- "metadata": {},
- "object": "source",
- "owner": {
- "address": null,
- "email": "[email protected]",
- "name": null,
- "phone": null,
- "verified_address": null,
- "verified_email": null,
- "verified_name": null,
- "verified_phone": null
- },
- "receiver": {
- "address": "000000000-test_NORMALIZED01",
- "amount_charged": 0,
- "amount_received": 0,
- "amount_returned": 0,
- "refund_attributes_method": "email",
- "refund_attributes_status": "missing"
- },
- "statement_descriptor": null,
- "status": "pending",
- "type": "ach_credit_transfer",
- "usage": "reusable"
- }
- },
- "id": "evt_1P41mrDEQaroqDjskA1SgXPs",
+ "id": "NORMALIZED-12",
"livemode": false,
"object": "event",
"pending_webhooks": 0,
"request": {
- "id": null,
- "idempotency_key": "d4bacdcd-da45-427e-b382-560c8dcc78b0"
+ "id": "NORMALIZED-10",
+ "idempotency_key": "00000000-0000-0000-0000-000000000000"
},
- "type": "customer.source.created"
- },
- {
- "api_version": "2020-08-27",
- "created": 1000000000,
- "data": {
- "object": {
- "address": null,
- "balance": 0,
- "created": 1000000000,
- "currency": "usd",
- "default_currency": "usd",
- "default_source": "src_NORMALIZED00000000000001",
- "delinquent": false,
- "description": "zulip (Zulip Dev)",
- "discount": null,
- "email": "[email protected]",
- "id": "cus_NORMALIZED0001",
- "invoice_prefix": "NORMA01",
- "invoice_settings": {
- "custom_fields": null,
- "default_payment_method": "pm_1P41mkDEQaroqDjsL2RWARi2",
- "footer": null,
- "rendering_options": null
- },
- "livemode": false,
- "metadata": {
- "realm_id": "1",
- "realm_str": "zulip"
- },
- "name": null,
- "next_invoice_sequence": 2,
- "object": "customer",
- "phone": null,
- "preferred_locales": [],
- "shipping": null,
- "tax_exempt": "none",
- "test_clock": null
- },
- "previous_attributes": {
- "default_source": null
- }
- },
- "id": "evt_1P41mrDEQaroqDjsnP0NEKUg",
- "livemode": false,
- "object": "event",
- "pending_webhooks": 0,
- "request": {
- "id": null,
- "idempotency_key": "d4bacdcd-da45-427e-b382-560c8dcc78b0"
- },
- "type": "customer.updated"
+ "type": "payment_intent.canceled"
},
{
"api_version": "2020-08-27",
@@ -215,13 +302,14 @@
"liability": null,
"status": null
},
+ "automatically_finalizes_at": null,
"billing_reason": "manual",
"charge": null,
"collection_method": "send_invoice",
"created": 1000000000,
"currency": "usd",
"custom_fields": null,
- "customer": "cus_NORMALIZED0001",
+ "customer": "NORMALIZED-1",
"customer_address": null,
"customer_email": "[email protected]",
"customer_name": null,
@@ -240,9 +328,9 @@
"ending_balance": 0,
"footer": null,
"from_invoice": null,
- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBSZTJkTmdhMjZ3UWFHRk9NMjJQWlo5WURjRjgyLDEwMzI5ODc2NQ0200H5fOemy9?s=ap",
- "id": "in_NORMALIZED00000000000001",
- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBSZTJkTmdhMjZ3UWFHRk9NMjJQWlo5WURjRjgyLDEwMzI5ODc2NQ0200H5fOemy9/pdf?s=ap",
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED/test_NORMALIZED-2?s=ap",
+ "id": "NORMALIZED-6",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED/test_NORMALIZED-2/pdf?s=ap",
"issuer": {
"type": "self"
},
@@ -258,9 +346,9 @@
"discount_amounts": [],
"discountable": false,
"discounts": [],
- "id": "il_NORMALIZED00000000000001",
- "invoice": "in_NORMALIZED00000000000001",
- "invoice_item": "ii_NORMALIZED00000000000001",
+ "id": "NORMALIZED-7",
+ "invoice": "NORMALIZED-6",
+ "invoice_item": "NORMALIZED-19",
"livemode": false,
"metadata": {},
"object": "line_item",
@@ -275,7 +363,7 @@
"created": 1000000000,
"currency": "usd",
"custom_unit_amount": null,
- "id": "price_NORMALIZED00000000000001",
+ "id": "NORMALIZED-8",
"livemode": false,
"lookup_key": null,
"metadata": {},
@@ -305,11 +393,12 @@
"has_more": false,
"object": "list",
"total_count": 1,
- "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ "url": "/v1/invoices/NORMALIZED-6/lines"
},
"livemode": false,
"metadata": {
"billing_schedule": "1",
+ "current_plan_id": "None",
"license_management": "manual",
"licenses": "123",
"on_free_trial": "False",
@@ -322,7 +411,7 @@
"on_behalf_of": null,
"paid": false,
"paid_out_of_band": false,
- "payment_intent": "pi_NORMALIZED00000000000001",
+ "payment_intent": "NORMALIZED-11",
"payment_settings": {
"default_mandate": null,
"payment_method_options": null,
@@ -368,13 +457,13 @@
"webhooks_delivered_at": 1000000000
}
},
- "id": "evt_1P41mrDEQaroqDjsjlRHqLvO",
+ "id": "NORMALIZED-13",
"livemode": false,
"object": "event",
"pending_webhooks": 0,
"request": {
- "id": "req_NORMALIZED0003",
- "idempotency_key": "5c35fbe0-0b9a-44cb-ad52-20ef91658298"
+ "id": "NORMALIZED-14",
+ "idempotency_key": "00000000-0000-0000-0000-000000000000"
},
"type": "invoice.finalized"
},
@@ -400,13 +489,14 @@
"liability": null,
"status": null
},
+ "automatically_finalizes_at": null,
"billing_reason": "manual",
"charge": null,
"collection_method": "send_invoice",
"created": 1000000000,
"currency": "usd",
"custom_fields": null,
- "customer": "cus_NORMALIZED0001",
+ "customer": "NORMALIZED-1",
"customer_address": null,
"customer_email": "[email protected]",
"customer_name": null,
@@ -425,9 +515,9 @@
"ending_balance": 0,
"footer": null,
"from_invoice": null,
- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBSZTJkTmdhMjZ3UWFHRk9NMjJQWlo5WURjRjgyLDEwMzI5ODc2NQ0200H5fOemy9?s=ap",
- "id": "in_NORMALIZED00000000000001",
- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBSZTJkTmdhMjZ3UWFHRk9NMjJQWlo5WURjRjgyLDEwMzI5ODc2NQ0200H5fOemy9/pdf?s=ap",
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED/test_NORMALIZED-2?s=ap",
+ "id": "NORMALIZED-6",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED/test_NORMALIZED-2/pdf?s=ap",
"issuer": {
"type": "self"
},
@@ -443,9 +533,9 @@
"discount_amounts": [],
"discountable": false,
"discounts": [],
- "id": "il_NORMALIZED00000000000001",
- "invoice": "in_NORMALIZED00000000000001",
- "invoice_item": "ii_NORMALIZED00000000000001",
+ "id": "NORMALIZED-7",
+ "invoice": "NORMALIZED-6",
+ "invoice_item": "NORMALIZED-19",
"livemode": false,
"metadata": {},
"object": "line_item",
@@ -460,7 +550,7 @@
"created": 1000000000,
"currency": "usd",
"custom_unit_amount": null,
- "id": "price_NORMALIZED00000000000001",
+ "id": "NORMALIZED-8",
"livemode": false,
"lookup_key": null,
"metadata": {},
@@ -490,11 +580,12 @@
"has_more": false,
"object": "list",
"total_count": 1,
- "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ "url": "/v1/invoices/NORMALIZED-6/lines"
},
"livemode": false,
"metadata": {
"billing_schedule": "1",
+ "current_plan_id": "None",
"license_management": "manual",
"licenses": "123",
"on_free_trial": "False",
@@ -507,7 +598,7 @@
"on_behalf_of": null,
"paid": false,
"paid_out_of_band": false,
- "payment_intent": "pi_NORMALIZED00000000000001",
+ "payment_intent": "NORMALIZED-11",
"payment_settings": {
"default_mandate": null,
"payment_method_options": null,
@@ -553,6 +644,7 @@
"webhooks_delivered_at": 1000000000
},
"previous_attributes": {
+ "automatically_finalizes_at": 1000000000,
"effective_at": null,
"ending_balance": null,
"hosted_invoice_url": null,
@@ -570,13 +662,13 @@
}
}
},
- "id": "evt_1P41mrDEQaroqDjsmCQVfVVk",
+ "id": "NORMALIZED-15",
"livemode": false,
"object": "event",
"pending_webhooks": 0,
"request": {
- "id": "req_NORMALIZED0003",
- "idempotency_key": "5c35fbe0-0b9a-44cb-ad52-20ef91658298"
+ "id": "NORMALIZED-14",
+ "idempotency_key": "00000000-0000-0000-0000-000000000000"
},
"type": "invoice.updated"
},
@@ -602,16 +694,16 @@
"has_more": false,
"object": "list",
"total_count": 0,
- "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000001"
+ "url": "/v1/charges?payment_intent=NORMALIZED-11"
},
- "client_secret": "pi_NORMALIZED00000000000001_secret_KemxJ2cJd1un7jWHxcNhNM2aZ",
+ "client_secret": "NORMALIZED-1",
"confirmation_method": "automatic",
"created": 1000000000,
"currency": "usd",
- "customer": "cus_NORMALIZED0001",
+ "customer": "NORMALIZED-1",
"description": "Payment for Invoice",
- "id": "pi_NORMALIZED00000000000001",
- "invoice": "in_NORMALIZED00000000000001",
+ "id": "NORMALIZED-11",
+ "invoice": "NORMALIZED-6",
"last_payment_error": null,
"latest_charge": null,
"livemode": false,
@@ -653,13 +745,13 @@
"transfer_group": null
}
},
- "id": "evt_3P41mqDEQaroqDjs1uRTjqZm",
+ "id": "NORMALIZED-16",
"livemode": false,
"object": "event",
"pending_webhooks": 0,
"request": {
- "id": "req_NORMALIZED0003",
- "idempotency_key": "5c35fbe0-0b9a-44cb-ad52-20ef91658298"
+ "id": "NORMALIZED-14",
+ "idempotency_key": "00000000-0000-0000-0000-000000000000"
},
"type": "payment_intent.created"
},
@@ -685,13 +777,14 @@
"liability": null,
"status": null
},
+ "automatically_finalizes_at": 1000000000,
"billing_reason": "manual",
"charge": null,
"collection_method": "send_invoice",
"created": 1000000000,
"currency": "usd",
"custom_fields": null,
- "customer": "cus_NORMALIZED0001",
+ "customer": "NORMALIZED-1",
"customer_address": null,
"customer_email": "[email protected]",
"customer_name": null,
@@ -711,7 +804,7 @@
"footer": null,
"from_invoice": null,
"hosted_invoice_url": null,
- "id": "in_NORMALIZED00000000000001",
+ "id": "NORMALIZED-6",
"invoice_pdf": null,
"issuer": {
"type": "self"
@@ -728,9 +821,9 @@
"discount_amounts": [],
"discountable": false,
"discounts": [],
- "id": "il_NORMALIZED00000000000001",
- "invoice": "in_NORMALIZED00000000000001",
- "invoice_item": "ii_NORMALIZED00000000000001",
+ "id": "NORMALIZED-7",
+ "invoice": "NORMALIZED-6",
+ "invoice_item": "NORMALIZED-19",
"livemode": false,
"metadata": {},
"object": "line_item",
@@ -745,7 +838,7 @@
"created": 1000000000,
"currency": "usd",
"custom_unit_amount": null,
- "id": "price_NORMALIZED00000000000001",
+ "id": "NORMALIZED-8",
"livemode": false,
"lookup_key": null,
"metadata": {},
@@ -775,11 +868,12 @@
"has_more": false,
"object": "list",
"total_count": 1,
- "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ "url": "/v1/invoices/NORMALIZED-6/lines"
},
"livemode": false,
"metadata": {
"billing_schedule": "1",
+ "current_plan_id": "None",
"license_management": "manual",
"licenses": "123",
"on_free_trial": "False",
@@ -835,16 +929,16 @@
"total_excluding_tax": 984000,
"total_tax_amounts": [],
"transfer_data": null,
- "webhooks_delivered_at": null
+ "webhooks_delivered_at": 1000000000
}
},
- "id": "evt_1P41mqDEQaroqDjs5qnJo8An",
+ "id": "NORMALIZED-17",
"livemode": false,
"object": "event",
"pending_webhooks": 0,
"request": {
- "id": "req_NORMALIZED0004",
- "idempotency_key": "f3c5fc24-cca3-46cd-8dce-30da6ae565b5"
+ "id": "NORMALIZED-18",
+ "idempotency_key": "00000000-0000-0000-0000-000000000000"
},
"type": "invoice.created"
},
@@ -855,12 +949,12 @@
"object": {
"amount": 984000,
"currency": "usd",
- "customer": "cus_NORMALIZED0001",
+ "customer": "NORMALIZED-1",
"date": 1000000000,
"description": "Zulip Cloud Standard",
"discountable": false,
"discounts": [],
- "id": "ii_NORMALIZED00000000000001",
+ "id": "NORMALIZED-19",
"invoice": null,
"livemode": false,
"metadata": {},
@@ -876,7 +970,7 @@
"created": 1000000000,
"currency": "usd",
"custom_unit_amount": null,
- "id": "price_NORMALIZED00000000000001",
+ "id": "NORMALIZED-8",
"livemode": false,
"lookup_key": null,
"metadata": {},
@@ -900,13 +994,13 @@
"unit_amount_decimal": "8000"
}
},
- "id": "evt_1P41mpDEQaroqDjsQD0UVfsY",
+ "id": "NORMALIZED-20",
"livemode": false,
"object": "event",
"pending_webhooks": 0,
"request": {
- "id": "req_NORMALIZED0005",
- "idempotency_key": "c161c6d3-d451-4432-8fd9-585a80ff7859"
+ "id": "NORMALIZED-21",
+ "idempotency_key": "00000000-0000-0000-0000-000000000000"
},
"type": "invoiceitem.created"
},
@@ -925,11 +1019,11 @@
"description": "zulip (Zulip Dev)",
"discount": null,
"email": "[email protected]",
- "id": "cus_NORMALIZED0001",
+ "id": "NORMALIZED-1",
"invoice_prefix": "NORMA01",
"invoice_settings": {
"custom_fields": null,
- "default_payment_method": "pm_1P41mkDEQaroqDjsL2RWARi2",
+ "default_payment_method": "pm_NORMALIZED00000000000001",
"footer": null,
"rendering_options": null
},
@@ -952,13 +1046,13 @@
"default_currency": null
}
},
- "id": "evt_1P41mpDEQaroqDjs0FpYMf1o",
+ "id": "NORMALIZED-22",
"livemode": false,
"object": "event",
"pending_webhooks": 0,
"request": {
- "id": "req_NORMALIZED0005",
- "idempotency_key": "c161c6d3-d451-4432-8fd9-585a80ff7859"
+ "id": "NORMALIZED-21",
+ "idempotency_key": "00000000-0000-0000-0000-000000000000"
},
"type": "customer.updated"
}
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Event.list.3.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Event.list.3.json
index 3e7b2b958f7..7d1a0096144 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Event.list.3.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Event.list.3.json
@@ -5,185 +5,110 @@
"created": 1000000000,
"data": {
"object": {
- "account_country": "US",
- "account_name": "Kandra Labs, Inc.",
- "account_tax_ids": null,
- "amount_due": 984000,
- "amount_paid": 0,
- "amount_remaining": 984000,
- "amount_shipping": 0,
- "application": null,
- "application_fee_amount": null,
- "attempt_count": 0,
- "attempted": false,
- "auto_advance": false,
- "automatic_tax": {
- "enabled": false,
- "liability": null,
- "status": null
+ "ach_credit_transfer": {
+ "account_number": "test_NORMALIZED02",
+ "bank_name": "TEST BANK",
+ "fingerprint": "NORMALIZED000002",
+ "refund_account_holder_name": null,
+ "refund_account_holder_type": null,
+ "refund_routing_number": null,
+ "routing_number": "110000000",
+ "swift_code": "TSTEZ122"
},
- "billing_reason": "manual",
- "charge": null,
- "collection_method": "send_invoice",
+ "amount": null,
+ "client_secret": "NORMALIZED-2",
"created": 1000000000,
"currency": "usd",
- "custom_fields": null,
- "customer": "cus_NORMALIZED0001",
- "customer_address": null,
- "customer_email": "[email protected]",
- "customer_name": null,
- "customer_phone": null,
- "customer_shipping": null,
- "customer_tax_exempt": "none",
- "customer_tax_ids": [],
- "default_payment_method": null,
- "default_source": null,
- "default_tax_rates": [],
- "description": null,
- "discount": null,
- "discounts": [],
- "due_date": 1000000000,
- "effective_at": 1000000000,
- "ending_balance": 0,
- "footer": null,
- "from_invoice": null,
- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBSZTJkTmdhMjZ3UWFHRk9NMjJQWlo5WURjRjgyLDEwMzI5ODc2Ng0200lJneoYDa?s=ap",
- "id": "in_NORMALIZED00000000000001",
- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBSZTJkTmdhMjZ3UWFHRk9NMjJQWlo5WURjRjgyLDEwMzI5ODc2Ng0200lJneoYDa/pdf?s=ap",
- "issuer": {
- "type": "self"
- },
- "last_finalization_error": null,
- "latest_revision": null,
- "lines": {
- "data": [
- {
- "amount": 984000,
- "amount_excluding_tax": 984000,
- "currency": "usd",
- "description": "Zulip Cloud Standard",
- "discount_amounts": [],
- "discountable": false,
- "discounts": [],
- "id": "il_NORMALIZED00000000000001",
- "invoice": "in_NORMALIZED00000000000001",
- "invoice_item": "ii_NORMALIZED00000000000001",
- "livemode": false,
- "metadata": {},
- "object": "line_item",
- "period": {
- "end": 1000000000,
- "start": 1000000000
- },
- "plan": null,
- "price": {
- "active": false,
- "billing_scheme": "per_unit",
- "created": 1000000000,
- "currency": "usd",
- "custom_unit_amount": null,
- "id": "price_NORMALIZED00000000000001",
- "livemode": false,
- "lookup_key": null,
- "metadata": {},
- "nickname": null,
- "object": "price",
- "product": "prod_NORMALIZED0001",
- "recurring": null,
- "tax_behavior": "unspecified",
- "tiers_mode": null,
- "transform_quantity": null,
- "type": "one_time",
- "unit_amount": 8000,
- "unit_amount_decimal": "8000"
- },
- "proration": false,
- "proration_details": {
- "credited_items": null
- },
- "quantity": 123,
- "subscription": null,
- "tax_amounts": [],
- "tax_rates": [],
- "type": "invoiceitem",
- "unit_amount_excluding_tax": "8000"
- }
- ],
- "has_more": false,
- "object": "list",
- "total_count": 1,
- "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
- },
+ "customer": "NORMALIZED-1",
+ "flow": "receiver",
+ "id": "NORMALIZED-23",
"livemode": false,
- "metadata": {
- "billing_schedule": "1",
- "license_management": "manual",
- "licenses": "123",
- "on_free_trial": "False",
- "plan_tier": "1",
- "user_id": "10"
- },
- "next_payment_attempt": null,
- "number": "NORMALI-0002",
- "object": "invoice",
- "on_behalf_of": null,
- "paid": true,
- "paid_out_of_band": true,
- "payment_intent": null,
- "payment_settings": {
- "default_mandate": null,
- "payment_method_options": null,
- "payment_method_types": null
+ "metadata": {},
+ "object": "source",
+ "owner": {
+ "address": null,
+ "email": "[email protected]",
+ "name": null,
+ "phone": null,
+ "verified_address": null,
+ "verified_email": null,
+ "verified_name": null,
+ "verified_phone": null
},
- "period_end": 1000000000,
- "period_start": 1000000000,
- "post_payment_credit_notes_amount": 0,
- "pre_payment_credit_notes_amount": 0,
- "quote": null,
- "receipt_number": null,
- "rendering": {
- "amount_tax_display": null,
- "pdf": {
- "page_size": "letter"
- }
+ "receiver": {
+ "address": "000000000-test_NORMALIZED02",
+ "amount_charged": 0,
+ "amount_received": 0,
+ "amount_returned": 0,
+ "refund_attributes_method": "email",
+ "refund_attributes_status": "missing"
},
- "rendering_options": null,
- "shipping_cost": null,
- "shipping_details": null,
- "starting_balance": 0,
- "statement_descriptor": "Zulip Cloud Standard",
- "status": "paid",
- "status_transitions": {
- "finalized_at": 1000000000,
- "marked_uncollectible_at": null,
- "paid_at": 1000000000,
- "voided_at": null
+ "statement_descriptor": null,
+ "status": "pending",
+ "type": "ach_credit_transfer",
+ "usage": "reusable"
+ }
+ },
+ "id": "NORMALIZED-24",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 0,
+ "request": {
+ "id": null,
+ "idempotency_key": "00000000-0000-0000-0000-000000000000"
+ },
+ "type": "customer.source.created"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1000000000,
+ "data": {
+ "object": {
+ "address": null,
+ "balance": 0,
+ "created": 1000000000,
+ "currency": "usd",
+ "default_currency": "usd",
+ "default_source": "NORMALIZED-23",
+ "delinquent": false,
+ "description": "zulip (Zulip Dev)",
+ "discount": null,
+ "email": "[email protected]",
+ "id": "NORMALIZED-1",
+ "invoice_prefix": "NORMA01",
+ "invoice_settings": {
+ "custom_fields": null,
+ "default_payment_method": "pm_NORMALIZED00000000000001",
+ "footer": null,
+ "rendering_options": null
},
- "subscription": null,
- "subscription_details": {
- "metadata": null
+ "livemode": false,
+ "metadata": {
+ "realm_id": "1",
+ "realm_str": "zulip"
},
- "subtotal": 984000,
- "subtotal_excluding_tax": 984000,
- "tax": null,
- "test_clock": null,
- "total": 984000,
- "total_discount_amounts": [],
- "total_excluding_tax": 984000,
- "total_tax_amounts": [],
- "transfer_data": null,
- "webhooks_delivered_at": 1000000000
+ "name": null,
+ "next_invoice_sequence": 2,
+ "object": "customer",
+ "phone": null,
+ "preferred_locales": [],
+ "shipping": null,
+ "tax_exempt": "none",
+ "test_clock": null
+ },
+ "previous_attributes": {
+ "default_source": null
}
},
- "id": "evt_1P41msDEQaroqDjsT3bcMQP3",
+ "id": "NORMALIZED-25",
"livemode": false,
"object": "event",
- "pending_webhooks": 1,
+ "pending_webhooks": 0,
"request": {
- "id": "req_NORMALIZED0002",
- "idempotency_key": "b605567c-f884-4673-9296-a794aaaf2a6b"
+ "id": null,
+ "idempotency_key": "00000000-0000-0000-0000-000000000000"
},
- "type": "invoice.paid"
+ "type": "customer.updated"
},
{
"api_version": "2020-08-27",
@@ -207,13 +132,14 @@
"liability": null,
"status": null
},
+ "automatically_finalizes_at": null,
"billing_reason": "manual",
"charge": null,
"collection_method": "send_invoice",
"created": 1000000000,
"currency": "usd",
"custom_fields": null,
- "customer": "cus_NORMALIZED0001",
+ "customer": "NORMALIZED-1",
"customer_address": null,
"customer_email": "[email protected]",
"customer_name": null,
@@ -232,9 +158,9 @@
"ending_balance": 0,
"footer": null,
"from_invoice": null,
- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBSZTJkTmdhMjZ3UWFHRk9NMjJQWlo5WURjRjgyLDEwMzI5ODc2Ng0200lJneoYDa?s=ap",
- "id": "in_NORMALIZED00000000000001",
- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBSZTJkTmdhMjZ3UWFHRk9NMjJQWlo5WURjRjgyLDEwMzI5ODc2Ng0200lJneoYDa/pdf?s=ap",
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED/test_NORMALIZED-1?s=ap",
+ "id": "NORMALIZED-6",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED/test_NORMALIZED-1/pdf?s=ap",
"issuer": {
"type": "self"
},
@@ -250,8 +176,8 @@
"discount_amounts": [],
"discountable": false,
"discounts": [],
- "id": "il_NORMALIZED00000000000001",
- "invoice": "in_NORMALIZED00000000000001",
+ "id": "NORMALIZED-7",
+ "invoice": "NORMALIZED-6",
"invoice_item": "ii_NORMALIZED00000000000001",
"livemode": false,
"metadata": {},
@@ -267,7 +193,7 @@
"created": 1000000000,
"currency": "usd",
"custom_unit_amount": null,
- "id": "price_NORMALIZED00000000000001",
+ "id": "NORMALIZED-8",
"livemode": false,
"lookup_key": null,
"metadata": {},
@@ -297,11 +223,12 @@
"has_more": false,
"object": "list",
"total_count": 1,
- "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ "url": "/v1/invoices/NORMALIZED-6/lines"
},
"livemode": false,
"metadata": {
"billing_schedule": "1",
+ "current_plan_id": "None",
"license_management": "manual",
"licenses": "123",
"on_free_trial": "False",
@@ -309,7 +236,7 @@
"user_id": "10"
},
"next_payment_attempt": null,
- "number": "NORMALI-0002",
+ "number": "NORMALI-0001",
"object": "invoice",
"on_behalf_of": null,
"paid": true,
@@ -358,27 +285,17 @@
"total_tax_amounts": [],
"transfer_data": null,
"webhooks_delivered_at": 1000000000
- },
- "previous_attributes": {
- "auto_advance": true,
- "paid": false,
- "paid_out_of_band": false,
- "payment_intent": "pi_NORMALIZED00000000000001",
- "status": "open",
- "status_transitions": {
- "paid_at": null
- }
}
},
- "id": "evt_1P41msDEQaroqDjs3t56gnby",
+ "id": "NORMALIZED-26",
"livemode": false,
"object": "event",
"pending_webhooks": 0,
"request": {
- "id": "req_NORMALIZED0002",
- "idempotency_key": "b605567c-f884-4673-9296-a794aaaf2a6b"
+ "id": "NORMALIZED-10",
+ "idempotency_key": "00000000-0000-0000-0000-000000000000"
},
- "type": "invoice.updated"
+ "type": "invoice.paid"
}
],
"has_more": false,
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Invoice.create.1.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Invoice.create.1.json
index 926c86112d3..0d63481e7ed 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Invoice.create.1.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Invoice.create.1.json
@@ -16,6 +16,7 @@
"liability": null,
"status": null
},
+ "automatically_finalizes_at": 1000000000,
"billing_reason": "manual",
"charge": null,
"collection_method": "send_invoice",
@@ -42,7 +43,7 @@
"footer": null,
"from_invoice": null,
"hosted_invoice_url": null,
- "id": "in_NORMALIZED00000000000001",
+ "id": "NORMALIZED-6",
"invoice_pdf": null,
"issuer": {
"type": "self"
@@ -59,8 +60,8 @@
"discount_amounts": [],
"discountable": false,
"discounts": [],
- "id": "il_NORMALIZED00000000000001",
- "invoice": "in_NORMALIZED00000000000001",
+ "id": "NORMALIZED-7",
+ "invoice": "NORMALIZED-6",
"invoice_item": "ii_NORMALIZED00000000000001",
"livemode": false,
"metadata": {},
@@ -76,7 +77,7 @@
"created": 1000000000,
"currency": "usd",
"custom_unit_amount": null,
- "id": "price_NORMALIZED00000000000001",
+ "id": "NORMALIZED-8",
"livemode": false,
"lookup_key": null,
"metadata": {},
@@ -106,11 +107,12 @@
"has_more": false,
"object": "list",
"total_count": 1,
- "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ "url": "/v1/invoices/NORMALIZED-6/lines"
},
"livemode": false,
"metadata": {
"billing_schedule": "1",
+ "current_plan_id": "None",
"license_management": "manual",
"licenses": "123",
"on_free_trial": "False",
@@ -166,5 +168,5 @@
"total_excluding_tax": 984000,
"total_tax_amounts": [],
"transfer_data": null,
- "webhooks_delivered_at": null
+ "webhooks_delivered_at": 1000000000
}
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Invoice.finalize_invoice.1.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Invoice.finalize_invoice.1.json
index 71679eec17e..1b2e28f1a1d 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Invoice.finalize_invoice.1.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Invoice.finalize_invoice.1.json
@@ -16,6 +16,7 @@
"liability": null,
"status": null
},
+ "automatically_finalizes_at": null,
"billing_reason": "manual",
"charge": null,
"collection_method": "send_invoice",
@@ -41,9 +42,9 @@
"ending_balance": 0,
"footer": null,
"from_invoice": null,
- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBSZTJkTmdhMjZ3UWFHRk9NMjJQWlo5WURjRjgyLDEwMzI5ODc2NQ0200H5fOemy9?s=ap",
- "id": "in_NORMALIZED00000000000001",
- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBSZTJkTmdhMjZ3UWFHRk9NMjJQWlo5WURjRjgyLDEwMzI5ODc2NQ0200H5fOemy9/pdf?s=ap",
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED/test_NORMALIZED-2?s=ap",
+ "id": "NORMALIZED-6",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED/test_NORMALIZED-2/pdf?s=ap",
"issuer": {
"type": "self"
},
@@ -59,8 +60,8 @@
"discount_amounts": [],
"discountable": false,
"discounts": [],
- "id": "il_NORMALIZED00000000000001",
- "invoice": "in_NORMALIZED00000000000001",
+ "id": "NORMALIZED-7",
+ "invoice": "NORMALIZED-6",
"invoice_item": "ii_NORMALIZED00000000000001",
"livemode": false,
"metadata": {},
@@ -76,7 +77,7 @@
"created": 1000000000,
"currency": "usd",
"custom_unit_amount": null,
- "id": "price_NORMALIZED00000000000001",
+ "id": "NORMALIZED-8",
"livemode": false,
"lookup_key": null,
"metadata": {},
@@ -106,11 +107,12 @@
"has_more": false,
"object": "list",
"total_count": 1,
- "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ "url": "/v1/invoices/NORMALIZED-6/lines"
},
"livemode": false,
"metadata": {
"billing_schedule": "1",
+ "current_plan_id": "None",
"license_management": "manual",
"licenses": "123",
"on_free_trial": "False",
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Invoice.pay.1.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Invoice.pay.1.json
index b4cf70fa65a..9da819dca4c 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Invoice.pay.1.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--Invoice.pay.1.json
@@ -16,6 +16,7 @@
"liability": null,
"status": null
},
+ "automatically_finalizes_at": null,
"billing_reason": "manual",
"charge": null,
"collection_method": "send_invoice",
@@ -41,9 +42,9 @@
"ending_balance": 0,
"footer": null,
"from_invoice": null,
- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBSZTJkTmdhMjZ3UWFHRk9NMjJQWlo5WURjRjgyLDEwMzI5ODc2Ng0200lJneoYDa?s=ap",
- "id": "in_NORMALIZED00000000000001",
- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBSZTJkTmdhMjZ3UWFHRk9NMjJQWlo5WURjRjgyLDEwMzI5ODc2Ng0200lJneoYDa/pdf?s=ap",
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED/test_NORMALIZED-1?s=ap",
+ "id": "NORMALIZED-6",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED/test_NORMALIZED-1/pdf?s=ap",
"issuer": {
"type": "self"
},
@@ -59,8 +60,8 @@
"discount_amounts": [],
"discountable": false,
"discounts": [],
- "id": "il_NORMALIZED00000000000001",
- "invoice": "in_NORMALIZED00000000000001",
+ "id": "NORMALIZED-7",
+ "invoice": "NORMALIZED-6",
"invoice_item": "ii_NORMALIZED00000000000001",
"livemode": false,
"metadata": {},
@@ -76,7 +77,7 @@
"created": 1000000000,
"currency": "usd",
"custom_unit_amount": null,
- "id": "price_NORMALIZED00000000000001",
+ "id": "NORMALIZED-8",
"livemode": false,
"lookup_key": null,
"metadata": {},
@@ -106,11 +107,12 @@
"has_more": false,
"object": "list",
"total_count": 1,
- "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ "url": "/v1/invoices/NORMALIZED-6/lines"
},
"livemode": false,
"metadata": {
"billing_schedule": "1",
+ "current_plan_id": "None",
"license_management": "manual",
"licenses": "123",
"on_free_trial": "False",
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--InvoiceItem.create.1.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--InvoiceItem.create.1.json
index 40cfc90defd..705cf6a30df 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--InvoiceItem.create.1.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--InvoiceItem.create.1.json
@@ -6,7 +6,7 @@
"description": "Zulip Cloud Standard",
"discountable": false,
"discounts": [],
- "id": "ii_NORMALIZED00000000000001",
+ "id": "NORMALIZED-19",
"invoice": null,
"livemode": false,
"metadata": {},
@@ -22,7 +22,7 @@
"created": 1000000000,
"currency": "usd",
"custom_unit_amount": null,
- "id": "price_NORMALIZED00000000000001",
+ "id": "NORMALIZED-8",
"livemode": false,
"lookup_key": null,
"metadata": {},
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--PaymentMethod.create.1.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--PaymentMethod.create.1.json
index dc294b3f7c1..a424d0a4418 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--PaymentMethod.create.1.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--PaymentMethod.create.1.json
@@ -1,4 +1,5 @@
{
+ "allow_redisplay": "unspecified",
"billing_details": {
"address": {
"city": "San Francisco",
@@ -15,13 +16,13 @@
"card": {
"brand": "visa",
"checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
+ "address_line1_check": "unchecked",
+ "address_postal_code_check": "unchecked",
"cvc_check": "unchecked"
},
"country": "US",
"display_brand": "visa",
- "exp_month": 4,
+ "exp_month": 7,
"exp_year": 2025,
"fingerprint": "NORMALIZED000001",
"funding": "credit",
@@ -40,7 +41,7 @@
},
"created": 1000000000,
"customer": null,
- "id": "pm_1P41mkDEQaroqDjsL2RWARi2",
+ "id": "NORMALIZED-2",
"livemode": false,
"metadata": {},
"object": "payment_method",
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--SetupIntent.create.1.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--SetupIntent.create.1.json
index e6595f832aa..3cd5161d235 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--SetupIntent.create.1.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--SetupIntent.create.1.json
@@ -2,21 +2,21 @@
"application": null,
"automatic_payment_methods": null,
"cancellation_reason": null,
- "client_secret": "seti_1P41mkDEQaroqDjsk1njMRZS_secret_PtpRiSETHY7OxVwujKtyOqp1d5SzgVR",
+ "client_secret": "NORMALIZED-3",
"created": 1000000000,
"customer": "cus_NORMALIZED0001",
"description": null,
"flow_directions": null,
- "id": "seti_1P41mkDEQaroqDjsk1njMRZS",
+ "id": "NORMALIZED-27",
"last_setup_error": null,
- "latest_attempt": "setatt_1P41mlDEQaroqDjsbiNNNtBT",
+ "latest_attempt": "setatt_NORMALIZED00000000000001",
"livemode": false,
"mandate": null,
"metadata": {},
"next_action": null,
"object": "setup_intent",
"on_behalf_of": null,
- "payment_method": "pm_1P41mkDEQaroqDjsL2RWARi2",
+ "payment_method": "pm_NORMALIZED00000000000001",
"payment_method_configuration_details": null,
"payment_method_options": {
"card": {
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--SetupIntent.list.1.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--SetupIntent.list.1.json
index 9bf3aa7c7f3..9e6099597dd 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--SetupIntent.list.1.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--SetupIntent.list.1.json
@@ -4,12 +4,12 @@
"application": null,
"automatic_payment_methods": null,
"cancellation_reason": null,
- "client_secret": "seti_1P41mjDEQaroqDjsHYDXVzvS_secret_PtpRW8ACL528KqATVW78XSAsI7O6VOX",
+ "client_secret": "NORMALIZED-4",
"created": 1000000000,
"customer": "cus_NORMALIZED0001",
"description": null,
"flow_directions": null,
- "id": "seti_1P41mjDEQaroqDjsHYDXVzvS",
+ "id": "NORMALIZED-28",
"last_setup_error": null,
"latest_attempt": null,
"livemode": false,
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--SetupIntent.retrieve.1.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--SetupIntent.retrieve.1.json
index e6595f832aa..3cd5161d235 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--SetupIntent.retrieve.1.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--SetupIntent.retrieve.1.json
@@ -2,21 +2,21 @@
"application": null,
"automatic_payment_methods": null,
"cancellation_reason": null,
- "client_secret": "seti_1P41mkDEQaroqDjsk1njMRZS_secret_PtpRiSETHY7OxVwujKtyOqp1d5SzgVR",
+ "client_secret": "NORMALIZED-3",
"created": 1000000000,
"customer": "cus_NORMALIZED0001",
"description": null,
"flow_directions": null,
- "id": "seti_1P41mkDEQaroqDjsk1njMRZS",
+ "id": "NORMALIZED-27",
"last_setup_error": null,
- "latest_attempt": "setatt_1P41mlDEQaroqDjsbiNNNtBT",
+ "latest_attempt": "setatt_NORMALIZED00000000000001",
"livemode": false,
"mandate": null,
"metadata": {},
"next_action": null,
"object": "setup_intent",
"on_behalf_of": null,
- "payment_method": "pm_1P41mkDEQaroqDjsL2RWARi2",
+ "payment_method": "pm_NORMALIZED00000000000001",
"payment_method_configuration_details": null,
"payment_method_options": {
"card": {
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Configuration.create.1.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Configuration.create.1.json
index 7053c0a3aa1..9fdd616cfe7 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Configuration.create.1.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Configuration.create.1.json
@@ -46,7 +46,7 @@
"proration_behavior": "none"
}
},
- "id": "bpc_1P41mnDEQaroqDjsdPjrKGWc",
+ "id": "NORMALIZED-29",
"is_default": false,
"livemode": false,
"login_page": {
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Configuration.create.2.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Configuration.create.2.json
index a64a32c9f0c..5b063102628 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Configuration.create.2.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Configuration.create.2.json
@@ -46,7 +46,7 @@
"proration_behavior": "none"
}
},
- "id": "bpc_1P41mtDEQaroqDjs9PNBHr5y",
+ "id": "NORMALIZED-30",
"is_default": false,
"livemode": false,
"login_page": {
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Configuration.create.3.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Configuration.create.3.json
index 2d72ab1df3a..3942b707c9b 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Configuration.create.3.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Configuration.create.3.json
@@ -43,7 +43,7 @@
"proration_behavior": "none"
}
},
- "id": "bpc_1P41muDEQaroqDjsRsOEKX0q",
+ "id": "NORMALIZED-31",
"is_default": false,
"livemode": false,
"login_page": {
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Session.create.1.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Session.create.1.json
index ae5734db0c6..9638c33efac 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Session.create.1.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Session.create.1.json
@@ -1,13 +1,13 @@
{
- "configuration": "bpc_1P41mnDEQaroqDjsdPjrKGWc",
+ "configuration": "bpc_NORMALIZED00000000000001",
"created": 1000000000,
"customer": "cus_NORMALIZED0001",
"flow": null,
- "id": "bps_1P41mnDEQaroqDjsaGB86E0R",
+ "id": "NORMALIZED-3",
"livemode": false,
"locale": null,
"object": "billing_portal.session",
"on_behalf_of": null,
"return_url": "http://zulip.testserver/upgrade/?manual_license_management=false&tier=1&setup_payment_by_invoice=false",
- "url": "https://billing.stripe.com/p/session/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBSd05nMXduVm8xdVNXcmlWZUo5ZlhpMm8zNVUy0100DkhHAkYQ"
+ "url": "https://billing.stripe.com/p/session/test_NORMALIZED-1"
}
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Session.create.2.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Session.create.2.json
index 913bf391090..552907d0a51 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Session.create.2.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Session.create.2.json
@@ -1,13 +1,13 @@
{
- "configuration": "bpc_1P41mtDEQaroqDjs9PNBHr5y",
+ "configuration": "bpc_NORMALIZED00000000000002",
"created": 1000000000,
"customer": "cus_NORMALIZED0001",
"flow": null,
- "id": "bps_1P41muDEQaroqDjskoHLa8G3",
+ "id": "NORMALIZED-32",
"livemode": false,
"locale": null,
"object": "billing_portal.session",
"on_behalf_of": null,
"return_url": "http://zulip.testserver/billing/",
- "url": "https://billing.stripe.com/p/session/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBSSVlMMTlZb3hPcFhESUR2UkVWODFmNGpRMVp00100UCCaoMuT"
+ "url": "https://billing.stripe.com/p/session/test_NORMALIZED-2"
}
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Session.create.3.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Session.create.3.json
index ab7961733da..79461597880 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Session.create.3.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--billing_portal.Session.create.3.json
@@ -1,13 +1,13 @@
{
- "configuration": "bpc_1P41muDEQaroqDjsRsOEKX0q",
+ "configuration": "bpc_NORMALIZED00000000000003",
"created": 1000000000,
"customer": "cus_NORMALIZED0001",
"flow": null,
- "id": "bps_1P41mvDEQaroqDjsvzhVwTxb",
+ "id": "NORMALIZED-33",
"livemode": false,
"locale": null,
"object": "billing_portal.session",
"on_behalf_of": null,
"return_url": "http://zulip.testserver/billing/",
- "url": "https://billing.stripe.com/p/session/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBSTVIwZ1JqSERWdDkxcGllcWlNWUpJcm5nemRS0100Jhf7RQQh"
+ "url": "https://billing.stripe.com/p/session/test_NORMALIZED-3"
}
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--checkout.Session.create.1.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--checkout.Session.create.1.json
index 779583a20e9..45c537d9548 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--checkout.Session.create.1.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--checkout.Session.create.1.json
@@ -36,7 +36,7 @@
},
"customer_email": null,
"expires_at": 1000000000,
- "id": "cs_test_NORMALIZED03CGCYWXzwS46zFQMNXyKtSBZjFcCE05CTu37oC6RMkFUGJn",
+ "id": "NORMALIZED-34",
"invoice": null,
"invoice_creation": null,
"livemode": false,
@@ -64,7 +64,8 @@
"enabled": false
},
"recovered_from": null,
- "setup_intent": "seti_1P41mjDEQaroqDjsHYDXVzvS",
+ "saved_payment_method_options": null,
+ "setup_intent": "seti_NORMALIZED00000000000001",
"shipping": null,
"shipping_address_collection": null,
"shipping_options": [],
@@ -75,5 +76,5 @@
"success_url": "http://zulip.testserver/billing/event_status/?stripe_session_id={CHECKOUT_SESSION_ID}",
"total_details": null,
"ui_mode": "hosted",
- "url": "https://checkout.stripe.com/c/pay/cs_test_NORMALIZED03CGCYWXzwS46zFQMNXyKtSBZjFcCE05CTu37oC6RMkFUGJn#fid1d2BpamRhQ2prcSc%2FJ1ZqcHdmYCVWZGt2JVV3aicpJ2R1bE5gfCc%2FJ3VuWnFgdnFaXVRmMU5zNkldQTY9SnNRY09XZml2UXNQJyknY3dqaFZgd3Ngdyc%2FcXdwYCknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpmamlwaGsnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl"
+ "url": "https://checkout.stripe.com/c/pay/cs_test_NORMALIZED-1"
}
diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--checkout.Session.list.1.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--checkout.Session.list.1.json
index 981197382c1..d8916c51eea 100644
--- a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--checkout.Session.list.1.json
+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls--checkout.Session.list.1.json
@@ -38,7 +38,7 @@
},
"customer_email": null,
"expires_at": 1000000000,
- "id": "cs_test_NORMALIZED03CGCYWXzwS46zFQMNXyKtSBZjFcCE05CTu37oC6RMkFUGJn",
+ "id": "NORMALIZED-34",
"invoice": null,
"invoice_creation": null,
"livemode": false,
@@ -66,7 +66,8 @@
"enabled": false
},
"recovered_from": null,
- "setup_intent": "seti_1P41mjDEQaroqDjsHYDXVzvS",
+ "saved_payment_method_options": null,
+ "setup_intent": "seti_NORMALIZED00000000000001",
"shipping": null,
"shipping_address_collection": null,
"shipping_options": [],
@@ -77,7 +78,7 @@
"success_url": "http://zulip.testserver/billing/event_status/?stripe_session_id={CHECKOUT_SESSION_ID}",
"total_details": null,
"ui_mode": "hosted",
- "url": "https://checkout.stripe.com/c/pay/cs_test_NORMALIZED03CGCYWXzwS46zFQMNXyKtSBZjFcCE05CTu37oC6RMkFUGJn#fid1d2BpamRhQ2prcSc%2FJ1ZqcHdmYCVWZGt2JVV3aicpJ2R1bE5gfCc%2FJ3VuWnFgdnFaXVRmMU5zNkldQTY9SnNRY09XZml2UXNQJyknY3dqaFZgd3Ngdyc%2FcXdwYCknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpmamlwaGsnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl"
+ "url": "https://checkout.stripe.com/c/pay/cs_test_NORMALIZED-1"
}
],
"has_more": false,
diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.py
index 7840aec9b8b..f1d8ecde52e 100644
--- a/corporate/tests/test_stripe.py
+++ b/corporate/tests/test_stripe.py
@@ -228,23 +228,36 @@ def normalize_fixture_data(
("txn", 24),
("invst", 26),
("rcpt", 31),
+ ("seti", 24),
+ ("pm", 24),
+ ("setatt", 24),
+ ("bpc", 24),
+ ("bps", 24),
]
- # We'll replace cus_D7OT2jf5YAtZQ2 with something like cus_NORMALIZED0001
+
+ # We'll replace "invoice_prefix": "A35BC4Q" with something like "invoice_prefix": "NORMA01"
pattern_translations = {
- rf"{prefix}_[A-Za-z0-9]{{{length}}}": f"{prefix}_NORMALIZED%0{length - 10}d"
- for prefix, length in id_lengths
+ r'"invoice_prefix": "([A-Za-z0-9]{7,8})"': "NORMA%02d",
+ r'"fingerprint": "([A-Za-z0-9]{16})"': "NORMALIZED%06d",
+ r'"number": "([A-Za-z0-9]{7,8}-[A-Za-z0-9]{4})"': "NORMALI-%04d",
+ r'"address": "([A-Za-z0-9]{9}-test_[A-Za-z0-9]{12})"': "000000000-test_NORMALIZED%02d",
+ r'"client_secret": "([\w]+)"': "NORMALIZED-%d",
+ r'"url": "https://billing.stripe.com/p/session/test_([\w]+)"': "NORMALIZED-%d",
+ r'"url": "https://checkout.stripe.com/c/pay/cs_test_([\w#%]+)"': "NORMALIZED-%d",
+ r'"hosted_invoice_url": "https://invoice.stripe.com/i/acct_[\w]+/test_[\w,]+\?s=[\w]+"': '"hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED/test_NORMALIZED-%d?s=ap"',
+ r'"invoice_pdf": "https://pay.stripe.com/invoice/acct_[\w]+/test_[\w,]+/pdf\?s=[\w]+"': '"invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED/test_NORMALIZED-%d/pdf?s=ap"',
+ r'"id": "([\w]+)"': "NORMALIZED-%d",
+ # Don't use (..) notation, since the matched strings may be small integers that will also match
+ # elsewhere in the file
+ r'"realm_id": "[0-9]+"': '"realm_id": "%d"',
+ r'"account_name": "[\w\s]+"': '"account_name": "NORMALIZED-%d"',
}
- # We'll replace "invoice_prefix": "A35BC4Q" with something like "invoice_prefix": "NORMA01"
+
+ # We'll replace cus_D7OT2jf5YAtZQ2 with something like cus_NORMALIZED0001
pattern_translations.update(
{
- r'"invoice_prefix": "([A-Za-z0-9]{7,8})"': "NORMA%02d",
- r'"fingerprint": "([A-Za-z0-9]{16})"': "NORMALIZED%06d",
- r'"number": "([A-Za-z0-9]{7,8}-[A-Za-z0-9]{4})"': "NORMALI-%04d",
- r'"address": "([A-Za-z0-9]{9}-test_[A-Za-z0-9]{12})"': "000000000-test_NORMALIZED%02d",
- # Don't use (..) notation, since the matched strings may be small integers that will also match
- # elsewhere in the file
- r'"realm_id": "[0-9]+"': '"realm_id": "%d"',
- r'"account_name": "[\w\s]+"': '"account_name": "NORMALIZED-%d"',
+ rf"{prefix}_[A-Za-z0-9]{{{length}}}": f"{prefix}_NORMALIZED%0{length - 10}d"
+ for prefix, length in id_lengths
}
)
# Normalizing across all timestamps still causes a lot of variance run to run, which is
@@ -269,7 +282,7 @@ def normalize_fixture_data(
file_content = re.sub(r'(?<="risk_score": )(\d+)', "0", file_content)
file_content = re.sub(r'(?<="times_redeemed": )(\d+)', "0", file_content)
file_content = re.sub(
- r'(?<="idempotency-key": )"([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f-]*)"',
+ r'(?<="idempotency_key": )"([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"',
'"00000000-0000-0000-0000-000000000000"',
file_content,
)