Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
event_status: Return user back to same license management after session.
Aman Agrawalde267b964c1a
diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.pyindex 16dbba1f756..a35aff02a43 100644--- a/corporate/lib/stripe.py+++ b/corporate/lib/stripe.py@@ -639,10 +639,15 @@ class BillingSession(ABC):self,metadata: Dict[str, Any],session_type: int,+ manual_license_management: bool,) -> stripe.checkout.Session:customer = self.update_or_create_stripe_customer()+ cancel_url = f"{self.billing_session_url}/upgrade/"+ if manual_license_management:+ cancel_url = f"{self.billing_session_url}/upgrade/?manual_license_management=true"+stripe_session = stripe.checkout.Session.create(- cancel_url=f"{self.billing_session_url}/upgrade/",+ cancel_url=cancel_url,customer=customer.stripe_customer_id,metadata=metadata,mode="setup",@@ -653,6 +658,7 @@ class BillingSession(ABC):stripe_session_id=stripe_session.id,customer=customer,type=session_type,+ is_manual_license_management_upgrade_session=manual_license_management,)return stripe_sessiondiff --git a/corporate/migrations/0022_session_is_manual_license_management_upgrade_session.py b/corporate/migrations/0022_session_is_manual_license_management_upgrade_session.pynew file mode 100644index 00000000000..0d26b8e3b50--- /dev/null+++ b/corporate/migrations/0022_session_is_manual_license_management_upgrade_session.py@@ -0,0 +1,17 @@+# Generated by Django 4.2.7 on 2023-11-21 11:20++from django.db import migrations, models+++class Migration(migrations.Migration):+ dependencies = [+ ("corporate", "0021_remove_session_payment_intent"),+ ]++ operations = [+ migrations.AddField(+ model_name="session",+ name="is_manual_license_management_upgrade_session",+ field=models.BooleanField(default=False),+ ),+ ]diff --git a/corporate/models.py b/corporate/models.pyindex 7d6c0cf53bc..07e7b30bad2 100644--- a/corporate/models.py+++ b/corporate/models.py@@ -115,6 +115,9 @@ class Session(models.Model):COMPLETED = 10status = models.SmallIntegerField(default=CREATED)+ # Did the user opt to manually manage licenses before clicking on update button?+ is_manual_license_management_upgrade_session = models.BooleanField(default=False)+def get_status_as_string(self) -> str:return {Session.CREATED: "created", Session.COMPLETED: "completed"}[self.status]@@ -129,6 +132,9 @@ class Session(models.Model):session_dict["status"] = self.get_status_as_string()session_dict["type"] = self.get_type_as_string()+ session_dict[+ "is_manual_license_management_upgrade_session"+ ] = self.is_manual_license_management_upgrade_sessionevent = self.get_last_associated_event()if event is not None:session_dict["event_handler"] = event.get_event_handler_details_as_dict()diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.create.1.json b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.create.1.jsonindex 593a07ed0c8..a6a0e57b1f7 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.create.1.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.create.1.json@@ -1,7 +1,7 @@{"address": null,"balance": 0,- "created": 1000000000,+ "created": 1700592386,"currency": null,"default_currency": null,"default_source": null,@@ -9,8 +9,8 @@"description": "zulip (Zulip Dev)","discount": null,"email": "[email protected]",- "id": "cus_NORMALIZED0001",- "invoice_prefix": "NORMA01",+ "id": "cus_P358SWUcASaSWt",+ "invoice_prefix": "69DA5EF9","invoice_settings": {"custom_fields": null,"default_payment_method": null,@@ -19,7 +19,7 @@},"livemode": false,"metadata": {- "realm_id": "1",+ "realm_id": "2","realm_str": "zulip"},"name": null,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.modify.1.json b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.modify.1.jsonindex 942600e388b..46b295948f1 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.modify.1.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.modify.1.json@@ -1,7 +1,7 @@{"address": null,"balance": 0,- "created": 1000000000,+ "created": 1700592386,"currency": null,"default_currency": null,"default_source": null,@@ -9,17 +9,17 @@"description": "zulip (Zulip Dev)","discount": null,"email": "[email protected]",- "id": "cus_NORMALIZED0001",- "invoice_prefix": "NORMA01",+ "id": "cus_P358SWUcASaSWt",+ "invoice_prefix": "69DA5EF9","invoice_settings": {"custom_fields": null,- "default_payment_method": "pm_1ODZZnDEQaroqDjsRI67eH96",+ "default_payment_method": "pm_1OEyxsDEQaroqDjsklOoFXrh","footer": null,"rendering_options": null},"livemode": false,"metadata": {- "realm_id": "1",+ "realm_id": "2","realm_str": "zulip"},"name": null,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.modify.2.json b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.modify.2.jsonindex e731fd4ddb6..9a129884622 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.modify.2.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.modify.2.json@@ -1,7 +1,7 @@{"address": null,"balance": 0,- "created": 1000000000,+ "created": 1700592386,"currency": "usd","default_currency": "usd","default_source": null,@@ -9,17 +9,17 @@"description": "zulip (Zulip Dev)","discount": null,"email": "[email protected]",- "id": "cus_NORMALIZED0001",- "invoice_prefix": "NORMA01",+ "id": "cus_P358SWUcASaSWt",+ "invoice_prefix": "69DA5EF9","invoice_settings": {"custom_fields": null,- "default_payment_method": "pm_1ODZa0DEQaroqDjsfkPI8Yxd",+ "default_payment_method": "pm_1OEyy6DEQaroqDjscAhZ1Tzb","footer": null,"rendering_options": null},"livemode": false,"metadata": {- "realm_id": "1",+ "realm_id": "2","realm_str": "zulip"},"name": null,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.modify.3.json b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.modify.3.jsonindex e9c25d8fa4c..ff38dcd93eb 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.modify.3.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.modify.3.json@@ -1,7 +1,7 @@{"address": null,"balance": 0,- "created": 1000000000,+ "created": 1700592386,"currency": "usd","default_currency": "usd","default_source": null,@@ -9,17 +9,17 @@"description": "zulip (Zulip Dev)","discount": null,"email": "[email protected]",- "id": "cus_NORMALIZED0001",- "invoice_prefix": "NORMA01",+ "id": "cus_P358SWUcASaSWt",+ "invoice_prefix": "69DA5EF9","invoice_settings": {"custom_fields": null,- "default_payment_method": "pm_1ODZa6DEQaroqDjsBeAKxfS1",+ "default_payment_method": "pm_1OEyyDDEQaroqDjsoHRzbvSp","footer": null,"rendering_options": null},"livemode": false,"metadata": {- "realm_id": "1",+ "realm_id": "2","realm_str": "zulip"},"name": null,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.1.json b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.1.jsonindex 3e09a6b49ba..29e41a002f4 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.1.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.1.json@@ -1,7 +1,7 @@{"address": null,"balance": 0,- "created": 1000000000,+ "created": 1700592386,"currency": null,"default_currency": null,"default_source": null,@@ -9,8 +9,8 @@"description": "zulip (Zulip Dev)","discount": null,"email": "[email protected]",- "id": "cus_NORMALIZED0001",- "invoice_prefix": "NORMA01",+ "id": "cus_P358SWUcASaSWt",+ "invoice_prefix": "69DA5EF9","invoice_settings": {"custom_fields": null,"default_payment_method": {@@ -37,7 +37,7 @@"country": "US","exp_month": 11,"exp_year": 2024,- "fingerprint": "NORMALIZED000001",+ "fingerprint": "9XKsMixKBi6kIIzd","funding": "credit","generated_from": null,"last4": "4242",@@ -52,9 +52,9 @@},"wallet": null},- "created": 1000000000,- "customer": "cus_NORMALIZED0001",- "id": "pm_1ODZZnDEQaroqDjsRI67eH96",+ "created": 1700592389,+ "customer": "cus_P358SWUcASaSWt",+ "id": "pm_1OEyxsDEQaroqDjsklOoFXrh","livemode": false,"metadata": {},"object": "payment_method",@@ -65,7 +65,7 @@},"livemode": false,"metadata": {- "realm_id": "1",+ "realm_id": "2","realm_str": "zulip"},"name": null,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.2.json b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.2.jsonindex 3e09a6b49ba..29e41a002f4 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.2.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.2.json@@ -1,7 +1,7 @@{"address": null,"balance": 0,- "created": 1000000000,+ "created": 1700592386,"currency": null,"default_currency": null,"default_source": null,@@ -9,8 +9,8 @@"description": "zulip (Zulip Dev)","discount": null,"email": "[email protected]",- "id": "cus_NORMALIZED0001",- "invoice_prefix": "NORMA01",+ "id": "cus_P358SWUcASaSWt",+ "invoice_prefix": "69DA5EF9","invoice_settings": {"custom_fields": null,"default_payment_method": {@@ -37,7 +37,7 @@"country": "US","exp_month": 11,"exp_year": 2024,- "fingerprint": "NORMALIZED000001",+ "fingerprint": "9XKsMixKBi6kIIzd","funding": "credit","generated_from": null,"last4": "4242",@@ -52,9 +52,9 @@},"wallet": null},- "created": 1000000000,- "customer": "cus_NORMALIZED0001",- "id": "pm_1ODZZnDEQaroqDjsRI67eH96",+ "created": 1700592389,+ "customer": "cus_P358SWUcASaSWt",+ "id": "pm_1OEyxsDEQaroqDjsklOoFXrh","livemode": false,"metadata": {},"object": "payment_method",@@ -65,7 +65,7 @@},"livemode": false,"metadata": {- "realm_id": "1",+ "realm_id": "2","realm_str": "zulip"},"name": null,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.3.json b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.3.jsonindex 3e09a6b49ba..29e41a002f4 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.3.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.3.json@@ -1,7 +1,7 @@{"address": null,"balance": 0,- "created": 1000000000,+ "created": 1700592386,"currency": null,"default_currency": null,"default_source": null,@@ -9,8 +9,8 @@"description": "zulip (Zulip Dev)","discount": null,"email": "[email protected]",- "id": "cus_NORMALIZED0001",- "invoice_prefix": "NORMA01",+ "id": "cus_P358SWUcASaSWt",+ "invoice_prefix": "69DA5EF9","invoice_settings": {"custom_fields": null,"default_payment_method": {@@ -37,7 +37,7 @@"country": "US","exp_month": 11,"exp_year": 2024,- "fingerprint": "NORMALIZED000001",+ "fingerprint": "9XKsMixKBi6kIIzd","funding": "credit","generated_from": null,"last4": "4242",@@ -52,9 +52,9 @@},"wallet": null},- "created": 1000000000,- "customer": "cus_NORMALIZED0001",- "id": "pm_1ODZZnDEQaroqDjsRI67eH96",+ "created": 1700592389,+ "customer": "cus_P358SWUcASaSWt",+ "id": "pm_1OEyxsDEQaroqDjsklOoFXrh","livemode": false,"metadata": {},"object": "payment_method",@@ -65,7 +65,7 @@},"livemode": false,"metadata": {- "realm_id": "1",+ "realm_id": "2","realm_str": "zulip"},"name": null,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.4.json b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.4.jsonindex 3e09a6b49ba..29e41a002f4 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.4.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.4.json@@ -1,7 +1,7 @@{"address": null,"balance": 0,- "created": 1000000000,+ "created": 1700592386,"currency": null,"default_currency": null,"default_source": null,@@ -9,8 +9,8 @@"description": "zulip (Zulip Dev)","discount": null,"email": "[email protected]",- "id": "cus_NORMALIZED0001",- "invoice_prefix": "NORMA01",+ "id": "cus_P358SWUcASaSWt",+ "invoice_prefix": "69DA5EF9","invoice_settings": {"custom_fields": null,"default_payment_method": {@@ -37,7 +37,7 @@"country": "US","exp_month": 11,"exp_year": 2024,- "fingerprint": "NORMALIZED000001",+ "fingerprint": "9XKsMixKBi6kIIzd","funding": "credit","generated_from": null,"last4": "4242",@@ -52,9 +52,9 @@},"wallet": null},- "created": 1000000000,- "customer": "cus_NORMALIZED0001",- "id": "pm_1ODZZnDEQaroqDjsRI67eH96",+ "created": 1700592389,+ "customer": "cus_P358SWUcASaSWt",+ "id": "pm_1OEyxsDEQaroqDjsklOoFXrh","livemode": false,"metadata": {},"object": "payment_method",@@ -65,7 +65,7 @@},"livemode": false,"metadata": {- "realm_id": "1",+ "realm_id": "2","realm_str": "zulip"},"name": null,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.5.json b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.5.jsonindex e2b49e5126c..986141e2c53 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.5.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.5.json@@ -1,7 +1,7 @@{"address": null,"balance": 0,- "created": 1000000000,+ "created": 1700592386,"currency": "usd","default_currency": "usd","default_source": null,@@ -9,8 +9,8 @@"description": "zulip (Zulip Dev)","discount": null,"email": "[email protected]",- "id": "cus_NORMALIZED0001",- "invoice_prefix": "NORMA01",+ "id": "cus_P358SWUcASaSWt",+ "invoice_prefix": "69DA5EF9","invoice_settings": {"custom_fields": null,"default_payment_method": {@@ -37,7 +37,7 @@"country": "US","exp_month": 11,"exp_year": 2024,- "fingerprint": "NORMALIZED000002",+ "fingerprint": "ABa2sePBR7Lu711Z","funding": "credit","generated_from": null,"last4": "0341",@@ -52,9 +52,9 @@},"wallet": null},- "created": 1000000000,- "customer": "cus_NORMALIZED0001",- "id": "pm_1ODZa0DEQaroqDjsfkPI8Yxd",+ "created": 1700592402,+ "customer": "cus_P358SWUcASaSWt",+ "id": "pm_1OEyy6DEQaroqDjscAhZ1Tzb","livemode": false,"metadata": {},"object": "payment_method",@@ -65,7 +65,7 @@},"livemode": false,"metadata": {- "realm_id": "1",+ "realm_id": "2","realm_str": "zulip"},"name": null,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.6.json b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.6.jsonindex 0bbf5bf0b08..532f104bd74 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.6.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.6.json@@ -1,7 +1,7 @@{"address": null,"balance": 0,- "created": 1000000000,+ "created": 1700592386,"currency": "usd","default_currency": "usd","default_source": null,@@ -9,8 +9,8 @@"description": "zulip (Zulip Dev)","discount": null,"email": "[email protected]",- "id": "cus_NORMALIZED0001",- "invoice_prefix": "NORMA01",+ "id": "cus_P358SWUcASaSWt",+ "invoice_prefix": "69DA5EF9","invoice_settings": {"custom_fields": null,"default_payment_method": null,@@ -19,7 +19,7 @@},"livemode": false,"metadata": {- "realm_id": "1",+ "realm_id": "2","realm_str": "zulip"},"name": null,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.7.json b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.7.jsonindex d1c4cc18c5c..5ffe805ddc5 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.7.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Customer.retrieve.7.json@@ -1,7 +1,7 @@{"address": null,"balance": 0,- "created": 1000000000,+ "created": 1700592386,"currency": "usd","default_currency": "usd","default_source": null,@@ -9,8 +9,8 @@"description": "zulip (Zulip Dev)","discount": null,"email": "[email protected]",- "id": "cus_NORMALIZED0001",- "invoice_prefix": "NORMA01",+ "id": "cus_P358SWUcASaSWt",+ "invoice_prefix": "69DA5EF9","invoice_settings": {"custom_fields": null,"default_payment_method": {@@ -37,7 +37,7 @@"country": "US","exp_month": 11,"exp_year": 2024,- "fingerprint": "NORMALIZED000003",+ "fingerprint": "HIhaF5dAXctoIcSd","funding": "credit","generated_from": null,"last4": "4444",@@ -52,9 +52,9 @@},"wallet": null},- "created": 1000000000,- "customer": "cus_NORMALIZED0001",- "id": "pm_1ODZa6DEQaroqDjsBeAKxfS1",+ "created": 1700592409,+ "customer": "cus_P358SWUcASaSWt",+ "id": "pm_1OEyyDDEQaroqDjsoHRzbvSp","livemode": false,"metadata": {},"object": "payment_method",@@ -65,7 +65,7 @@},"livemode": false,"metadata": {- "realm_id": "1",+ "realm_id": "2","realm_str": "zulip"},"name": null,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Event.list.1.json b/corporate/tests/stripe_fixtures/replace_payment_method--Event.list.1.jsonindex 808706f1748..fe1c00c6521 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Event.list.1.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Event.list.1.json@@ -2,12 +2,12 @@"data": [{"api_version": "2020-08-27",- "created": 1000000000,+ "created": 1700592390,"data": {"object": {"address": null,"balance": 0,- "created": 1000000000,+ "created": 1700592386,"currency": null,"default_currency": null,"default_source": null,@@ -15,17 +15,17 @@"description": "zulip (Zulip Dev)","discount": null,"email": "[email protected]",- "id": "cus_NORMALIZED0001",- "invoice_prefix": "NORMA01",+ "id": "cus_P358SWUcASaSWt",+ "invoice_prefix": "69DA5EF9","invoice_settings": {"custom_fields": null,- "default_payment_method": "pm_1ODZZnDEQaroqDjsRI67eH96",+ "default_payment_method": "pm_1OEyxsDEQaroqDjsklOoFXrh","footer": null,"rendering_options": null},"livemode": false,"metadata": {- "realm_id": "1",+ "realm_id": "2","realm_str": "zulip"},"name": null,@@ -43,13 +43,13 @@}}},- "id": "evt_1ODZZpDEQaroqDjsaksm7sLG",+ "id": "evt_1OEyxvDEQaroqDjsoWhcKsPT","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0001",- "idempotency_key": "01b9dac5-1d6b-40ac-b08b-20ec652467e6"+ "id": "req_uJ7jRb0QgNkkeH",+ "idempotency_key": "cb3224ab-38fe-476f-8dd1-11a1e5840d20"},"type": "customer.updated"}diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Event.list.2.json b/corporate/tests/stripe_fixtures/replace_payment_method--Event.list.2.jsonindex 6c265afe8dd..19d701fa597 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Event.list.2.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Event.list.2.json@@ -2,7 +2,7 @@"data": [{"api_version": "2020-08-27",- "created": 1000000000,+ "created": 1700592394,"data": {"object": {"amount": 48000,@@ -26,7 +26,7 @@"application": null,"application_fee": null,"application_fee_amount": null,- "balance_transaction": "txn_NORMALIZED00000000000001",+ "balance_transaction": "txn_3OEyxxDEQaroqDjs0BgcA3dQ","billing_details": {"address": {"city": null,@@ -42,9 +42,9 @@},"calculated_statement_descriptor": "ZULIP CLOUD STANDARD","captured": true,- "created": 1000000000,+ "created": 1700592393,"currency": "usd",- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","description": "Upgrade to Zulip Cloud Standard, $80.0 x 6","destination": null,"dispute": null,@@ -53,7 +53,7 @@"failure_code": null,"failure_message": null,"fraud_details": {},- "id": "ch_NORMALIZED00000000000001",+ "id": "ch_3OEyxxDEQaroqDjs0Jpvm8ZV","invoice": null,"livemode": false,"metadata": {@@ -62,7 +62,7 @@"license_management": "automatic","licenses": "6","price_per_license": "8000",- "realm_id": "1",+ "realm_id": "2","realm_str": "zulip","seat_count": "6","type": "upgrade",@@ -76,13 +76,13 @@"network_status": "approved_by_network","reason": null,"risk_level": "normal",- "risk_score": 0,+ "risk_score": 11,"seller_message": "Payment complete.","type": "authorized"},"paid": true,- "payment_intent": "pi_NORMALIZED00000000000001",- "payment_method": "pm_1ODZZnDEQaroqDjsRI67eH96",+ "payment_intent": "pi_3OEyxxDEQaroqDjs0PMlUA1C",+ "payment_method": "pm_1OEyxsDEQaroqDjsklOoFXrh","payment_method_details": {"card": {"amount_authorized": 48000,@@ -98,7 +98,7 @@"extended_authorization": {"status": "disabled"},- "fingerprint": "NORMALIZED000001",+ "fingerprint": "9XKsMixKBi6kIIzd","funding": "credit","incremental_authorization": {"status": "unavailable"@@ -124,14 +124,14 @@},"receipt_email": "[email protected]","receipt_number": null,- "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKNi136oGMgaUD2v4J7M6LBYYJwCifNZeOfdFd7EqBHcFp3qw4IoW7pV1kMvBp_Pua71BiRAc7vnPVyPM",+ "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKIr286oGMgahnL97SEg6LBZzJlCseePgSDjKIqsKdsIp4xsOxsxUjVKnKljSNM6ylddXOncAaVQCO9zd","refunded": false,"refunds": {"data": [],"has_more": false,"object": "list","total_count": 0,- "url": "/v1/charges/ch_NORMALIZED00000000000001/refunds"+ "url": "/v1/charges/ch_3OEyxxDEQaroqDjs0Jpvm8ZV/refunds"},"review": null,"shipping": null,@@ -147,18 +147,18 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000001"+ "url": "/v1/charges?payment_intent=pi_3OEyxxDEQaroqDjs0PMlUA1C"},- "client_secret": "pi_NORMALIZED00000000000001_secret_SjfUQBf7o3ccnZsYnAaZYyvx2",+ "client_secret": "pi_3OEyxxDEQaroqDjs0PMlUA1C_secret_tLFPeH51I31E0g48R3YR1224j","confirmation_method": "automatic",- "created": 1000000000,+ "created": 1700592393,"currency": "usd",- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","description": "Upgrade to Zulip Cloud Standard, $80.0 x 6",- "id": "pi_NORMALIZED00000000000001",+ "id": "pi_3OEyxxDEQaroqDjs0PMlUA1C","invoice": null,"last_payment_error": null,- "latest_charge": "ch_NORMALIZED00000000000001",+ "latest_charge": "ch_3OEyxxDEQaroqDjs0Jpvm8ZV","livemode": false,"metadata": {"billing_modality": "charge_automatically",@@ -166,7 +166,7 @@"license_management": "automatic","licenses": "6","price_per_license": "8000",- "realm_id": "1",+ "realm_id": "2","realm_str": "zulip","seat_count": "6","type": "upgrade",@@ -176,7 +176,7 @@"next_action": null,"object": "payment_intent","on_behalf_of": null,- "payment_method": "pm_1ODZZnDEQaroqDjsRI67eH96",+ "payment_method": "pm_1OEyxsDEQaroqDjsklOoFXrh","payment_method_configuration_details": null,"payment_method_options": {"card": {@@ -202,19 +202,19 @@"transfer_group": null}},- "id": "evt_3ODZZrDEQaroqDjs0sJHWmwX",+ "id": "evt_3OEyxxDEQaroqDjs0ycajZLF","livemode": false,"object": "event","pending_webhooks": 2,"request": {- "id": "req_NORMALIZED0002",- "idempotency_key": "f0308e9e-4a77-4ec2-85ea-2d8c799457f1"+ "id": "req_Jm4wNpb8PNuk5M",+ "idempotency_key": "f6ceb0ef-cbf2-4f8d-b545-64f49d5aa049"},"type": "payment_intent.succeeded"},{"api_version": "2020-08-27",- "created": 1000000000,+ "created": 1700592394,"data": {"object": {"amount": 48000,@@ -223,7 +223,7 @@"application": null,"application_fee": null,"application_fee_amount": null,- "balance_transaction": "txn_NORMALIZED00000000000001",+ "balance_transaction": "txn_3OEyxxDEQaroqDjs0BgcA3dQ","billing_details": {"address": {"city": null,@@ -239,9 +239,9 @@},"calculated_statement_descriptor": "ZULIP CLOUD STANDARD","captured": true,- "created": 1000000000,+ "created": 1700592393,"currency": "usd",- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","description": "Upgrade to Zulip Cloud Standard, $80.0 x 6","destination": null,"dispute": null,@@ -250,7 +250,7 @@"failure_code": null,"failure_message": null,"fraud_details": {},- "id": "ch_NORMALIZED00000000000001",+ "id": "ch_3OEyxxDEQaroqDjs0Jpvm8ZV","invoice": null,"livemode": false,"metadata": {@@ -259,7 +259,7 @@"license_management": "automatic","licenses": "6","price_per_license": "8000",- "realm_id": "1",+ "realm_id": "2","realm_str": "zulip","seat_count": "6","type": "upgrade",@@ -273,13 +273,13 @@"network_status": "approved_by_network","reason": null,"risk_level": "normal",- "risk_score": 0,+ "risk_score": 11,"seller_message": "Payment complete.","type": "authorized"},"paid": true,- "payment_intent": "pi_NORMALIZED00000000000001",- "payment_method": "pm_1ODZZnDEQaroqDjsRI67eH96",+ "payment_intent": "pi_3OEyxxDEQaroqDjs0PMlUA1C",+ "payment_method": "pm_1OEyxsDEQaroqDjsklOoFXrh","payment_method_details": {"card": {"amount_authorized": 48000,@@ -295,7 +295,7 @@"extended_authorization": {"status": "disabled"},- "fingerprint": "NORMALIZED000001",+ "fingerprint": "9XKsMixKBi6kIIzd","funding": "credit","incremental_authorization": {"status": "unavailable"@@ -321,14 +321,14 @@},"receipt_email": "[email protected]","receipt_number": null,- "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKNi136oGMgan29ZDQ506LBbvTWXJJQKfvne6siVOioPbeGYHi5B9479-xOaAH0G2xkZ0QthWa0Ig6T2U",+ "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKIr286oGMgZZucNL4KA6LBZfgistelvvWwFfuy-_WAgOOzAqMgSgRRHYnBRqLI4Eq0Uz2TF_643LkNOe","refunded": false,"refunds": {"data": [],"has_more": false,"object": "list","total_count": 0,- "url": "/v1/charges/ch_NORMALIZED00000000000001/refunds"+ "url": "/v1/charges/ch_3OEyxxDEQaroqDjs0Jpvm8ZV/refunds"},"review": null,"shipping": null,@@ -341,13 +341,13 @@"transfer_group": null}},- "id": "evt_3ODZZrDEQaroqDjs02CCSwaZ",+ "id": "evt_3OEyxxDEQaroqDjs0C2WyK3p","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0002",- "idempotency_key": "f0308e9e-4a77-4ec2-85ea-2d8c799457f1"+ "id": "req_Jm4wNpb8PNuk5M",+ "idempotency_key": "f6ceb0ef-cbf2-4f8d-b545-64f49d5aa049"},"type": "charge.succeeded"}diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Event.list.3.json b/corporate/tests/stripe_fixtures/replace_payment_method--Event.list.3.jsonindex 180d971e0a9..44d1ce198cc 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Event.list.3.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Event.list.3.json@@ -2,7 +2,7 @@"data": [{"api_version": "2020-08-27",- "created": 1000000000,+ "created": 1700592396,"data": {"object": {"account_country": "US",@@ -24,10 +24,10 @@"billing_reason": "manual","charge": null,"collection_method": "charge_automatically",- "created": 1000000000,+ "created": 1700592395,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","customer_address": null,"customer_email": "[email protected]","customer_name": null,@@ -42,13 +42,13 @@"discount": null,"discounts": [],"due_date": null,- "effective_at": 1000000000,+ "effective_at": 1700592396,"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwMUEzTlFvcUFMcFNORXd4SG4xdUQ1S1FrV25JLDkwNzk3Mjc00200psXrWwm4?s=ap",- "id": "in_NORMALIZED00000000000001",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwMUEzTlFvcUFMcFNORXd4SG4xdUQ1S1FrV25JLDkwNzk3Mjc00200psXrWwm4/pdf?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4R1VMUFVPaXhKTng0ZUpuZEVSQ0g4RzdHcDJtLDkxMTMzMTk20200HCWA2HsQ?s=ap",+ "id": "in_1OEyxzDEQaroqDjs8WQvU4Yx",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4R1VMUFVPaXhKTng0ZUpuZEVSQ0g4RzdHcDJtLDkxMTMzMTk20200HCWA2HsQ/pdf?s=ap","last_finalization_error": null,"latest_revision": null,"lines": {@@ -61,8 +61,8 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000001",- "invoice_item": "ii_NORMALIZED00000000000001",+ "id": "il_1OEyxzDEQaroqDjsAOwkMlcc",+ "invoice_item": "ii_1OEyxzDEQaroqDjsfKGNI9OG","livemode": false,"metadata": {},"object": "line_item",@@ -74,16 +74,16 @@"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1698927319,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000001",+ "id": "price_1O7znvDEQaroqDjsLJjqNJy0","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0001",+ "product": "prod_OvY3rmiwsD4vFL","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -111,29 +111,29 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000002",- "invoice_item": "ii_NORMALIZED00000000000002",+ "id": "il_1OEyxzDEQaroqDjsnpgOAqxP",+ "invoice_item": "ii_1OEyxyDEQaroqDjshhkuKTu6","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1700592394,+ "start": 1700592394},"plan": null,"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1699463487,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000002",+ "id": "price_1OAFHnDEQaroqDjsGPnkI1Z2","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0002",+ "product": "prod_OvY3hKgN66WIeP","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -157,12 +157,12 @@"has_more": false,"object": "list","total_count": 2,- "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"+ "url": "/v1/invoices/in_1OEyxzDEQaroqDjs8WQvU4Yx/lines"},"livemode": false,"metadata": {},"next_payment_attempt": null,- "number": "NORMALI-0001",+ "number": "69DA5EF9-0001","object": "invoice","on_behalf_of": null,"paid": true,@@ -173,8 +173,8 @@"payment_method_options": null,"payment_method_types": null},- "period_end": 1000000000,- "period_start": 1000000000,+ "period_end": 1700592395,+ "period_start": 1700592395,"post_payment_credit_notes_amount": 0,"pre_payment_credit_notes_amount": 0,"quote": null,@@ -192,9 +192,9 @@"statement_descriptor": "Zulip Cloud Standard","status": "paid","status_transitions": {- "finalized_at": 1000000000,+ "finalized_at": 1700592396,"marked_uncollectible_at": null,- "paid_at": 1000000000,+ "paid_at": 1700592396,"voided_at": null},"subscription": null,@@ -219,7 +219,7 @@"ending_balance": null,"hosted_invoice_url": null,"invoice_pdf": null,- "next_payment_attempt": 1000000000,+ "next_payment_attempt": 1700595995,"number": null,"paid": false,"rendering": {@@ -234,19 +234,19 @@}}},- "id": "evt_1ODZZuDEQaroqDjsTYoTbu6K",+ "id": "evt_1OEyy0DEQaroqDjsZGGMFdtA","livemode": false,"object": "event","pending_webhooks": 2,"request": {- "id": "req_NORMALIZED0003",- "idempotency_key": "7f25f52e-840e-4ba2-bcbb-a77b7c938f5f"+ "id": "req_XE7G6X9LMuefmb",+ "idempotency_key": "84fb4129-644a-4e2e-b906-f517d374a06f"},"type": "invoice.updated"},{"api_version": "2020-08-27",- "created": 1000000000,+ "created": 1700592395,"data": {"object": {"account_country": "US",@@ -268,10 +268,10 @@"billing_reason": "manual","charge": null,"collection_method": "charge_automatically",- "created": 1000000000,+ "created": 1700592395,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","customer_address": null,"customer_email": "[email protected]","customer_name": null,@@ -291,7 +291,7 @@"footer": null,"from_invoice": null,"hosted_invoice_url": null,- "id": "in_NORMALIZED00000000000001",+ "id": "in_1OEyxzDEQaroqDjs8WQvU4Yx","invoice_pdf": null,"last_finalization_error": null,"latest_revision": null,@@ -305,8 +305,8 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000001",- "invoice_item": "ii_NORMALIZED00000000000001",+ "id": "il_1OEyxzDEQaroqDjsAOwkMlcc",+ "invoice_item": "ii_1OEyxzDEQaroqDjsfKGNI9OG","livemode": false,"metadata": {},"object": "line_item",@@ -318,16 +318,16 @@"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1698927319,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000001",+ "id": "price_1O7znvDEQaroqDjsLJjqNJy0","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0001",+ "product": "prod_OvY3rmiwsD4vFL","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -355,29 +355,29 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000002",- "invoice_item": "ii_NORMALIZED00000000000002",+ "id": "il_1OEyxzDEQaroqDjsnpgOAqxP",+ "invoice_item": "ii_1OEyxyDEQaroqDjshhkuKTu6","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1700592394,+ "start": 1700592394},"plan": null,"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1699463487,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000002",+ "id": "price_1OAFHnDEQaroqDjsGPnkI1Z2","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0002",+ "product": "prod_OvY3hKgN66WIeP","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -401,11 +401,11 @@"has_more": false,"object": "list","total_count": 2,- "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"+ "url": "/v1/invoices/in_1OEyxzDEQaroqDjs8WQvU4Yx/lines"},"livemode": false,"metadata": {},- "next_payment_attempt": 1000000000,+ "next_payment_attempt": 1700595995,"number": null,"object": "invoice","on_behalf_of": null,@@ -417,8 +417,8 @@"payment_method_options": null,"payment_method_types": null},- "period_end": 1000000000,- "period_start": 1000000000,+ "period_end": 1700592395,+ "period_start": 1700592395,"post_payment_credit_notes_amount": 0,"pre_payment_credit_notes_amount": 0,"quote": null,@@ -457,29 +457,29 @@"webhooks_delivered_at": null}},- "id": "evt_1ODZZtDEQaroqDjsCcpqigFQ",+ "id": "evt_1OEyy0DEQaroqDjsyIGDCqNn","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0004",- "idempotency_key": "05fb7cbb-a571-4df7-b190-4672063ca7b6"+ "id": "req_XdqWswrVDfmvvL",+ "idempotency_key": "747016d1-31af-4e95-95b0-da2fd7c1ccc9"},"type": "invoice.created"},{"api_version": "2020-08-27",- "created": 1000000000,+ "created": 1700592395,"data": {"object": {"amount": 48000,"currency": "usd",- "customer": "cus_NORMALIZED0001",- "date": 1000000000,+ "customer": "cus_P358SWUcASaSWt",+ "date": 1700592395,"description": "Zulip Cloud Standard","discountable": false,"discounts": [],- "id": "ii_NORMALIZED00000000000001",+ "id": "ii_1OEyxzDEQaroqDjsfKGNI9OG","invoice": null,"livemode": false,"metadata": {},@@ -492,16 +492,16 @@"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1698927319,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000001",+ "id": "price_1O7znvDEQaroqDjsLJjqNJy0","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0001",+ "product": "prod_OvY3rmiwsD4vFL","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -519,51 +519,51 @@"unit_amount_decimal": "8000"}},- "id": "evt_1ODZZtDEQaroqDjsZQOJANoB",+ "id": "evt_1OEyxzDEQaroqDjsZxENPeBG","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0005",- "idempotency_key": "a9c93b6f-4e3b-4d48-a294-5db7a4862314"+ "id": "req_NshHwCxEbLHY8n",+ "idempotency_key": "d2751e2e-89df-416a-b517-2afa2ef13606"},"type": "invoiceitem.created"},{"api_version": "2020-08-27",- "created": 1000000000,+ "created": 1700592394,"data": {"object": {"amount": -48000,"currency": "usd",- "customer": "cus_NORMALIZED0001",- "date": 1000000000,+ "customer": "cus_P358SWUcASaSWt",+ "date": 1700592394,"description": "Payment (Card ending in 4242)","discountable": false,"discounts": [],- "id": "ii_NORMALIZED00000000000002",+ "id": "ii_1OEyxyDEQaroqDjshhkuKTu6","invoice": null,"livemode": false,"metadata": {},"object": "invoiceitem","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1700592394,+ "start": 1700592394},"plan": null,"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1699463487,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000002",+ "id": "price_1OAFHnDEQaroqDjsGPnkI1Z2","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0002",+ "product": "prod_OvY3hKgN66WIeP","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -581,24 +581,24 @@"unit_amount_decimal": "-48000"}},- "id": "evt_1ODZZsDEQaroqDjsJrkRWseb",+ "id": "evt_1OEyxzDEQaroqDjsyo6Adi64","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0006",- "idempotency_key": "4185dcc0-01b0-4ac1-a57a-822587d5fca4"+ "id": "req_Z0Vml3S8JTs8MF",+ "idempotency_key": "f4f3d7ab-52a0-4d2a-b508-075b18e627f6"},"type": "invoiceitem.created"},{"api_version": "2020-08-27",- "created": 1000000000,+ "created": 1700592394,"data": {"object": {"address": null,"balance": 0,- "created": 1000000000,+ "created": 1700592386,"currency": "usd","default_currency": "usd","default_source": null,@@ -606,17 +606,17 @@"description": "zulip (Zulip Dev)","discount": null,"email": "[email protected]",- "id": "cus_NORMALIZED0001",- "invoice_prefix": "NORMA01",+ "id": "cus_P358SWUcASaSWt",+ "invoice_prefix": "69DA5EF9","invoice_settings": {"custom_fields": null,- "default_payment_method": "pm_1ODZZnDEQaroqDjsRI67eH96",+ "default_payment_method": "pm_1OEyxsDEQaroqDjsklOoFXrh","footer": null,"rendering_options": null},"livemode": false,"metadata": {- "realm_id": "1",+ "realm_id": "2","realm_str": "zulip"},"name": null,@@ -633,13 +633,13 @@"default_currency": null}},- "id": "evt_1ODZZsDEQaroqDjsa3nbkynM",+ "id": "evt_1OEyxzDEQaroqDjs2PH94nIl","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0006",- "idempotency_key": "4185dcc0-01b0-4ac1-a57a-822587d5fca4"+ "id": "req_Z0Vml3S8JTs8MF",+ "idempotency_key": "f4f3d7ab-52a0-4d2a-b508-075b18e627f6"},"type": "customer.updated"}diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Event.list.4.json b/corporate/tests/stripe_fixtures/replace_payment_method--Event.list.4.jsonindex c936922ba6c..1938dc1d848 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Event.list.4.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Event.list.4.json@@ -2,7 +2,7 @@"data": [{"api_version": "2020-08-27",- "created": 1000000000,+ "created": 1700592396,"data": {"object": {"account_country": "US",@@ -24,10 +24,10 @@"billing_reason": "manual","charge": null,"collection_method": "charge_automatically",- "created": 1000000000,+ "created": 1700592395,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","customer_address": null,"customer_email": "[email protected]","customer_name": null,@@ -42,13 +42,13 @@"discount": null,"discounts": [],"due_date": null,- "effective_at": 1000000000,+ "effective_at": 1700592396,"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwMUEzTlFvcUFMcFNORXd4SG4xdUQ1S1FrV25JLDkwNzk3Mjc00200psXrWwm4?s=ap",- "id": "in_NORMALIZED00000000000001",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwMUEzTlFvcUFMcFNORXd4SG4xdUQ1S1FrV25JLDkwNzk3Mjc00200psXrWwm4/pdf?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4R1VMUFVPaXhKTng0ZUpuZEVSQ0g4RzdHcDJtLDkxMTMzMTk30200dh8EhJJw?s=ap",+ "id": "in_1OEyxzDEQaroqDjs8WQvU4Yx",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4R1VMUFVPaXhKTng0ZUpuZEVSQ0g4RzdHcDJtLDkxMTMzMTk30200dh8EhJJw/pdf?s=ap","last_finalization_error": null,"latest_revision": null,"lines": {@@ -61,8 +61,8 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000001",- "invoice_item": "ii_NORMALIZED00000000000001",+ "id": "il_1OEyxzDEQaroqDjsAOwkMlcc",+ "invoice_item": "ii_1OEyxzDEQaroqDjsfKGNI9OG","livemode": false,"metadata": {},"object": "line_item",@@ -74,16 +74,16 @@"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1698927319,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000001",+ "id": "price_1O7znvDEQaroqDjsLJjqNJy0","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0001",+ "product": "prod_OvY3rmiwsD4vFL","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -111,29 +111,29 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000002",- "invoice_item": "ii_NORMALIZED00000000000002",+ "id": "il_1OEyxzDEQaroqDjsnpgOAqxP",+ "invoice_item": "ii_1OEyxyDEQaroqDjshhkuKTu6","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1700592394,+ "start": 1700592394},"plan": null,"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1699463487,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000002",+ "id": "price_1OAFHnDEQaroqDjsGPnkI1Z2","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0002",+ "product": "prod_OvY3hKgN66WIeP","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -157,12 +157,12 @@"has_more": false,"object": "list","total_count": 2,- "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"+ "url": "/v1/invoices/in_1OEyxzDEQaroqDjs8WQvU4Yx/lines"},"livemode": false,"metadata": {},"next_payment_attempt": null,- "number": "NORMALI-0002",+ "number": "69DA5EF9-0001","object": "invoice","on_behalf_of": null,"paid": true,@@ -173,8 +173,8 @@"payment_method_options": null,"payment_method_types": null},- "period_end": 1000000000,- "period_start": 1000000000,+ "period_end": 1700592395,+ "period_start": 1700592395,"post_payment_credit_notes_amount": 0,"pre_payment_credit_notes_amount": 0,"quote": null,@@ -192,9 +192,9 @@"statement_descriptor": "Zulip Cloud Standard","status": "paid","status_transitions": {- "finalized_at": 1000000000,+ "finalized_at": 1700592396,"marked_uncollectible_at": null,- "paid_at": 1000000000,+ "paid_at": 1700592396,"voided_at": null},"subscription": null,@@ -213,13 +213,236 @@"webhooks_delivered_at": null}},- "id": "evt_1ODZZuDEQaroqDjsOAeWDgcU",+ "id": "evt_1OEyy1DEQaroqDjsQ6IET8RC",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 2,+ "request": {+ "id": "req_XE7G6X9LMuefmb",+ "idempotency_key": "84fb4129-644a-4e2e-b906-f517d374a06f"+ },+ "type": "invoice.paid"+ },+ {+ "api_version": "2020-08-27",+ "created": 1700592396,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 0,+ "amount_paid": 0,+ "amount_remaining": 0,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": true,+ "auto_advance": false,+ "automatic_tax": {+ "enabled": false,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "charge_automatically",+ "created": 1700592395,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_P358SWUcASaSWt",+ "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": null,+ "effective_at": 1700592396,+ "ending_balance": 0,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4R1VMUFVPaXhKTng0ZUpuZEVSQ0g4RzdHcDJtLDkxMTMzMTk20200HCWA2HsQ?s=ap",+ "id": "in_1OEyxzDEQaroqDjs8WQvU4Yx",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4R1VMUFVPaXhKTng0ZUpuZEVSQ0g4RzdHcDJtLDkxMTMzMTk20200HCWA2HsQ/pdf?s=ap",+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 48000,+ "amount_excluding_tax": 48000,+ "currency": "usd",+ "description": "Zulip Cloud Standard",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_1OEyxzDEQaroqDjsAOwkMlcc",+ "invoice_item": "ii_1OEyxzDEQaroqDjsfKGNI9OG",+ "livemode": false,+ "metadata": {},+ "object": "line_item",+ "period": {+ "end": 1357095845,+ "start": 1325473445+ },+ "plan": null,+ "price": {+ "active": false,+ "billing_scheme": "per_unit",+ "created": 1698927319,+ "currency": "usd",+ "custom_unit_amount": null,+ "id": "price_1O7znvDEQaroqDjsLJjqNJy0",+ "livemode": false,+ "lookup_key": null,+ "metadata": {},+ "nickname": null,+ "object": "price",+ "product": "prod_OvY3rmiwsD4vFL",+ "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": 6,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "8000"+ },+ {+ "amount": -48000,+ "amount_excluding_tax": -48000,+ "currency": "usd",+ "description": "Payment (Card ending in 4242)",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_1OEyxzDEQaroqDjsnpgOAqxP",+ "invoice_item": "ii_1OEyxyDEQaroqDjshhkuKTu6",+ "livemode": false,+ "metadata": {},+ "object": "line_item",+ "period": {+ "end": 1700592394,+ "start": 1700592394+ },+ "plan": null,+ "price": {+ "active": false,+ "billing_scheme": "per_unit",+ "created": 1699463487,+ "currency": "usd",+ "custom_unit_amount": null,+ "id": "price_1OAFHnDEQaroqDjsGPnkI1Z2",+ "livemode": false,+ "lookup_key": null,+ "metadata": {},+ "nickname": null,+ "object": "price",+ "product": "prod_OvY3hKgN66WIeP",+ "recurring": null,+ "tax_behavior": "unspecified",+ "tiers_mode": null,+ "transform_quantity": null,+ "type": "one_time",+ "unit_amount": -48000,+ "unit_amount_decimal": "-48000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 1,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "-48000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 2,+ "url": "/v1/invoices/in_1OEyxzDEQaroqDjs8WQvU4Yx/lines"+ },+ "livemode": false,+ "metadata": {},+ "next_payment_attempt": null,+ "number": "69DA5EF9-0001",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": true,+ "paid_out_of_band": false,+ "payment_intent": null,+ "payment_settings": {+ "default_mandate": null,+ "payment_method_options": null,+ "payment_method_types": null+ },+ "period_end": 1700592395,+ "period_start": 1700592395,+ "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": 1700592396,+ "marked_uncollectible_at": null,+ "paid_at": 1700592396,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 0,+ "subtotal_excluding_tax": 0,+ "tax": null,+ "test_clock": null,+ "total": 0,+ "total_discount_amounts": [],+ "total_excluding_tax": 0,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": null+ }+ },+ "id": "evt_1OEyy1DEQaroqDjsjXQmVPw1","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0003",- "idempotency_key": "7f25f52e-840e-4ba2-bcbb-a77b7c938f5f"+ "id": "req_XE7G6X9LMuefmb",+ "idempotency_key": "84fb4129-644a-4e2e-b906-f517d374a06f"},"type": "invoice.finalized"}diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Event.list.5.json b/corporate/tests/stripe_fixtures/replace_payment_method--Event.list.5.jsonindex 88cb6fdb357..77d9b9c8822 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Event.list.5.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Event.list.5.json@@ -2,7 +2,7 @@"data": [{"api_version": "2020-08-27",- "created": 1000000000,+ "created": 1700592396,"data": {"object": {"account_country": "US",@@ -24,10 +24,10 @@"billing_reason": "manual","charge": null,"collection_method": "charge_automatically",- "created": 1000000000,+ "created": 1700592395,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","customer_address": null,"customer_email": "[email protected]","customer_name": null,@@ -42,13 +42,13 @@"discount": null,"discounts": [],"due_date": null,- "effective_at": 1000000000,+ "effective_at": 1700592396,"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwMUEzTlFvcUFMcFNORXd4SG4xdUQ1S1FrV25JLDkwNzk3Mjc10200x8KYxSbH?s=ap",- "id": "in_NORMALIZED00000000000001",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwMUEzTlFvcUFMcFNORXd4SG4xdUQ1S1FrV25JLDkwNzk3Mjc10200x8KYxSbH/pdf?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4R1VMUFVPaXhKTng0ZUpuZEVSQ0g4RzdHcDJtLDkxMTMzMTk30200dh8EhJJw?s=ap",+ "id": "in_1OEyxzDEQaroqDjs8WQvU4Yx",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4R1VMUFVPaXhKTng0ZUpuZEVSQ0g4RzdHcDJtLDkxMTMzMTk30200dh8EhJJw/pdf?s=ap","last_finalization_error": null,"latest_revision": null,"lines": {@@ -61,8 +61,8 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000001",- "invoice_item": "ii_NORMALIZED00000000000001",+ "id": "il_1OEyxzDEQaroqDjsAOwkMlcc",+ "invoice_item": "ii_1OEyxzDEQaroqDjsfKGNI9OG","livemode": false,"metadata": {},"object": "line_item",@@ -74,16 +74,16 @@"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1698927319,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000001",+ "id": "price_1O7znvDEQaroqDjsLJjqNJy0","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0001",+ "product": "prod_OvY3rmiwsD4vFL","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -111,29 +111,29 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000002",- "invoice_item": "ii_NORMALIZED00000000000002",+ "id": "il_1OEyxzDEQaroqDjsnpgOAqxP",+ "invoice_item": "ii_1OEyxyDEQaroqDjshhkuKTu6","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1700592394,+ "start": 1700592394},"plan": null,"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1699463487,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000002",+ "id": "price_1OAFHnDEQaroqDjsGPnkI1Z2","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0002",+ "product": "prod_OvY3hKgN66WIeP","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -157,12 +157,12 @@"has_more": false,"object": "list","total_count": 2,- "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"+ "url": "/v1/invoices/in_1OEyxzDEQaroqDjs8WQvU4Yx/lines"},"livemode": false,"metadata": {},"next_payment_attempt": null,- "number": "NORMALI-0002",+ "number": "69DA5EF9-0001","object": "invoice","on_behalf_of": null,"paid": true,@@ -173,8 +173,8 @@"payment_method_options": null,"payment_method_types": null},- "period_end": 1000000000,- "period_start": 1000000000,+ "period_end": 1700592395,+ "period_start": 1700592395,"post_payment_credit_notes_amount": 0,"pre_payment_credit_notes_amount": 0,"quote": null,@@ -192,9 +192,9 @@"statement_descriptor": "Zulip Cloud Standard","status": "paid","status_transitions": {- "finalized_at": 1000000000,+ "finalized_at": 1700592396,"marked_uncollectible_at": null,- "paid_at": 1000000000,+ "paid_at": 1700592396,"voided_at": null},"subscription": null,@@ -213,238 +213,15 @@"webhooks_delivered_at": null}},- "id": "evt_1ODZZvDEQaroqDjsJhNNsOzG",+ "id": "evt_1OEyy1DEQaroqDjsrPbsOxso","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0003",- "idempotency_key": "7f25f52e-840e-4ba2-bcbb-a77b7c938f5f"+ "id": "req_XE7G6X9LMuefmb",+ "idempotency_key": "84fb4129-644a-4e2e-b906-f517d374a06f"},"type": "invoice.payment_succeeded"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "account_country": "US",- "account_name": "Kandra Labs, Inc.",- "account_tax_ids": null,- "amount_due": 0,- "amount_paid": 0,- "amount_remaining": 0,- "amount_shipping": 0,- "application": null,- "application_fee_amount": null,- "attempt_count": 0,- "attempted": true,- "auto_advance": false,- "automatic_tax": {- "enabled": false,- "status": null- },- "billing_reason": "manual",- "charge": null,- "collection_method": "charge_automatically",- "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": null,- "effective_at": 1000000000,- "ending_balance": 0,- "footer": null,- "from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwMUEzTlFvcUFMcFNORXd4SG4xdUQ1S1FrV25JLDkwNzk3Mjc10200x8KYxSbH?s=ap",- "id": "in_NORMALIZED00000000000001",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwMUEzTlFvcUFMcFNORXd4SG4xdUQ1S1FrV25JLDkwNzk3Mjc10200x8KYxSbH/pdf?s=ap",- "last_finalization_error": null,- "latest_revision": null,- "lines": {- "data": [- {- "amount": 48000,- "amount_excluding_tax": 48000,- "currency": "usd",- "description": "Zulip Cloud Standard",- "discount_amounts": [],- "discountable": false,- "discounts": [],- "id": "il_NORMALIZED00000000000001",- "invoice_item": "ii_NORMALIZED00000000000001",- "livemode": false,- "metadata": {},- "object": "line_item",- "period": {- "end": 1357095845,- "start": 1325473445- },- "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": 6,- "subscription": null,- "tax_amounts": [],- "tax_rates": [],- "type": "invoiceitem",- "unit_amount_excluding_tax": "8000"- },- {- "amount": -48000,- "amount_excluding_tax": -48000,- "currency": "usd",- "description": "Payment (Card ending in 4242)",- "discount_amounts": [],- "discountable": false,- "discounts": [],- "id": "il_NORMALIZED00000000000002",- "invoice_item": "ii_NORMALIZED00000000000002",- "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_NORMALIZED00000000000002",- "livemode": false,- "lookup_key": null,- "metadata": {},- "nickname": null,- "object": "price",- "product": "prod_NORMALIZED0002",- "recurring": null,- "tax_behavior": "unspecified",- "tiers_mode": null,- "transform_quantity": null,- "type": "one_time",- "unit_amount": -48000,- "unit_amount_decimal": "-48000"- },- "proration": false,- "proration_details": {- "credited_items": null- },- "quantity": 1,- "subscription": null,- "tax_amounts": [],- "tax_rates": [],- "type": "invoiceitem",- "unit_amount_excluding_tax": "-48000"- }- ],- "has_more": false,- "object": "list",- "total_count": 2,- "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"- },- "livemode": false,- "metadata": {},- "next_payment_attempt": null,- "number": "NORMALI-0002",- "object": "invoice",- "on_behalf_of": null,- "paid": true,- "paid_out_of_band": false,- "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": 0,- "subtotal_excluding_tax": 0,- "tax": null,- "test_clock": null,- "total": 0,- "total_discount_amounts": [],- "total_excluding_tax": 0,- "total_tax_amounts": [],- "transfer_data": null,- "webhooks_delivered_at": null- }- },- "id": "evt_1ODZZvDEQaroqDjssM9izls4",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0003",- "idempotency_key": "7f25f52e-840e-4ba2-bcbb-a77b7c938f5f"- },- "type": "invoice.paid"}],"has_more": false,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.create.1.json b/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.create.1.jsonindex ee4c6393e41..4c3462bf10f 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.create.1.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.create.1.json@@ -18,10 +18,10 @@"billing_reason": "manual","charge": null,"collection_method": "charge_automatically",- "created": 1000000000,+ "created": 1700592395,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","customer_address": null,"customer_email": "[email protected]","customer_name": null,@@ -41,7 +41,7 @@"footer": null,"from_invoice": null,"hosted_invoice_url": null,- "id": "in_NORMALIZED00000000000001",+ "id": "in_1OEyxzDEQaroqDjs8WQvU4Yx","invoice_pdf": null,"last_finalization_error": null,"latest_revision": null,@@ -55,8 +55,8 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000001",- "invoice_item": "ii_NORMALIZED00000000000001",+ "id": "il_1OEyxzDEQaroqDjsAOwkMlcc",+ "invoice_item": "ii_1OEyxzDEQaroqDjsfKGNI9OG","livemode": false,"metadata": {},"object": "line_item",@@ -68,16 +68,16 @@"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1698927319,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000001",+ "id": "price_1O7znvDEQaroqDjsLJjqNJy0","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0001",+ "product": "prod_OvY3rmiwsD4vFL","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -105,29 +105,29 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000002",- "invoice_item": "ii_NORMALIZED00000000000002",+ "id": "il_1OEyxzDEQaroqDjsnpgOAqxP",+ "invoice_item": "ii_1OEyxyDEQaroqDjshhkuKTu6","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1700592394,+ "start": 1700592394},"plan": null,"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1699463487,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000002",+ "id": "price_1OAFHnDEQaroqDjsGPnkI1Z2","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0002",+ "product": "prod_OvY3hKgN66WIeP","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -151,11 +151,11 @@"has_more": false,"object": "list","total_count": 2,- "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"+ "url": "/v1/invoices/in_1OEyxzDEQaroqDjs8WQvU4Yx/lines"},"livemode": false,"metadata": {},- "next_payment_attempt": 1000000000,+ "next_payment_attempt": 1700595995,"number": null,"object": "invoice","on_behalf_of": null,@@ -167,8 +167,8 @@"payment_method_options": null,"payment_method_types": null},- "period_end": 1000000000,- "period_start": 1000000000,+ "period_end": 1700592395,+ "period_start": 1700592395,"post_payment_credit_notes_amount": 0,"pre_payment_credit_notes_amount": 0,"quote": null,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.create.2.json b/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.create.2.jsonindex e427e4982c5..badfda7788e 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.create.2.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.create.2.json@@ -18,10 +18,10 @@"billing_reason": "manual","charge": null,"collection_method": "charge_automatically",- "created": 1000000000,+ "created": 1700592398,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","customer_address": null,"customer_email": "[email protected]","customer_name": null,@@ -41,7 +41,7 @@"footer": null,"from_invoice": null,"hosted_invoice_url": null,- "id": "in_NORMALIZED00000000000002",+ "id": "in_1OEyy2DEQaroqDjsuRPt2KXA","invoice_pdf": null,"last_finalization_error": null,"latest_revision": null,@@ -55,29 +55,29 @@"discount_amounts": [],"discountable": true,"discounts": [],- "id": "il_NORMALIZED00000000000003",- "invoice_item": "ii_NORMALIZED00000000000003",+ "id": "il_1OEyy2DEQaroqDjscjyiZWKB",+ "invoice_item": "ii_1OEyy2DEQaroqDjsUHAJkp45","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1700592398,+ "start": 1700592398},"plan": null,"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1700592398,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000003",+ "id": "price_1OEyy2DEQaroqDjsClpqf6Qb","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0003",+ "product": "prod_P358e9e33CbWxt","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -101,7 +101,7 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"+ "url": "/v1/invoices/in_1OEyy2DEQaroqDjsuRPt2KXA/lines"},"livemode": false,"metadata": {},@@ -117,8 +117,8 @@"payment_method_options": null,"payment_method_types": null},- "period_end": 1000000000,- "period_start": 1000000000,+ "period_end": 1700592398,+ "period_start": 1700592398,"post_payment_credit_notes_amount": 0,"pre_payment_credit_notes_amount": 0,"quote": null,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.finalize_invoice.1.json b/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.finalize_invoice.1.jsonindex 0c0787e4dcf..dc6a2d5bf33 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.finalize_invoice.1.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.finalize_invoice.1.json@@ -18,10 +18,10 @@"billing_reason": "manual","charge": null,"collection_method": "charge_automatically",- "created": 1000000000,+ "created": 1700592395,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","customer_address": null,"customer_email": "[email protected]","customer_name": null,@@ -36,13 +36,13 @@"discount": null,"discounts": [],"due_date": null,- "effective_at": 1000000000,+ "effective_at": 1700592396,"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwMUEzTlFvcUFMcFNORXd4SG4xdUQ1S1FrV25JLDkwNzk3Mjc00200psXrWwm4?s=ap",- "id": "in_NORMALIZED00000000000001",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwMUEzTlFvcUFMcFNORXd4SG4xdUQ1S1FrV25JLDkwNzk3Mjc00200psXrWwm4/pdf?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4R1VMUFVPaXhKTng0ZUpuZEVSQ0g4RzdHcDJtLDkxMTMzMTk20200HCWA2HsQ?s=ap",+ "id": "in_1OEyxzDEQaroqDjs8WQvU4Yx",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4R1VMUFVPaXhKTng0ZUpuZEVSQ0g4RzdHcDJtLDkxMTMzMTk20200HCWA2HsQ/pdf?s=ap","last_finalization_error": null,"latest_revision": null,"lines": {@@ -55,8 +55,8 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000001",- "invoice_item": "ii_NORMALIZED00000000000001",+ "id": "il_1OEyxzDEQaroqDjsAOwkMlcc",+ "invoice_item": "ii_1OEyxzDEQaroqDjsfKGNI9OG","livemode": false,"metadata": {},"object": "line_item",@@ -68,16 +68,16 @@"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1698927319,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000001",+ "id": "price_1O7znvDEQaroqDjsLJjqNJy0","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0001",+ "product": "prod_OvY3rmiwsD4vFL","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -105,29 +105,29 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000002",- "invoice_item": "ii_NORMALIZED00000000000002",+ "id": "il_1OEyxzDEQaroqDjsnpgOAqxP",+ "invoice_item": "ii_1OEyxyDEQaroqDjshhkuKTu6","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1700592394,+ "start": 1700592394},"plan": null,"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1699463487,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000002",+ "id": "price_1OAFHnDEQaroqDjsGPnkI1Z2","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0002",+ "product": "prod_OvY3hKgN66WIeP","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -151,12 +151,12 @@"has_more": false,"object": "list","total_count": 2,- "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"+ "url": "/v1/invoices/in_1OEyxzDEQaroqDjs8WQvU4Yx/lines"},"livemode": false,"metadata": {},"next_payment_attempt": null,- "number": "NORMALI-0002",+ "number": "69DA5EF9-0001","object": "invoice","on_behalf_of": null,"paid": true,@@ -167,8 +167,8 @@"payment_method_options": null,"payment_method_types": null},- "period_end": 1000000000,- "period_start": 1000000000,+ "period_end": 1700592395,+ "period_start": 1700592395,"post_payment_credit_notes_amount": 0,"pre_payment_credit_notes_amount": 0,"quote": null,@@ -186,9 +186,9 @@"statement_descriptor": "Zulip Cloud Standard","status": "paid","status_transitions": {- "finalized_at": 1000000000,+ "finalized_at": 1700592396,"marked_uncollectible_at": null,- "paid_at": 1000000000,+ "paid_at": 1700592396,"voided_at": null},"subscription": null,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.finalize_invoice.2.json b/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.finalize_invoice.2.jsonindex 69718403fdd..4ff9e584db4 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.finalize_invoice.2.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.finalize_invoice.2.json@@ -18,10 +18,10 @@"billing_reason": "manual","charge": null,"collection_method": "charge_automatically",- "created": 1000000000,+ "created": 1700592398,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","customer_address": null,"customer_email": "[email protected]","customer_name": null,@@ -36,13 +36,13 @@"discount": null,"discounts": [],"due_date": null,- "effective_at": 1000000000,+ "effective_at": 1700592399,"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwQVEyWFJ3QjAxRXR4TkQ5ZmszYjV1ZDFTQ0dVLDkwNzk3Mjc30200mcYix1WU?s=ap",- "id": "in_NORMALIZED00000000000002",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwQVEyWFJ3QjAxRXR4TkQ5ZmszYjV1ZDFTQ0dVLDkwNzk3Mjc30200mcYix1WU/pdf?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4RWRPU3dqOTdjZThINlpWTXpFSjNvOGdIWUlYLDkxMTMzMTk502008AAD9DfD?s=ap",+ "id": "in_1OEyy2DEQaroqDjsuRPt2KXA",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4RWRPU3dqOTdjZThINlpWTXpFSjNvOGdIWUlYLDkxMTMzMTk502008AAD9DfD/pdf?s=ap","last_finalization_error": null,"latest_revision": null,"lines": {@@ -55,29 +55,29 @@"discount_amounts": [],"discountable": true,"discounts": [],- "id": "il_NORMALIZED00000000000003",- "invoice_item": "ii_NORMALIZED00000000000003",+ "id": "il_1OEyy2DEQaroqDjscjyiZWKB",+ "invoice_item": "ii_1OEyy2DEQaroqDjsUHAJkp45","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1700592398,+ "start": 1700592398},"plan": null,"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1700592398,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000003",+ "id": "price_1OEyy2DEQaroqDjsClpqf6Qb","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0003",+ "product": "prod_P358e9e33CbWxt","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -101,24 +101,24 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"+ "url": "/v1/invoices/in_1OEyy2DEQaroqDjsuRPt2KXA/lines"},"livemode": false,"metadata": {},"next_payment_attempt": null,- "number": "NORMALI-0003",+ "number": "69DA5EF9-0002","object": "invoice","on_behalf_of": null,"paid": false,"paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000002",+ "payment_intent": "pi_3OEyy3DEQaroqDjs14vaghr0","payment_settings": {"default_mandate": null,"payment_method_options": null,"payment_method_types": null},- "period_end": 1000000000,- "period_start": 1000000000,+ "period_end": 1700592398,+ "period_start": 1700592398,"post_payment_credit_notes_amount": 0,"pre_payment_credit_notes_amount": 0,"quote": null,@@ -136,7 +136,7 @@"statement_descriptor": null,"status": "open","status_transitions": {- "finalized_at": 1000000000,+ "finalized_at": 1700592399,"marked_uncollectible_at": null,"paid_at": null,"voided_at": nulldiff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.list.2.json b/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.list.2.jsonindex e40b84b037c..757a52e7fcc 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.list.2.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.list.2.json@@ -20,10 +20,10 @@"billing_reason": "manual","charge": null,"collection_method": "charge_automatically",- "created": 1000000000,+ "created": 1700592398,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","customer_address": null,"customer_email": "[email protected]","customer_name": null,@@ -38,13 +38,13 @@"discount": null,"discounts": [],"due_date": null,- "effective_at": 1000000000,+ "effective_at": 1700592399,"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwQVEyWFJ3QjAxRXR4TkQ5ZmszYjV1ZDFTQ0dVLDkwNzk3Mjgy0200GC2gzLch?s=ap",- "id": "in_NORMALIZED00000000000002",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwQVEyWFJ3QjAxRXR4TkQ5ZmszYjV1ZDFTQ0dVLDkwNzk3Mjgy0200GC2gzLch/pdf?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4RWRPU3dqOTdjZThINlpWTXpFSjNvOGdIWUlYLDkxMTMzMjA00200GqaFFDck?s=ap",+ "id": "in_1OEyy2DEQaroqDjsuRPt2KXA",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4RWRPU3dqOTdjZThINlpWTXpFSjNvOGdIWUlYLDkxMTMzMjA00200GqaFFDck/pdf?s=ap","last_finalization_error": null,"latest_revision": null,"lines": {@@ -57,29 +57,29 @@"discount_amounts": [],"discountable": true,"discounts": [],- "id": "il_NORMALIZED00000000000003",- "invoice_item": "ii_NORMALIZED00000000000003",+ "id": "il_1OEyy2DEQaroqDjscjyiZWKB",+ "invoice_item": "ii_1OEyy2DEQaroqDjsUHAJkp45","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1700592398,+ "start": 1700592398},"plan": null,"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1700592398,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000003",+ "id": "price_1OEyy2DEQaroqDjsClpqf6Qb","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0003",+ "product": "prod_P358e9e33CbWxt","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -103,24 +103,24 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"+ "url": "/v1/invoices/in_1OEyy2DEQaroqDjsuRPt2KXA/lines"},"livemode": false,"metadata": {},"next_payment_attempt": null,- "number": "NORMALI-0003",+ "number": "69DA5EF9-0002","object": "invoice","on_behalf_of": null,"paid": false,"paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000002",+ "payment_intent": "pi_3OEyy3DEQaroqDjs14vaghr0","payment_settings": {"default_mandate": null,"payment_method_options": null,"payment_method_types": null},- "period_end": 1000000000,- "period_start": 1000000000,+ "period_end": 1700592398,+ "period_start": 1700592398,"post_payment_credit_notes_amount": 0,"pre_payment_credit_notes_amount": 0,"quote": null,@@ -138,7 +138,7 @@"statement_descriptor": null,"status": "open","status_transitions": {- "finalized_at": 1000000000,+ "finalized_at": 1700592399,"marked_uncollectible_at": null,"paid_at": null,"voided_at": null@@ -156,7 +156,7 @@"total_excluding_tax": 5000,"total_tax_amounts": [],"transfer_data": null,- "webhooks_delivered_at": 1000000000+ "webhooks_delivered_at": 1700592399}],"has_more": false,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.list.3.json b/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.list.3.jsonindex 7fc19f97cd8..09d8219af0f 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.list.3.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.list.3.json@@ -18,12 +18,12 @@"status": null},"billing_reason": "manual",- "charge": "ch_NORMALIZED00000000000002",+ "charge": "ch_3OEyy3DEQaroqDjs1gdehahC","collection_method": "charge_automatically",- "created": 1000000000,+ "created": 1700592398,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","customer_address": null,"customer_email": "[email protected]","customer_name": null,@@ -38,13 +38,13 @@"discount": null,"discounts": [],"due_date": null,- "effective_at": 1000000000,+ "effective_at": 1700592399,"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwQVEyWFJ3QjAxRXR4TkQ5ZmszYjV1ZDFTQ0dVLDkwNzk3Mjg40200jy8bWDiB?s=ap",- "id": "in_NORMALIZED00000000000002",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwQVEyWFJ3QjAxRXR4TkQ5ZmszYjV1ZDFTQ0dVLDkwNzk3Mjg40200jy8bWDiB/pdf?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4RWRPU3dqOTdjZThINlpWTXpFSjNvOGdIWUlYLDkxMTMzMjEx0200o6xVlgjn?s=ap",+ "id": "in_1OEyy2DEQaroqDjsuRPt2KXA",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4RWRPU3dqOTdjZThINlpWTXpFSjNvOGdIWUlYLDkxMTMzMjEx0200o6xVlgjn/pdf?s=ap","last_finalization_error": null,"latest_revision": null,"lines": {@@ -57,29 +57,29 @@"discount_amounts": [],"discountable": true,"discounts": [],- "id": "il_NORMALIZED00000000000003",- "invoice_item": "ii_NORMALIZED00000000000003",+ "id": "il_1OEyy2DEQaroqDjscjyiZWKB",+ "invoice_item": "ii_1OEyy2DEQaroqDjsUHAJkp45","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1700592398,+ "start": 1700592398},"plan": null,"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1700592398,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000003",+ "id": "price_1OEyy2DEQaroqDjsClpqf6Qb","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0003",+ "product": "prod_P358e9e33CbWxt","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -103,24 +103,24 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"+ "url": "/v1/invoices/in_1OEyy2DEQaroqDjsuRPt2KXA/lines"},"livemode": false,"metadata": {},"next_payment_attempt": null,- "number": "NORMALI-0003",+ "number": "69DA5EF9-0002","object": "invoice","on_behalf_of": null,"paid": false,"paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000002",+ "payment_intent": "pi_3OEyy3DEQaroqDjs14vaghr0","payment_settings": {"default_mandate": null,"payment_method_options": null,"payment_method_types": null},- "period_end": 1000000000,- "period_start": 1000000000,+ "period_end": 1700592398,+ "period_start": 1700592398,"post_payment_credit_notes_amount": 0,"pre_payment_credit_notes_amount": 0,"quote": null,@@ -138,7 +138,7 @@"statement_descriptor": null,"status": "open","status_transitions": {- "finalized_at": 1000000000,+ "finalized_at": 1700592399,"marked_uncollectible_at": null,"paid_at": null,"voided_at": null@@ -156,7 +156,7 @@"total_excluding_tax": 5000,"total_tax_amounts": [],"transfer_data": null,- "webhooks_delivered_at": 1000000000+ "webhooks_delivered_at": 1700592399}],"has_more": false,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.list.4.json b/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.list.4.jsonindex a0fa40b6547..cfb08d6f4c3 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.list.4.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.list.4.json@@ -18,12 +18,12 @@"status": null},"billing_reason": "manual",- "charge": "ch_NORMALIZED00000000000003",+ "charge": "ch_3OEyy3DEQaroqDjs1TeJdg1S","collection_method": "charge_automatically",- "created": 1000000000,+ "created": 1700592398,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","customer_address": null,"customer_email": "[email protected]","customer_name": null,@@ -38,13 +38,13 @@"discount": null,"discounts": [],"due_date": null,- "effective_at": 1000000000,+ "effective_at": 1700592399,"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwQVEyWFJ3QjAxRXR4TkQ5ZmszYjV1ZDFTQ0dVLDkwNzk3Mjkx0200iY4cuQIg?s=ap",- "id": "in_NORMALIZED00000000000002",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwQVEyWFJ3QjAxRXR4TkQ5ZmszYjV1ZDFTQ0dVLDkwNzk3Mjkx0200iY4cuQIg/pdf?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4RWRPU3dqOTdjZThINlpWTXpFSjNvOGdIWUlYLDkxMTMzMjE002004IpMVErI?s=ap",+ "id": "in_1OEyy2DEQaroqDjsuRPt2KXA",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4RWRPU3dqOTdjZThINlpWTXpFSjNvOGdIWUlYLDkxMTMzMjE002004IpMVErI/pdf?s=ap","last_finalization_error": null,"latest_revision": null,"lines": {@@ -57,29 +57,29 @@"discount_amounts": [],"discountable": true,"discounts": [],- "id": "il_NORMALIZED00000000000003",- "invoice_item": "ii_NORMALIZED00000000000003",+ "id": "il_1OEyy2DEQaroqDjscjyiZWKB",+ "invoice_item": "ii_1OEyy2DEQaroqDjsUHAJkp45","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1700592398,+ "start": 1700592398},"plan": null,"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1700592398,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000003",+ "id": "price_1OEyy2DEQaroqDjsClpqf6Qb","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0003",+ "product": "prod_P358e9e33CbWxt","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -103,24 +103,24 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"+ "url": "/v1/invoices/in_1OEyy2DEQaroqDjsuRPt2KXA/lines"},"livemode": false,"metadata": {},"next_payment_attempt": null,- "number": "NORMALI-0003",+ "number": "69DA5EF9-0002","object": "invoice","on_behalf_of": null,"paid": true,"paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000002",+ "payment_intent": "pi_3OEyy3DEQaroqDjs14vaghr0","payment_settings": {"default_mandate": null,"payment_method_options": null,"payment_method_types": null},- "period_end": 1000000000,- "period_start": 1000000000,+ "period_end": 1700592398,+ "period_start": 1700592398,"post_payment_credit_notes_amount": 0,"pre_payment_credit_notes_amount": 0,"quote": null,@@ -138,9 +138,9 @@"statement_descriptor": null,"status": "paid","status_transitions": {- "finalized_at": 1000000000,+ "finalized_at": 1700592399,"marked_uncollectible_at": null,- "paid_at": 1000000000,+ "paid_at": 1700592411,"voided_at": null},"subscription": null,@@ -156,7 +156,7 @@"total_excluding_tax": 5000,"total_tax_amounts": [],"transfer_data": null,- "webhooks_delivered_at": 1000000000+ "webhooks_delivered_at": 1700592399},{"account_country": "US",@@ -178,10 +178,10 @@"billing_reason": "manual","charge": null,"collection_method": "charge_automatically",- "created": 1000000000,+ "created": 1700592395,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","customer_address": null,"customer_email": "[email protected]","customer_name": null,@@ -196,13 +196,13 @@"discount": null,"discounts": [],"due_date": null,- "effective_at": 1000000000,+ "effective_at": 1700592396,"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwMUEzTlFvcUFMcFNORXd4SG4xdUQ1S1FrV25JLDkwNzk3Mjkx0200CQwzYUzD?s=ap",- "id": "in_NORMALIZED00000000000001",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwMUEzTlFvcUFMcFNORXd4SG4xdUQ1S1FrV25JLDkwNzk3Mjkx0200CQwzYUzD/pdf?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4R1VMUFVPaXhKTng0ZUpuZEVSQ0g4RzdHcDJtLDkxMTMzMjE00200jXB2M3Qt?s=ap",+ "id": "in_1OEyxzDEQaroqDjs8WQvU4Yx",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4R1VMUFVPaXhKTng0ZUpuZEVSQ0g4RzdHcDJtLDkxMTMzMjE00200jXB2M3Qt/pdf?s=ap","last_finalization_error": null,"latest_revision": null,"lines": {@@ -215,8 +215,8 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000001",- "invoice_item": "ii_NORMALIZED00000000000001",+ "id": "il_1OEyxzDEQaroqDjsAOwkMlcc",+ "invoice_item": "ii_1OEyxzDEQaroqDjsfKGNI9OG","livemode": false,"metadata": {},"object": "line_item",@@ -228,16 +228,16 @@"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1698927319,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000001",+ "id": "price_1O7znvDEQaroqDjsLJjqNJy0","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0001",+ "product": "prod_OvY3rmiwsD4vFL","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -265,29 +265,29 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000002",- "invoice_item": "ii_NORMALIZED00000000000002",+ "id": "il_1OEyxzDEQaroqDjsnpgOAqxP",+ "invoice_item": "ii_1OEyxyDEQaroqDjshhkuKTu6","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1700592394,+ "start": 1700592394},"plan": null,"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1699463487,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000002",+ "id": "price_1OAFHnDEQaroqDjsGPnkI1Z2","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0002",+ "product": "prod_OvY3hKgN66WIeP","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -311,12 +311,12 @@"has_more": false,"object": "list","total_count": 2,- "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"+ "url": "/v1/invoices/in_1OEyxzDEQaroqDjs8WQvU4Yx/lines"},"livemode": false,"metadata": {},"next_payment_attempt": null,- "number": "NORMALI-0002",+ "number": "69DA5EF9-0001","object": "invoice","on_behalf_of": null,"paid": true,@@ -327,8 +327,8 @@"payment_method_options": null,"payment_method_types": null},- "period_end": 1000000000,- "period_start": 1000000000,+ "period_end": 1700592395,+ "period_start": 1700592395,"post_payment_credit_notes_amount": 0,"pre_payment_credit_notes_amount": 0,"quote": null,@@ -346,9 +346,9 @@"statement_descriptor": "Zulip Cloud Standard","status": "paid","status_transitions": {- "finalized_at": 1000000000,+ "finalized_at": 1700592396,"marked_uncollectible_at": null,- "paid_at": 1000000000,+ "paid_at": 1700592396,"voided_at": null},"subscription": null,@@ -364,7 +364,7 @@"total_excluding_tax": 0,"total_tax_amounts": [],"transfer_data": null,- "webhooks_delivered_at": 1000000000+ "webhooks_delivered_at": 1700592396}],"has_more": false,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.pay.1.json b/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.pay.1.jsonindex d4ff412889a..2390771cda6 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.pay.1.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--Invoice.pay.1.json@@ -2,7 +2,7 @@"_message": "Your card was declined.","code": "card_declined","error": {- "charge": "ch_NORMALIZED00000000000002",+ "charge": "ch_3OEyy3DEQaroqDjs1gdehahC","code": "card_declined","decline_code": "generic_decline","doc_url": "https://stripe.com/docs/error-codes/card-declined",@@ -46,9 +46,9 @@},"calculated_statement_descriptor": "ZULIP","captured": false,- "created": 1000000000,+ "created": 1700592405,"currency": "usd",- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","description": "Payment for Invoice","destination": null,"dispute": null,@@ -57,8 +57,8 @@"failure_code": "card_declined","failure_message": "Your card was declined.","fraud_details": {},- "id": "ch_NORMALIZED00000000000002",- "invoice": "in_NORMALIZED00000000000002",+ "id": "ch_3OEyy3DEQaroqDjs1gdehahC",+ "invoice": "in_1OEyy2DEQaroqDjsuRPt2KXA","livemode": false,"metadata": {},"object": "charge",@@ -68,13 +68,13 @@"network_status": "declined_by_network","reason": "generic_decline","risk_level": "normal",- "risk_score": 0,+ "risk_score": 9,"seller_message": "The bank did not return any further details with this decline.","type": "issuer_declined"},"paid": false,- "payment_intent": "pi_NORMALIZED00000000000002",- "payment_method": "pm_1ODZa0DEQaroqDjsfkPI8Yxd",+ "payment_intent": "pi_3OEyy3DEQaroqDjs14vaghr0",+ "payment_method": "pm_1OEyy6DEQaroqDjscAhZ1Tzb","payment_method_details": {"card": {"amount_authorized": null,@@ -90,7 +90,7 @@"extended_authorization": {"status": "disabled"},- "fingerprint": "NORMALIZED000002",+ "fingerprint": "ABa2sePBR7Lu711Z","funding": "credit","incremental_authorization": {"status": "unavailable"@@ -133,18 +133,18 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000002"+ "url": "/v1/charges?payment_intent=pi_3OEyy3DEQaroqDjs14vaghr0"},- "client_secret": "pi_NORMALIZED00000000000002_secret_7Eo8FACzzYBdY9W7tuf4iwCHV",+ "client_secret": "pi_3OEyy3DEQaroqDjs14vaghr0_secret_Pe8Xs7XiZqwsv9PNa3CyQVazw","confirmation_method": "automatic",- "created": 1000000000,+ "created": 1700592399,"currency": "usd",- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","description": "Payment for Invoice",- "id": "pi_NORMALIZED00000000000002",- "invoice": "in_NORMALIZED00000000000002",+ "id": "pi_3OEyy3DEQaroqDjs14vaghr0",+ "invoice": "in_1OEyy2DEQaroqDjsuRPt2KXA","last_payment_error": {- "charge": "ch_NORMALIZED00000000000002",+ "charge": "ch_3OEyy3DEQaroqDjs1gdehahC","code": "card_declined","decline_code": "generic_decline","doc_url": "https://stripe.com/docs/error-codes/card-declined",@@ -173,7 +173,7 @@"country": "US","exp_month": 11,"exp_year": 2024,- "fingerprint": "NORMALIZED000002",+ "fingerprint": "ABa2sePBR7Lu711Z","funding": "credit","generated_from": null,"last4": "0341",@@ -188,9 +188,9 @@},"wallet": null},- "created": 1000000000,- "customer": "cus_NORMALIZED0001",- "id": "pm_1ODZa0DEQaroqDjsfkPI8Yxd",+ "created": 1700592402,+ "customer": "cus_P358SWUcASaSWt",+ "id": "pm_1OEyy6DEQaroqDjscAhZ1Tzb","livemode": false,"metadata": {},"object": "payment_method",@@ -198,7 +198,7 @@},"type": "card_error"},- "latest_charge": "ch_NORMALIZED00000000000002",+ "latest_charge": "ch_3OEyy3DEQaroqDjs1gdehahC","livemode": false,"metadata": {},"next_action": null,@@ -255,7 +255,7 @@"country": "US","exp_month": 11,"exp_year": 2024,- "fingerprint": "NORMALIZED000002",+ "fingerprint": "ABa2sePBR7Lu711Z","funding": "credit","generated_from": null,"last4": "0341",@@ -270,15 +270,15 @@},"wallet": null},- "created": 1000000000,- "customer": "cus_NORMALIZED0001",- "id": "pm_1ODZa0DEQaroqDjsfkPI8Yxd",+ "created": 1700592402,+ "customer": "cus_P358SWUcASaSWt",+ "id": "pm_1OEyy6DEQaroqDjscAhZ1Tzb","livemode": false,"metadata": {},"object": "payment_method","type": "card"},- "request_log_url": "https://dashboard.stripe.com/test/logs/req_NORMALIZED0007?t=1700256482",+ "request_log_url": "https://dashboard.stripe.com/test/logs/req_AHmbF72gKDPvqs?t=1700592405","setup_intent": null,"source": null,"type": "card_error"@@ -291,13 +291,13 @@"Access-Control-Max-Age": "300","Cache-Control": "no-cache, no-store","Connection": "keep-alive",- "Content-Length": "9061",+ "Content-Length": "9060","Content-Security-Policy": "report-uri https://q.stripe.com/csp-report?p=v1%2Finvoices%2F%3Ainvoice%2Fpay; 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'","Content-Type": "application/json",- "Date": "NORMALIZED DATETIME",- "Idempotency-Key": "41981401-6b92-482e-be79-dd1618dced34",- "Original-Request": "req_NORMALIZED0007",- "Request-Id": "req_NORMALIZED0007",+ "Date": "Tue, 21 Nov 2023 18:46:46 GMT",+ "Idempotency-Key": "40057a0c-ec4f-4cad-b350-9dc96da50e9c",+ "Original-Request": "req_AHmbF72gKDPvqs",+ "Request-Id": "req_AHmbF72gKDPvqs","Server": "nginx","Strict-Transport-Security": "max-age=63072000; includeSubDomains; preload","Stripe-Should-Retry": "false",@@ -309,7 +309,7 @@"http_status": 402,"json_body": {"error": {- "charge": "ch_NORMALIZED00000000000002",+ "charge": "ch_3OEyy3DEQaroqDjs1gdehahC","code": "card_declined","decline_code": "generic_decline","doc_url": "https://stripe.com/docs/error-codes/card-declined",@@ -352,9 +352,9 @@},"calculated_statement_descriptor": "ZULIP","captured": false,- "created": 1000000000,+ "created": 1700592405,"currency": "usd",- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","description": "Payment for Invoice","destination": null,"dispute": null,@@ -363,8 +363,8 @@"failure_code": "card_declined","failure_message": "Your card was declined.","fraud_details": {},- "id": "ch_NORMALIZED00000000000002",- "invoice": "in_NORMALIZED00000000000002",+ "id": "ch_3OEyy3DEQaroqDjs1gdehahC",+ "invoice": "in_1OEyy2DEQaroqDjsuRPt2KXA","livemode": false,"metadata": {},"object": "charge",@@ -374,13 +374,13 @@"network_status": "declined_by_network","reason": "generic_decline","risk_level": "normal",- "risk_score": 0,+ "risk_score": 9,"seller_message": "The bank did not return any further details with this decline.","type": "issuer_declined"},"paid": false,- "payment_intent": "pi_NORMALIZED00000000000002",- "payment_method": "pm_1ODZa0DEQaroqDjsfkPI8Yxd",+ "payment_intent": "pi_3OEyy3DEQaroqDjs14vaghr0",+ "payment_method": "pm_1OEyy6DEQaroqDjscAhZ1Tzb","payment_method_details": {"card": {"amount_authorized": null,@@ -396,7 +396,7 @@"extended_authorization": {"status": "disabled"},- "fingerprint": "NORMALIZED000002",+ "fingerprint": "ABa2sePBR7Lu711Z","funding": "credit","incremental_authorization": {"status": "unavailable"@@ -429,7 +429,7 @@"has_more": false,"object": "list","total_count": 0,- "url": "/v1/charges/ch_NORMALIZED00000000000002/refunds"+ "url": "/v1/charges/ch_3OEyy3DEQaroqDjs1gdehahC/refunds"},"review": null,"shipping": null,@@ -445,18 +445,18 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000002"+ "url": "/v1/charges?payment_intent=pi_3OEyy3DEQaroqDjs14vaghr0"},- "client_secret": "pi_NORMALIZED00000000000002_secret_7Eo8FACzzYBdY9W7tuf4iwCHV",+ "client_secret": "pi_3OEyy3DEQaroqDjs14vaghr0_secret_Pe8Xs7XiZqwsv9PNa3CyQVazw","confirmation_method": "automatic",- "created": 1000000000,+ "created": 1700592399,"currency": "usd",- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","description": "Payment for Invoice",- "id": "pi_NORMALIZED00000000000002",- "invoice": "in_NORMALIZED00000000000002",+ "id": "pi_3OEyy3DEQaroqDjs14vaghr0",+ "invoice": "in_1OEyy2DEQaroqDjsuRPt2KXA","last_payment_error": {- "charge": "ch_NORMALIZED00000000000002",+ "charge": "ch_3OEyy3DEQaroqDjs1gdehahC","code": "card_declined","decline_code": "generic_decline","doc_url": "https://stripe.com/docs/error-codes/card-declined",@@ -485,7 +485,7 @@"country": "US","exp_month": 11,"exp_year": 2024,- "fingerprint": "NORMALIZED000002",+ "fingerprint": "ABa2sePBR7Lu711Z","funding": "credit","generated_from": null,"last4": "0341",@@ -500,9 +500,9 @@},"wallet": null},- "created": 1000000000,- "customer": "cus_NORMALIZED0001",- "id": "pm_1ODZa0DEQaroqDjsfkPI8Yxd",+ "created": 1700592402,+ "customer": "cus_P358SWUcASaSWt",+ "id": "pm_1OEyy6DEQaroqDjscAhZ1Tzb","livemode": false,"metadata": {},"object": "payment_method",@@ -510,7 +510,7 @@},"type": "card_error"},- "latest_charge": "ch_NORMALIZED00000000000002",+ "latest_charge": "ch_3OEyy3DEQaroqDjs1gdehahC","livemode": false,"metadata": {},"next_action": null,@@ -567,7 +567,7 @@"country": "US","exp_month": 11,"exp_year": 2024,- "fingerprint": "NORMALIZED000002",+ "fingerprint": "ABa2sePBR7Lu711Z","funding": "credit","generated_from": null,"last4": "0341",@@ -582,18 +582,18 @@},"wallet": null},- "created": 1000000000,- "customer": "cus_NORMALIZED0001",- "id": "pm_1ODZa0DEQaroqDjsfkPI8Yxd",+ "created": 1700592402,+ "customer": "cus_P358SWUcASaSWt",+ "id": "pm_1OEyy6DEQaroqDjscAhZ1Tzb","livemode": false,"metadata": {},"object": "payment_method","type": "card"},- "request_log_url": "https://dashboard.stripe.com/test/logs/req_NORMALIZED0007?t=1700256482",+ "request_log_url": "https://dashboard.stripe.com/test/logs/req_AHmbF72gKDPvqs?t=1700592405","type": "card_error"}},"param": null,- "request_id": "req_NORMALIZED0007"+ "request_id": "req_AHmbF72gKDPvqs"}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 ac1cd9f17cd..8c4ab38d50c 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@@ -16,12 +16,12 @@"status": null},"billing_reason": "manual",- "charge": "ch_NORMALIZED00000000000003",+ "charge": "ch_3OEyy3DEQaroqDjs1TeJdg1S","collection_method": "charge_automatically",- "created": 1000000000,+ "created": 1700592398,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","customer_address": null,"customer_email": "[email protected]","customer_name": null,@@ -36,13 +36,13 @@"discount": null,"discounts": [],"due_date": null,- "effective_at": 1000000000,+ "effective_at": 1700592399,"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwQVEyWFJ3QjAxRXR4TkQ5ZmszYjV1ZDFTQ0dVLDkwNzk3Mjkw0200zGeo9ek5?s=ap",- "id": "in_NORMALIZED00000000000002",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNwQVEyWFJ3QjAxRXR4TkQ5ZmszYjV1ZDFTQ0dVLDkwNzk3Mjkw0200zGeo9ek5/pdf?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4RWRPU3dqOTdjZThINlpWTXpFSjNvOGdIWUlYLDkxMTMzMjEz0200CnhxmAHd?s=ap",+ "id": "in_1OEyy2DEQaroqDjsuRPt2KXA",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_17vTkwDEQaroqDjs/test_YWNjdF8xN3ZUa3dERVFhcm9xRGpzLF9QMzU4RWRPU3dqOTdjZThINlpWTXpFSjNvOGdIWUlYLDkxMTMzMjEz0200CnhxmAHd/pdf?s=ap","last_finalization_error": null,"latest_revision": null,"lines": {@@ -55,29 +55,29 @@"discount_amounts": [],"discountable": true,"discounts": [],- "id": "il_NORMALIZED00000000000003",- "invoice_item": "ii_NORMALIZED00000000000003",+ "id": "il_1OEyy2DEQaroqDjscjyiZWKB",+ "invoice_item": "ii_1OEyy2DEQaroqDjsUHAJkp45","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1700592398,+ "start": 1700592398},"plan": null,"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1700592398,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000003",+ "id": "price_1OEyy2DEQaroqDjsClpqf6Qb","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0003",+ "product": "prod_P358e9e33CbWxt","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -101,24 +101,24 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"+ "url": "/v1/invoices/in_1OEyy2DEQaroqDjsuRPt2KXA/lines"},"livemode": false,"metadata": {},"next_payment_attempt": null,- "number": "NORMALI-0003",+ "number": "69DA5EF9-0002","object": "invoice","on_behalf_of": null,"paid": true,"paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000002",+ "payment_intent": "pi_3OEyy3DEQaroqDjs14vaghr0","payment_settings": {"default_mandate": null,"payment_method_options": null,"payment_method_types": null},- "period_end": 1000000000,- "period_start": 1000000000,+ "period_end": 1700592398,+ "period_start": 1700592398,"post_payment_credit_notes_amount": 0,"pre_payment_credit_notes_amount": 0,"quote": null,@@ -136,9 +136,9 @@"statement_descriptor": null,"status": "paid","status_transitions": {- "finalized_at": 1000000000,+ "finalized_at": 1700592399,"marked_uncollectible_at": null,- "paid_at": 1000000000,+ "paid_at": 1700592411,"voided_at": null},"subscription": null,@@ -154,5 +154,5 @@"total_excluding_tax": 5000,"total_tax_amounts": [],"transfer_data": null,- "webhooks_delivered_at": 1000000000+ "webhooks_delivered_at": 1700592399}diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--InvoiceItem.create.1.json b/corporate/tests/stripe_fixtures/replace_payment_method--InvoiceItem.create.1.jsonindex fcb1c3c2e9d..4c723cd3b79 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--InvoiceItem.create.1.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--InvoiceItem.create.1.json@@ -1,34 +1,34 @@{"amount": -48000,"currency": "usd",- "customer": "cus_NORMALIZED0001",- "date": 1000000000,+ "customer": "cus_P358SWUcASaSWt",+ "date": 1700592394,"description": "Payment (Card ending in 4242)","discountable": false,"discounts": [],- "id": "ii_NORMALIZED00000000000002",+ "id": "ii_1OEyxyDEQaroqDjshhkuKTu6","invoice": null,"livemode": false,"metadata": {},"object": "invoiceitem","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1700592394,+ "start": 1700592394},"plan": null,"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1699463487,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000002",+ "id": "price_1OAFHnDEQaroqDjsGPnkI1Z2","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0002",+ "product": "prod_OvY3hKgN66WIeP","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--InvoiceItem.create.2.json b/corporate/tests/stripe_fixtures/replace_payment_method--InvoiceItem.create.2.jsonindex 11622f30a73..dbadd563603 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--InvoiceItem.create.2.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--InvoiceItem.create.2.json@@ -1,12 +1,12 @@{"amount": 48000,"currency": "usd",- "customer": "cus_NORMALIZED0001",- "date": 1000000000,+ "customer": "cus_P358SWUcASaSWt",+ "date": 1700592395,"description": "Zulip Cloud Standard","discountable": false,"discounts": [],- "id": "ii_NORMALIZED00000000000001",+ "id": "ii_1OEyxzDEQaroqDjsfKGNI9OG","invoice": null,"livemode": false,"metadata": {},@@ -19,16 +19,16 @@"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1698927319,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000001",+ "id": "price_1O7znvDEQaroqDjsLJjqNJy0","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0001",+ "product": "prod_OvY3rmiwsD4vFL","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--InvoiceItem.create.3.json b/corporate/tests/stripe_fixtures/replace_payment_method--InvoiceItem.create.3.jsonindex e749716c470..dc9cffe1d09 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--InvoiceItem.create.3.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--InvoiceItem.create.3.json@@ -1,34 +1,34 @@{"amount": 5000,"currency": "usd",- "customer": "cus_NORMALIZED0001",- "date": 1000000000,+ "customer": "cus_P358SWUcASaSWt",+ "date": 1700592398,"description": null,"discountable": true,"discounts": [],- "id": "ii_NORMALIZED00000000000003",+ "id": "ii_1OEyy2DEQaroqDjsUHAJkp45","invoice": null,"livemode": false,"metadata": {},"object": "invoiceitem","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1700592398,+ "start": 1700592398},"plan": null,"price": {"active": false,"billing_scheme": "per_unit",- "created": 1000000000,+ "created": 1700592398,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000003",+ "id": "price_1OEyy2DEQaroqDjsClpqf6Qb","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0003",+ "product": "prod_P358e9e33CbWxt","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--PaymentIntent.create.1.json b/corporate/tests/stripe_fixtures/replace_payment_method--PaymentIntent.create.1.jsonindex 1e96603772d..54a695efa47 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--PaymentIntent.create.1.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--PaymentIntent.create.1.json@@ -20,7 +20,7 @@"application": null,"application_fee": null,"application_fee_amount": null,- "balance_transaction": "txn_NORMALIZED00000000000001",+ "balance_transaction": "txn_3OEyxxDEQaroqDjs0BgcA3dQ","billing_details": {"address": {"city": null,@@ -36,9 +36,9 @@},"calculated_statement_descriptor": "ZULIP CLOUD STANDARD","captured": true,- "created": 1000000000,+ "created": 1700592393,"currency": "usd",- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","description": "Upgrade to Zulip Cloud Standard, $80.0 x 6","destination": null,"dispute": null,@@ -47,7 +47,7 @@"failure_code": null,"failure_message": null,"fraud_details": {},- "id": "ch_NORMALIZED00000000000001",+ "id": "ch_3OEyxxDEQaroqDjs0Jpvm8ZV","invoice": null,"livemode": false,"metadata": {@@ -56,7 +56,7 @@"license_management": "automatic","licenses": "6","price_per_license": "8000",- "realm_id": "1",+ "realm_id": "2","realm_str": "zulip","seat_count": "6","type": "upgrade",@@ -70,13 +70,13 @@"network_status": "approved_by_network","reason": null,"risk_level": "normal",- "risk_score": 0,+ "risk_score": 11,"seller_message": "Payment complete.","type": "authorized"},"paid": true,- "payment_intent": "pi_NORMALIZED00000000000001",- "payment_method": "pm_1ODZZnDEQaroqDjsRI67eH96",+ "payment_intent": "pi_3OEyxxDEQaroqDjs0PMlUA1C",+ "payment_method": "pm_1OEyxsDEQaroqDjsklOoFXrh","payment_method_details": {"card": {"amount_authorized": 48000,@@ -92,7 +92,7 @@"extended_authorization": {"status": "disabled"},- "fingerprint": "NORMALIZED000001",+ "fingerprint": "9XKsMixKBi6kIIzd","funding": "credit","incremental_authorization": {"status": "unavailable"@@ -118,14 +118,14 @@},"receipt_email": "[email protected]","receipt_number": null,- "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKNe136oGMgb7GyRiSqc6LBYAqD2uSc3LdfubVlov-2C3J7o4WjKliVlhcL_n16gVQgL9elrSI_pQJJm9",+ "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKIr286oGMgZ7PBucbcQ6LBbFyCl1VaY41WGBkHEp1lbWKWhlJ-__LTlJw4R4rq8QN0I4GBx-zBNjXoRk","refunded": false,"refunds": {"data": [],"has_more": false,"object": "list","total_count": 0,- "url": "/v1/charges/ch_NORMALIZED00000000000001/refunds"+ "url": "/v1/charges/ch_3OEyxxDEQaroqDjs0Jpvm8ZV/refunds"},"review": null,"shipping": null,@@ -141,18 +141,18 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000001"+ "url": "/v1/charges?payment_intent=pi_3OEyxxDEQaroqDjs0PMlUA1C"},- "client_secret": "pi_NORMALIZED00000000000001_secret_SjfUQBf7o3ccnZsYnAaZYyvx2",+ "client_secret": "pi_3OEyxxDEQaroqDjs0PMlUA1C_secret_tLFPeH51I31E0g48R3YR1224j","confirmation_method": "automatic",- "created": 1000000000,+ "created": 1700592393,"currency": "usd",- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","description": "Upgrade to Zulip Cloud Standard, $80.0 x 6",- "id": "pi_NORMALIZED00000000000001",+ "id": "pi_3OEyxxDEQaroqDjs0PMlUA1C","invoice": null,"last_payment_error": null,- "latest_charge": "ch_NORMALIZED00000000000001",+ "latest_charge": "ch_3OEyxxDEQaroqDjs0Jpvm8ZV","livemode": false,"metadata": {"billing_modality": "charge_automatically",@@ -160,7 +160,7 @@"license_management": "automatic","licenses": "6","price_per_license": "8000",- "realm_id": "1",+ "realm_id": "2","realm_str": "zulip","seat_count": "6","type": "upgrade",@@ -170,7 +170,7 @@"next_action": null,"object": "payment_intent","on_behalf_of": null,- "payment_method": "pm_1ODZZnDEQaroqDjsRI67eH96",+ "payment_method": "pm_1OEyxsDEQaroqDjsklOoFXrh","payment_method_configuration_details": null,"payment_method_options": {"card": {diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--PaymentMethod.detach.1.json b/corporate/tests/stripe_fixtures/replace_payment_method--PaymentMethod.detach.1.jsonindex a756875ad8a..84ef1693c93 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--PaymentMethod.detach.1.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--PaymentMethod.detach.1.json@@ -22,7 +22,7 @@"country": "US","exp_month": 11,"exp_year": 2024,- "fingerprint": "NORMALIZED000002",+ "fingerprint": "ABa2sePBR7Lu711Z","funding": "credit","generated_from": null,"last4": "0341",@@ -37,9 +37,9 @@},"wallet": null},- "created": 1000000000,+ "created": 1700592402,"customer": null,- "id": "pm_1ODZa0DEQaroqDjsfkPI8Yxd",+ "id": "pm_1OEyy6DEQaroqDjscAhZ1Tzb","livemode": false,"metadata": {},"object": "payment_method",diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--PaymentMethod.detach.2.json b/corporate/tests/stripe_fixtures/replace_payment_method--PaymentMethod.detach.2.jsonindex bf5c61f966d..998924a41cd 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--PaymentMethod.detach.2.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--PaymentMethod.detach.2.json@@ -22,7 +22,7 @@"country": "US","exp_month": 11,"exp_year": 2024,- "fingerprint": "NORMALIZED000001",+ "fingerprint": "9XKsMixKBi6kIIzd","funding": "credit","generated_from": null,"last4": "4242",@@ -37,9 +37,9 @@},"wallet": null},- "created": 1000000000,+ "created": 1700592389,"customer": null,- "id": "pm_1ODZZnDEQaroqDjsRI67eH96",+ "id": "pm_1OEyxsDEQaroqDjsklOoFXrh","livemode": false,"metadata": {},"object": "payment_method",diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--PaymentMethod.list.1.json b/corporate/tests/stripe_fixtures/replace_payment_method--PaymentMethod.list.1.jsonindex 8f1b768f3c3..d534287a185 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--PaymentMethod.list.1.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--PaymentMethod.list.1.json@@ -24,7 +24,7 @@"country": "US","exp_month": 11,"exp_year": 2024,- "fingerprint": "NORMALIZED000002",+ "fingerprint": "ABa2sePBR7Lu711Z","funding": "credit","generated_from": null,"last4": "0341",@@ -39,9 +39,9 @@},"wallet": null},- "created": 1000000000,- "customer": "cus_NORMALIZED0001",- "id": "pm_1ODZa0DEQaroqDjsfkPI8Yxd",+ "created": 1700592402,+ "customer": "cus_P358SWUcASaSWt",+ "id": "pm_1OEyy6DEQaroqDjscAhZ1Tzb","livemode": false,"metadata": {},"object": "payment_method",@@ -71,7 +71,7 @@"country": "US","exp_month": 11,"exp_year": 2024,- "fingerprint": "NORMALIZED000001",+ "fingerprint": "9XKsMixKBi6kIIzd","funding": "credit","generated_from": null,"last4": "4242",@@ -86,9 +86,9 @@},"wallet": null},- "created": 1000000000,- "customer": "cus_NORMALIZED0001",- "id": "pm_1ODZZnDEQaroqDjsRI67eH96",+ "created": 1700592389,+ "customer": "cus_P358SWUcASaSWt",+ "id": "pm_1OEyxsDEQaroqDjsklOoFXrh","livemode": false,"metadata": {},"object": "payment_method",diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--PaymentMethod.list.2.json b/corporate/tests/stripe_fixtures/replace_payment_method--PaymentMethod.list.2.jsonindex 5ab5b32db32..0f0d4f6811c 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--PaymentMethod.list.2.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--PaymentMethod.list.2.json@@ -24,7 +24,7 @@"country": "US","exp_month": 11,"exp_year": 2024,- "fingerprint": "NORMALIZED000003",+ "fingerprint": "HIhaF5dAXctoIcSd","funding": "credit","generated_from": null,"last4": "4444",@@ -39,9 +39,9 @@},"wallet": null},- "created": 1000000000,- "customer": "cus_NORMALIZED0001",- "id": "pm_1ODZa6DEQaroqDjsBeAKxfS1",+ "created": 1700592409,+ "customer": "cus_P358SWUcASaSWt",+ "id": "pm_1OEyyDDEQaroqDjsoHRzbvSp","livemode": false,"metadata": {},"object": "payment_method",diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.create.1.json b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.create.1.jsonindex 911783a66cf..43727845482 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.create.1.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.create.1.json@@ -2,21 +2,21 @@"application": null,"automatic_payment_methods": null,"cancellation_reason": null,- "client_secret": "seti_1ODZZnDEQaroqDjs5W6uMeGE_secret_P1cpAMZFK9bAlUcgKmTMzJz3ROuR19s",- "created": 1000000000,- "customer": "cus_NORMALIZED0001",+ "client_secret": "seti_1OEyxtDEQaroqDjswaWF7vc1_secret_P3585ea4m3b4LJkn2FSTXY29JQrnOH0",+ "created": 1700592389,+ "customer": "cus_P358SWUcASaSWt","description": null,"flow_directions": null,- "id": "seti_1ODZZnDEQaroqDjs5W6uMeGE",+ "id": "seti_1OEyxtDEQaroqDjswaWF7vc1","last_setup_error": null,- "latest_attempt": "setatt_1ODZZnDEQaroqDjs9YBvHeqk",+ "latest_attempt": "setatt_1OEyxtDEQaroqDjscBfabQTU","livemode": false,"mandate": null,"metadata": {},"next_action": null,"object": "setup_intent","on_behalf_of": null,- "payment_method": "pm_1ODZZnDEQaroqDjsRI67eH96",+ "payment_method": "pm_1OEyxsDEQaroqDjsklOoFXrh","payment_method_configuration_details": null,"payment_method_options": {"card": {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 261dac48e00..fa319ff7ddc 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@@ -33,7 +33,7 @@"country": "US","exp_month": 11,"exp_year": 2024,- "fingerprint": "NORMALIZED000004",+ "fingerprint": "hrFDcQvsK80IBqEa","funding": "credit","generated_from": null,"last4": "0002",@@ -48,25 +48,25 @@},"wallet": null},- "created": 1000000000,+ "created": 1700592400,"customer": null,- "id": "pm_1ODZZyDEQaroqDjsEAY2TDVm",+ "id": "pm_1OEyy4DEQaroqDjsE6DBrm3Y","livemode": false,"metadata": {},"object": "payment_method","type": "card"},- "request_log_url": "https://dashboard.stripe.com/test/logs/req_NORMALIZED0008?t=1700256478",+ "request_log_url": "https://dashboard.stripe.com/test/logs/req_4VqbLXtIfjk3G1?t=1700592400","setup_intent": {"application": null,"automatic_payment_methods": null,"cancellation_reason": null,- "client_secret": "seti_1ODZZyDEQaroqDjsiGLkA5AP_secret_P1cpPkmxs6Z2EGscRuFdYGrtTYTpLyM",- "created": 1000000000,- "customer": "cus_NORMALIZED0001",+ "client_secret": "seti_1OEyy4DEQaroqDjsaNADuj5r_secret_P358KPXgMgJyl6ZA9QHGYXUY682jC4l",+ "created": 1700592400,+ "customer": "cus_P358SWUcASaSWt","description": null,"flow_directions": null,- "id": "seti_1ODZZyDEQaroqDjsiGLkA5AP",+ "id": "seti_1OEyy4DEQaroqDjsaNADuj5r","last_setup_error": {"code": "card_declined","decline_code": "generic_decline",@@ -96,7 +96,7 @@"country": "US","exp_month": 11,"exp_year": 2024,- "fingerprint": "NORMALIZED000004",+ "fingerprint": "hrFDcQvsK80IBqEa","funding": "credit","generated_from": null,"last4": "0002",@@ -111,9 +111,9 @@},"wallet": null},- "created": 1000000000,+ "created": 1700592400,"customer": null,- "id": "pm_1ODZZyDEQaroqDjsEAY2TDVm",+ "id": "pm_1OEyy4DEQaroqDjsE6DBrm3Y","livemode": false,"metadata": {},"object": "payment_method",@@ -121,7 +121,7 @@},"type": "card_error"},- "latest_attempt": "setatt_1ODZZyDEQaroqDjstCrGAGTk",+ "latest_attempt": "setatt_1OEyy5DEQaroqDjscZZ6jYpw","livemode": false,"mandate": null,"metadata": {},@@ -158,10 +158,10 @@"Content-Length": "4102","Content-Security-Policy": "report-uri https://q.stripe.com/csp-report?p=v1%2Fsetup_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'","Content-Type": "application/json",- "Date": "NORMALIZED DATETIME",- "Idempotency-Key": "72218059-72e9-4cc4-82e1-11e5c6e43dca",- "Original-Request": "req_NORMALIZED0008",- "Request-Id": "req_NORMALIZED0008",+ "Date": "Tue, 21 Nov 2023 18:46:41 GMT",+ "Idempotency-Key": "9e6c8bab-eadc-42c0-a55b-e0f512e46dbd",+ "Original-Request": "req_4VqbLXtIfjk3G1",+ "Request-Id": "req_4VqbLXtIfjk3G1","Server": "nginx","Strict-Transport-Security": "max-age=63072000; includeSubDomains; preload","Stripe-Should-Retry": "false",@@ -201,7 +201,7 @@"country": "US","exp_month": 11,"exp_year": 2024,- "fingerprint": "NORMALIZED000004",+ "fingerprint": "hrFDcQvsK80IBqEa","funding": "credit","generated_from": null,"last4": "0002",@@ -216,25 +216,25 @@},"wallet": null},- "created": 1000000000,+ "created": 1700592400,"customer": null,- "id": "pm_1ODZZyDEQaroqDjsEAY2TDVm",+ "id": "pm_1OEyy4DEQaroqDjsE6DBrm3Y","livemode": false,"metadata": {},"object": "payment_method","type": "card"},- "request_log_url": "https://dashboard.stripe.com/test/logs/req_NORMALIZED0008?t=1700256478",+ "request_log_url": "https://dashboard.stripe.com/test/logs/req_4VqbLXtIfjk3G1?t=1700592400","setup_intent": {"application": null,"automatic_payment_methods": null,"cancellation_reason": null,- "client_secret": "seti_1ODZZyDEQaroqDjsiGLkA5AP_secret_P1cpPkmxs6Z2EGscRuFdYGrtTYTpLyM",- "created": 1000000000,- "customer": "cus_NORMALIZED0001",+ "client_secret": "seti_1OEyy4DEQaroqDjsaNADuj5r_secret_P358KPXgMgJyl6ZA9QHGYXUY682jC4l",+ "created": 1700592400,+ "customer": "cus_P358SWUcASaSWt","description": null,"flow_directions": null,- "id": "seti_1ODZZyDEQaroqDjsiGLkA5AP",+ "id": "seti_1OEyy4DEQaroqDjsaNADuj5r","last_setup_error": {"code": "card_declined","decline_code": "generic_decline",@@ -264,7 +264,7 @@"country": "US","exp_month": 11,"exp_year": 2024,- "fingerprint": "NORMALIZED000004",+ "fingerprint": "hrFDcQvsK80IBqEa","funding": "credit","generated_from": null,"last4": "0002",@@ -279,9 +279,9 @@},"wallet": null},- "created": 1000000000,+ "created": 1700592400,"customer": null,- "id": "pm_1ODZZyDEQaroqDjsEAY2TDVm",+ "id": "pm_1OEyy4DEQaroqDjsE6DBrm3Y","livemode": false,"metadata": {},"object": "payment_method",@@ -289,7 +289,7 @@},"type": "card_error"},- "latest_attempt": "setatt_1ODZZyDEQaroqDjstCrGAGTk",+ "latest_attempt": "setatt_1OEyy5DEQaroqDjscZZ6jYpw","livemode": false,"mandate": null,"metadata": {},@@ -316,5 +316,5 @@}},"param": null,- "request_id": "req_NORMALIZED0008"+ "request_id": "req_4VqbLXtIfjk3G1"}diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.create.3.json b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.create.3.jsonindex a4f8396d554..6df8e244307 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.create.3.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.create.3.json@@ -2,21 +2,21 @@"application": null,"automatic_payment_methods": null,"cancellation_reason": null,- "client_secret": "seti_1ODZa0DEQaroqDjs3jfpUg6P_secret_P1cpO2bNXBOUZTvAxhkzEq3Uc7MLHlC",- "created": 1000000000,- "customer": "cus_NORMALIZED0001",+ "client_secret": "seti_1OEyy6DEQaroqDjsWKca5mi1_secret_P35857EUQ8ACmaDGJEdDOzXhnfTkB4X",+ "created": 1700592402,+ "customer": "cus_P358SWUcASaSWt","description": null,"flow_directions": null,- "id": "seti_1ODZa0DEQaroqDjs3jfpUg6P",+ "id": "seti_1OEyy6DEQaroqDjsWKca5mi1","last_setup_error": null,- "latest_attempt": "setatt_1ODZa0DEQaroqDjsorASEwms",+ "latest_attempt": "setatt_1OEyy6DEQaroqDjsB8Rbw1q0","livemode": false,"mandate": null,"metadata": {},"next_action": null,"object": "setup_intent","on_behalf_of": null,- "payment_method": "pm_1ODZa0DEQaroqDjsfkPI8Yxd",+ "payment_method": "pm_1OEyy6DEQaroqDjscAhZ1Tzb","payment_method_configuration_details": null,"payment_method_options": {"card": {diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.create.4.json b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.create.4.jsonindex bd806e4cda0..ebcaa1a81b2 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.create.4.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.create.4.json@@ -2,21 +2,21 @@"application": null,"automatic_payment_methods": null,"cancellation_reason": null,- "client_secret": "seti_1ODZa6DEQaroqDjsUZNqaKnz_secret_P1cpL1DxO12kEtaJgCLeHJM9Zk8v2RN",- "created": 1000000000,- "customer": "cus_NORMALIZED0001",+ "client_secret": "seti_1OEyyDDEQaroqDjsfiEXlrxq_secret_P358ShYOM6ct69ahuFTsYrXOYbte4Rh",+ "created": 1700592409,+ "customer": "cus_P358SWUcASaSWt","description": null,"flow_directions": null,- "id": "seti_1ODZa6DEQaroqDjsUZNqaKnz",+ "id": "seti_1OEyyDDEQaroqDjsfiEXlrxq","last_setup_error": null,- "latest_attempt": "setatt_1ODZa6DEQaroqDjs7AAjg5Ut",+ "latest_attempt": "setatt_1OEyyDDEQaroqDjs5bHq5840","livemode": false,"mandate": null,"metadata": {},"next_action": null,"object": "setup_intent","on_behalf_of": null,- "payment_method": "pm_1ODZa6DEQaroqDjsBeAKxfS1",+ "payment_method": "pm_1OEyyDDEQaroqDjsoHRzbvSp","payment_method_configuration_details": null,"payment_method_options": {"card": {diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.list.1.json b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.list.1.jsonindex f55508c510a..277ab7dc64c 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.list.1.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.list.1.json@@ -4,12 +4,12 @@"application": null,"automatic_payment_methods": null,"cancellation_reason": null,- "client_secret": "seti_1ODZZmDEQaroqDjs251YiE35_secret_P1cpjP8ooWn1d2NW8SHpbtbALpiw2s7",- "created": 1000000000,- "customer": "cus_NORMALIZED0001",+ "client_secret": "seti_1OEyxqDEQaroqDjsJxHHiD8D_secret_P358hsvKlThXU29WvWn50VVqhAfoZHk",+ "created": 1700592386,+ "customer": "cus_P358SWUcASaSWt","description": null,"flow_directions": null,- "id": "seti_1ODZZmDEQaroqDjs251YiE35",+ "id": "seti_1OEyxqDEQaroqDjsJxHHiD8D","last_setup_error": null,"latest_attempt": null,"livemode": false,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.list.2.json b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.list.2.jsonindex 72bea3aea18..7b484f341b4 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.list.2.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.list.2.json@@ -4,12 +4,12 @@"application": null,"automatic_payment_methods": null,"cancellation_reason": null,- "client_secret": "seti_1ODZZxDEQaroqDjs2OnxLNbu_secret_P1cp3J9sqJzduEFXLulyNrXfy5GorwZ",- "created": 1000000000,- "customer": "cus_NORMALIZED0001",+ "client_secret": "seti_1OEyy4DEQaroqDjsqfvkOxQA_secret_P358rowO5fvK8BWfWSCTWj5IzMirSer",+ "created": 1700592400,+ "customer": "cus_P358SWUcASaSWt","description": null,"flow_directions": null,- "id": "seti_1ODZZxDEQaroqDjs2OnxLNbu",+ "id": "seti_1OEyy4DEQaroqDjsqfvkOxQA","last_setup_error": null,"latest_attempt": null,"livemode": false,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.list.3.json b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.list.3.jsonindex 766ca6d0a8a..6660a3090e8 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.list.3.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.list.3.json@@ -4,12 +4,12 @@"application": null,"automatic_payment_methods": null,"cancellation_reason": null,- "client_secret": "seti_1ODZZzDEQaroqDjsWcl156y9_secret_P1cpRZ9z4JyKhZ8hRJoWvWDRe7ioMyo",- "created": 1000000000,- "customer": "cus_NORMALIZED0001",+ "client_secret": "seti_1OEyy6DEQaroqDjszotw82xO_secret_P358YnMokVFD2b3uh82S8KTlnMM50GK",+ "created": 1700592402,+ "customer": "cus_P358SWUcASaSWt","description": null,"flow_directions": null,- "id": "seti_1ODZZzDEQaroqDjsWcl156y9",+ "id": "seti_1OEyy6DEQaroqDjszotw82xO","last_setup_error": null,"latest_attempt": null,"livemode": false,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.list.4.json b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.list.4.jsonindex 19b14010e43..2d829e0beb4 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.list.4.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.list.4.json@@ -4,12 +4,12 @@"application": null,"automatic_payment_methods": null,"cancellation_reason": null,- "client_secret": "seti_1ODZa5DEQaroqDjsnToh0SIX_secret_P1cpiGDGvS0rXdXgSLAW6RYOqAhlFxb",- "created": 1000000000,- "customer": "cus_NORMALIZED0001",+ "client_secret": "seti_1OEyyCDEQaroqDjsTjq1NBvt_secret_P358eMXKwYHZCtJoAy1KEl5lAWtTtML",+ "created": 1700592408,+ "customer": "cus_P358SWUcASaSWt","description": null,"flow_directions": null,- "id": "seti_1ODZa5DEQaroqDjsnToh0SIX",+ "id": "seti_1OEyyCDEQaroqDjsTjq1NBvt","last_setup_error": null,"latest_attempt": null,"livemode": false,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.retrieve.1.json b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.retrieve.1.jsonindex 911783a66cf..43727845482 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.retrieve.1.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.retrieve.1.json@@ -2,21 +2,21 @@"application": null,"automatic_payment_methods": null,"cancellation_reason": null,- "client_secret": "seti_1ODZZnDEQaroqDjs5W6uMeGE_secret_P1cpAMZFK9bAlUcgKmTMzJz3ROuR19s",- "created": 1000000000,- "customer": "cus_NORMALIZED0001",+ "client_secret": "seti_1OEyxtDEQaroqDjswaWF7vc1_secret_P3585ea4m3b4LJkn2FSTXY29JQrnOH0",+ "created": 1700592389,+ "customer": "cus_P358SWUcASaSWt","description": null,"flow_directions": null,- "id": "seti_1ODZZnDEQaroqDjs5W6uMeGE",+ "id": "seti_1OEyxtDEQaroqDjswaWF7vc1","last_setup_error": null,- "latest_attempt": "setatt_1ODZZnDEQaroqDjs9YBvHeqk",+ "latest_attempt": "setatt_1OEyxtDEQaroqDjscBfabQTU","livemode": false,"mandate": null,"metadata": {},"next_action": null,"object": "setup_intent","on_behalf_of": null,- "payment_method": "pm_1ODZZnDEQaroqDjsRI67eH96",+ "payment_method": "pm_1OEyxsDEQaroqDjsklOoFXrh","payment_method_configuration_details": null,"payment_method_options": {"card": {diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.retrieve.2.json b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.retrieve.2.jsonindex a4f8396d554..6df8e244307 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.retrieve.2.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.retrieve.2.json@@ -2,21 +2,21 @@"application": null,"automatic_payment_methods": null,"cancellation_reason": null,- "client_secret": "seti_1ODZa0DEQaroqDjs3jfpUg6P_secret_P1cpO2bNXBOUZTvAxhkzEq3Uc7MLHlC",- "created": 1000000000,- "customer": "cus_NORMALIZED0001",+ "client_secret": "seti_1OEyy6DEQaroqDjsWKca5mi1_secret_P35857EUQ8ACmaDGJEdDOzXhnfTkB4X",+ "created": 1700592402,+ "customer": "cus_P358SWUcASaSWt","description": null,"flow_directions": null,- "id": "seti_1ODZa0DEQaroqDjs3jfpUg6P",+ "id": "seti_1OEyy6DEQaroqDjsWKca5mi1","last_setup_error": null,- "latest_attempt": "setatt_1ODZa0DEQaroqDjsorASEwms",+ "latest_attempt": "setatt_1OEyy6DEQaroqDjsB8Rbw1q0","livemode": false,"mandate": null,"metadata": {},"next_action": null,"object": "setup_intent","on_behalf_of": null,- "payment_method": "pm_1ODZa0DEQaroqDjsfkPI8Yxd",+ "payment_method": "pm_1OEyy6DEQaroqDjscAhZ1Tzb","payment_method_configuration_details": null,"payment_method_options": {"card": {diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.retrieve.3.json b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.retrieve.3.jsonindex bd806e4cda0..ebcaa1a81b2 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.retrieve.3.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--SetupIntent.retrieve.3.json@@ -2,21 +2,21 @@"application": null,"automatic_payment_methods": null,"cancellation_reason": null,- "client_secret": "seti_1ODZa6DEQaroqDjsUZNqaKnz_secret_P1cpL1DxO12kEtaJgCLeHJM9Zk8v2RN",- "created": 1000000000,- "customer": "cus_NORMALIZED0001",+ "client_secret": "seti_1OEyyDDEQaroqDjsfiEXlrxq_secret_P358ShYOM6ct69ahuFTsYrXOYbte4Rh",+ "created": 1700592409,+ "customer": "cus_P358SWUcASaSWt","description": null,"flow_directions": null,- "id": "seti_1ODZa6DEQaroqDjsUZNqaKnz",+ "id": "seti_1OEyyDDEQaroqDjsfiEXlrxq","last_setup_error": null,- "latest_attempt": "setatt_1ODZa6DEQaroqDjs7AAjg5Ut",+ "latest_attempt": "setatt_1OEyyDDEQaroqDjs5bHq5840","livemode": false,"mandate": null,"metadata": {},"next_action": null,"object": "setup_intent","on_behalf_of": null,- "payment_method": "pm_1ODZa6DEQaroqDjsBeAKxfS1",+ "payment_method": "pm_1OEyyDDEQaroqDjsoHRzbvSp","payment_method_configuration_details": null,"payment_method_options": {"card": {diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.create.1.json b/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.create.1.jsonindex 19ed85225e0..a963c6f4cb8 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.create.1.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.create.1.json@@ -13,7 +13,7 @@"client_secret": null,"consent": null,"consent_collection": null,- "created": 1000000000,+ "created": 1700592386,"currency": null,"currency_conversion": null,"custom_fields": [],@@ -22,7 +22,7 @@"submit": null,"terms_of_service_acceptance": null},- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","customer_creation": null,"customer_details": {"address": null,@@ -33,8 +33,8 @@"tax_ids": null},"customer_email": null,- "expires_at": 1000000000,- "id": "cs_test_NORMALIZED02kCwvFSLXC1Wt6rz3EVIHFyRDikux9Ldi9iSgK36d1CnYlW",+ "expires_at": 1700678786,+ "id": "cs_test_c1ZvqQVYBUdOipkuVfkGzD6LdP9SNLn8YX9QbZGA0v51kSZ6yrFlsQrr3k","invoice": null,"invoice_creation": null,"livemode": false,@@ -58,7 +58,7 @@"enabled": false},"recovered_from": null,- "setup_intent": "seti_1ODZZmDEQaroqDjs251YiE35",+ "setup_intent": "seti_1OEyxqDEQaroqDjsJxHHiD8D","shipping": null,"shipping_address_collection": null,"shipping_options": [],@@ -69,5 +69,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_NORMALIZED02kCwvFSLXC1Wt6rz3EVIHFyRDikux9Ldi9iSgK36d1CnYlW#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"+ "url": "https://checkout.stripe.com/c/pay/cs_test_c1ZvqQVYBUdOipkuVfkGzD6LdP9SNLn8YX9QbZGA0v51kSZ6yrFlsQrr3k#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"}diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.create.2.json b/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.create.2.jsonindex c017b93e239..feac0a45f7b 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.create.2.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.create.2.json@@ -13,7 +13,7 @@"client_secret": null,"consent": null,"consent_collection": null,- "created": 1000000000,+ "created": 1700592400,"currency": null,"currency_conversion": null,"custom_fields": [],@@ -22,7 +22,7 @@"submit": null,"terms_of_service_acceptance": null},- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","customer_creation": null,"customer_details": {"address": null,@@ -33,8 +33,8 @@"tax_ids": null},"customer_email": null,- "expires_at": 1000000000,- "id": "cs_test_NORMALIZED030YLT5w0LvzSqaLdLrnSVfaYhuX0emr8loH1lYLatGauuAn",+ "expires_at": 1700678800,+ "id": "cs_test_c1ctUxkqGinFH346rPiY7R8TmFzB6F3e8T9L8MPPrTH0fEFo3sK685V0ur","invoice": null,"invoice_creation": null,"livemode": false,@@ -58,7 +58,7 @@"enabled": false},"recovered_from": null,- "setup_intent": "seti_1ODZZxDEQaroqDjs2OnxLNbu",+ "setup_intent": "seti_1OEyy4DEQaroqDjsqfvkOxQA","shipping": null,"shipping_address_collection": null,"shipping_options": [],@@ -69,5 +69,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_NORMALIZED030YLT5w0LvzSqaLdLrnSVfaYhuX0emr8loH1lYLatGauuAn#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"+ "url": "https://checkout.stripe.com/c/pay/cs_test_c1ctUxkqGinFH346rPiY7R8TmFzB6F3e8T9L8MPPrTH0fEFo3sK685V0ur#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"}diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.create.3.json b/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.create.3.jsonindex d1e1df9f6b4..470865b5c9f 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.create.3.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.create.3.json@@ -13,7 +13,7 @@"client_secret": null,"consent": null,"consent_collection": null,- "created": 1000000000,+ "created": 1700592402,"currency": null,"currency_conversion": null,"custom_fields": [],@@ -22,7 +22,7 @@"submit": null,"terms_of_service_acceptance": null},- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","customer_creation": null,"customer_details": {"address": null,@@ -33,8 +33,8 @@"tax_ids": null},"customer_email": null,- "expires_at": 1000000000,- "id": "cs_test_NORMALIZED040xJXScuYdetllL1Crweg3af79TG9ZAPzEqhV97Pmj4NnTi",+ "expires_at": 1700678802,+ "id": "cs_test_c1mXJzikULLsWHwbsdSRiaXzNe2F7eSPAQcXCvnfVeInO7fIFRHsMorhGe","invoice": null,"invoice_creation": null,"livemode": false,@@ -58,7 +58,7 @@"enabled": false},"recovered_from": null,- "setup_intent": "seti_1ODZZzDEQaroqDjsWcl156y9",+ "setup_intent": "seti_1OEyy6DEQaroqDjszotw82xO","shipping": null,"shipping_address_collection": null,"shipping_options": [],@@ -69,5 +69,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_NORMALIZED040xJXScuYdetllL1Crweg3af79TG9ZAPzEqhV97Pmj4NnTi#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"+ "url": "https://checkout.stripe.com/c/pay/cs_test_c1mXJzikULLsWHwbsdSRiaXzNe2F7eSPAQcXCvnfVeInO7fIFRHsMorhGe#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"}diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.create.4.json b/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.create.4.jsonindex 7777064ad3d..3018572cc88 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.create.4.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.create.4.json@@ -13,7 +13,7 @@"client_secret": null,"consent": null,"consent_collection": null,- "created": 1000000000,+ "created": 1700592408,"currency": null,"currency_conversion": null,"custom_fields": [],@@ -22,7 +22,7 @@"submit": null,"terms_of_service_acceptance": null},- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","customer_creation": null,"customer_details": {"address": null,@@ -33,8 +33,8 @@"tax_ids": null},"customer_email": null,- "expires_at": 1000000000,- "id": "cs_test_NORMALIZED05wzwBduNX3uS7SIimgArgoeONFHL2ahVt5YYznlwrUw5XYu",+ "expires_at": 1700678808,+ "id": "cs_test_c19zbL8kZgPUuNhYtMMYmVU8BhaRQiCjKIMUSS5J20LSf0WDIkAcHoioLK","invoice": null,"invoice_creation": null,"livemode": false,@@ -58,7 +58,7 @@"enabled": false},"recovered_from": null,- "setup_intent": "seti_1ODZa5DEQaroqDjsnToh0SIX",+ "setup_intent": "seti_1OEyyCDEQaroqDjsTjq1NBvt","shipping": null,"shipping_address_collection": null,"shipping_options": [],@@ -69,5 +69,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_NORMALIZED05wzwBduNX3uS7SIimgArgoeONFHL2ahVt5YYznlwrUw5XYu#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"+ "url": "https://checkout.stripe.com/c/pay/cs_test_c19zbL8kZgPUuNhYtMMYmVU8BhaRQiCjKIMUSS5J20LSf0WDIkAcHoioLK#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"}diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.create.5.json b/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.create.5.jsonnew file mode 100644index 00000000000..2e76f44bcd1--- /dev/null+++ b/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.create.5.json@@ -0,0 +1,73 @@+{+ "after_expiration": null,+ "allow_promotion_codes": null,+ "amount_subtotal": null,+ "amount_total": null,+ "automatic_tax": {+ "enabled": false,+ "status": null+ },+ "billing_address_collection": null,+ "cancel_url": "http://zulip.testserver/upgrade/?manual_license_management=true",+ "client_reference_id": null,+ "client_secret": null,+ "consent": null,+ "consent_collection": null,+ "created": 1700592414,+ "currency": null,+ "currency_conversion": null,+ "custom_fields": [],+ "custom_text": {+ "shipping_address": null,+ "submit": null,+ "terms_of_service_acceptance": null+ },+ "customer": "cus_P358SWUcASaSWt",+ "customer_creation": null,+ "customer_details": {+ "address": null,+ "email": "[email protected]",+ "name": null,+ "phone": null,+ "tax_exempt": null,+ "tax_ids": null+ },+ "customer_email": null,+ "expires_at": 1700678814,+ "id": "cs_test_c17gy6lBD0J1E6I5DfmhduDXNaEhFUlkCa3SsJqEzBVXpMhYjYIjCW6Iwm",+ "invoice": null,+ "invoice_creation": null,+ "livemode": false,+ "locale": null,+ "metadata": {+ "type": "card_update",+ "user_id": "10"+ },+ "mode": "setup",+ "object": "checkout.session",+ "payment_intent": null,+ "payment_link": null,+ "payment_method_collection": "always",+ "payment_method_configuration_details": null,+ "payment_method_options": {},+ "payment_method_types": [+ "card"+ ],+ "payment_status": "no_payment_required",+ "phone_number_collection": {+ "enabled": false+ },+ "recovered_from": null,+ "setup_intent": "seti_1OEyyIDEQaroqDjsDKCpImmm",+ "shipping": null,+ "shipping_address_collection": null,+ "shipping_options": [],+ "shipping_rate": null,+ "status": "open",+ "submit_type": null,+ "subscription": null,+ "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_c17gy6lBD0J1E6I5DfmhduDXNaEhFUlkCa3SsJqEzBVXpMhYjYIjCW6Iwm#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"+}diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.list.1.json b/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.list.1.jsonindex 7f99edec0fc..f6d29b6158c 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.list.1.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.list.1.json@@ -15,7 +15,7 @@"client_secret": null,"consent": null,"consent_collection": null,- "created": 1000000000,+ "created": 1700592386,"currency": null,"currency_conversion": null,"custom_fields": [],@@ -24,7 +24,7 @@"submit": null,"terms_of_service_acceptance": null},- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","customer_creation": null,"customer_details": {"address": null,@@ -35,8 +35,8 @@"tax_ids": null},"customer_email": null,- "expires_at": 1000000000,- "id": "cs_test_NORMALIZED02kCwvFSLXC1Wt6rz3EVIHFyRDikux9Ldi9iSgK36d1CnYlW",+ "expires_at": 1700678786,+ "id": "cs_test_c1ZvqQVYBUdOipkuVfkGzD6LdP9SNLn8YX9QbZGA0v51kSZ6yrFlsQrr3k","invoice": null,"invoice_creation": null,"livemode": false,@@ -60,7 +60,7 @@"enabled": false},"recovered_from": null,- "setup_intent": "seti_1ODZZmDEQaroqDjs251YiE35",+ "setup_intent": "seti_1OEyxqDEQaroqDjsJxHHiD8D","shipping": null,"shipping_address_collection": null,"shipping_options": [],@@ -71,7 +71,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_NORMALIZED02kCwvFSLXC1Wt6rz3EVIHFyRDikux9Ldi9iSgK36d1CnYlW#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"+ "url": "https://checkout.stripe.com/c/pay/cs_test_c1ZvqQVYBUdOipkuVfkGzD6LdP9SNLn8YX9QbZGA0v51kSZ6yrFlsQrr3k#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"}],"has_more": true,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.list.2.json b/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.list.2.jsonindex 8308d0fa400..b1dc0b80afe 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.list.2.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.list.2.json@@ -15,7 +15,7 @@"client_secret": null,"consent": null,"consent_collection": null,- "created": 1000000000,+ "created": 1700592402,"currency": null,"currency_conversion": null,"custom_fields": [],@@ -24,7 +24,7 @@"submit": null,"terms_of_service_acceptance": null},- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","customer_creation": null,"customer_details": {"address": null,@@ -35,8 +35,8 @@"tax_ids": null},"customer_email": null,- "expires_at": 1000000000,- "id": "cs_test_NORMALIZED040xJXScuYdetllL1Crweg3af79TG9ZAPzEqhV97Pmj4NnTi",+ "expires_at": 1700678802,+ "id": "cs_test_c1mXJzikULLsWHwbsdSRiaXzNe2F7eSPAQcXCvnfVeInO7fIFRHsMorhGe","invoice": null,"invoice_creation": null,"livemode": false,@@ -60,7 +60,7 @@"enabled": false},"recovered_from": null,- "setup_intent": "seti_1ODZZzDEQaroqDjsWcl156y9",+ "setup_intent": "seti_1OEyy6DEQaroqDjszotw82xO","shipping": null,"shipping_address_collection": null,"shipping_options": [],@@ -71,7 +71,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_NORMALIZED040xJXScuYdetllL1Crweg3af79TG9ZAPzEqhV97Pmj4NnTi#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"+ "url": "https://checkout.stripe.com/c/pay/cs_test_c1mXJzikULLsWHwbsdSRiaXzNe2F7eSPAQcXCvnfVeInO7fIFRHsMorhGe#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"}],"has_more": true,diff --git a/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.list.3.json b/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.list.3.jsonindex e48954a6a01..b950c6f6c26 100644--- a/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.list.3.json+++ b/corporate/tests/stripe_fixtures/replace_payment_method--checkout.Session.list.3.json@@ -15,7 +15,7 @@"client_secret": null,"consent": null,"consent_collection": null,- "created": 1000000000,+ "created": 1700592408,"currency": null,"currency_conversion": null,"custom_fields": [],@@ -24,7 +24,7 @@"submit": null,"terms_of_service_acceptance": null},- "customer": "cus_NORMALIZED0001",+ "customer": "cus_P358SWUcASaSWt","customer_creation": null,"customer_details": {"address": null,@@ -35,8 +35,8 @@"tax_ids": null},"customer_email": null,- "expires_at": 1000000000,- "id": "cs_test_NORMALIZED05wzwBduNX3uS7SIimgArgoeONFHL2ahVt5YYznlwrUw5XYu",+ "expires_at": 1700678808,+ "id": "cs_test_c19zbL8kZgPUuNhYtMMYmVU8BhaRQiCjKIMUSS5J20LSf0WDIkAcHoioLK","invoice": null,"invoice_creation": null,"livemode": false,@@ -60,7 +60,7 @@"enabled": false},"recovered_from": null,- "setup_intent": "seti_1ODZa5DEQaroqDjsnToh0SIX",+ "setup_intent": "seti_1OEyyCDEQaroqDjsTjq1NBvt","shipping": null,"shipping_address_collection": null,"shipping_options": [],@@ -71,7 +71,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_NORMALIZED05wzwBduNX3uS7SIimgArgoeONFHL2ahVt5YYznlwrUw5XYu#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"+ "url": "https://checkout.stripe.com/c/pay/cs_test_c19zbL8kZgPUuNhYtMMYmVU8BhaRQiCjKIMUSS5J20LSf0WDIkAcHoioLK#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"}],"has_more": true,diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.pyindex 5fb3dbf1625..3b302206ee9 100644--- a/corporate/tests/test_stripe.py+++ b/corporate/tests/test_stripe.py@@ -538,6 +538,7 @@ class StripeTestCase(ZulipTestCase):{"type": "card_update_from_upgrade_page","status": "created",+ "is_manual_license_management_upgrade_session": False,},)self.trigger_stripe_checkout_session_completed_webhook(@@ -553,6 +554,7 @@ class StripeTestCase(ZulipTestCase):{"type": "card_update_from_upgrade_page","status": "completed",+ "is_manual_license_management_upgrade_session": False,"event_handler": {"status": "succeeded"},},)@@ -2125,6 +2127,7 @@ class StripeTest(StripeTestCase):{"type": "card_update_from_billing_page","status": "created",+ "is_manual_license_management_upgrade_session": False,},)with self.assertRaises(stripe.error.CardError):@@ -2145,6 +2148,7 @@ class StripeTest(StripeTestCase):{"type": "card_update_from_billing_page","status": "created",+ "is_manual_license_management_upgrade_session": False,},)with self.assertLogs("corporate.stripe", "INFO") as m:@@ -2161,6 +2165,7 @@ class StripeTest(StripeTestCase):{"type": "card_update_from_billing_page","status": "completed",+ "is_manual_license_management_upgrade_session": False,"event_handler": {"status": "failed","error": {"message": "Your card was declined.", "description": "card error"},@@ -2194,6 +2199,7 @@ class StripeTest(StripeTestCase):{"type": "card_update_from_billing_page","status": "completed",+ "is_manual_license_management_upgrade_session": False,"event_handler": {"status": "succeeded"},},)@@ -2218,6 +2224,20 @@ class StripeTest(StripeTestCase):2, RealmAuditLog.objects.filter(event_type=RealmAuditLog.STRIPE_CARD_CHANGED).count())+ # Test if manual license management upgrade session is created and is successfully recovered.+ start_session_json_response = self.client_post(+ "/json/upgrade/session/start_card_update_session", {"manual_license_management": "true"}+ )+ response_dict = self.assert_json_success(start_session_json_response)+ self.assert_details_of_valid_session_from_event_status_endpoint(+ response_dict["stripe_session_id"],+ {+ "type": "card_update_from_upgrade_page",+ "status": "created",+ "is_manual_license_management_upgrade_session": True,+ },+ )+def test_downgrade(self) -> None:user = self.example_user("hamlet")self.login_user(user)diff --git a/corporate/views/session.py b/corporate/views/session.pyindex db4b4e8d552..575b4d24608 100644--- a/corporate/views/session.py+++ b/corporate/views/session.py@@ -5,7 +5,9 @@ from django.http import HttpRequest, HttpResponsefrom corporate.lib.stripe import RealmBillingSessionfrom corporate.models import Sessionfrom zerver.decorator import require_billing_access, require_organization_member+from zerver.lib.request import REQ, has_request_variablesfrom zerver.lib.response import json_success+from zerver.lib.validator import check_boolfrom zerver.models import UserProfilebilling_logger = logging.getLogger("corporate.stripe")@@ -32,8 +34,11 @@ def start_card_update_stripe_session(request: HttpRequest, user: UserProfile) ->@require_organization_member+@has_request_variablesdef start_card_update_stripe_session_for_realm_upgrade(- request: HttpRequest, user: UserProfile+ request: HttpRequest,+ user: UserProfile,+ manual_license_management: bool = REQ(default=False, json_validator=check_bool),) -> HttpResponse:billing_session = RealmBillingSession(user)metadata = {@@ -41,7 +46,7 @@ def start_card_update_stripe_session_for_realm_upgrade("user_id": user.id,}stripe_session = billing_session.create_stripe_update_card_for_realm_upgrade_session(- metadata, Session.CARD_UPDATE_FROM_UPGRADE_PAGE+ metadata, Session.CARD_UPDATE_FROM_UPGRADE_PAGE, manual_license_management)return json_success(request,diff --git a/templates/corporate/upgrade.html b/templates/corporate/upgrade.htmlindex 9c311babcb2..4bd58e6c792 100644--- a/templates/corporate/upgrade.html+++ b/templates/corporate/upgrade.html@@ -174,6 +174,11 @@<div id="autopay-error" class="alert alert-danger upgrade-page-error hide"></div></div></form>+ {% if manual_license_management %}+ <form id="upgrade-cardchange-form">+ <input type="hidden" name="manual_license_management" value="true" />+ </form>+ {% endif %}<div class="input-box upgrade-page-field"><div class="support-link not-editable-realm-field">To pay by invoice or for any other questions, contact <a href="mailto:[email protected]">[email protected]</a>.diff --git a/web/src/billing/event_status.ts b/web/src/billing/event_status.tsindex 7c388ae53a4..b3f3296c20b 100644--- a/web/src/billing/event_status.ts+++ b/web/src/billing/event_status.ts@@ -10,6 +10,7 @@ const stripe_response_schema = z.object({type: z.string(),stripe_payment_intent_id: z.string().optional(),status: z.string(),+ is_manual_license_management_upgrade_session: z.boolean().optional(),event_handler: z.object({status: z.string(),@@ -56,7 +57,11 @@ function handle_session_complete_event(session: StripeSession): void {break;case "card_update_from_upgrade_page":message = "Card successfully added! Returning to billing…";- redirect_to = "/upgrade/";+ if (session.is_manual_license_management_upgrade_session) {+ redirect_to = "/upgrade/?manual_license_management=true";+ } else {+ redirect_to = "/upgrade/";+ }break;}update_status_and_redirect(message, redirect_to);