Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
stripe: Change pricing for plus plan.
Aman Agrawal42bbeb6247af
diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.pyindex fb45f2e13d5..5554d2d402c 100644--- a/corporate/lib/stripe.py+++ b/corporate/lib/stripe.py@@ -3871,9 +3871,7 @@ class RealmBillingSession(BillingSession):plan_type = Realm.PLAN_TYPE_STANDARD_FREEelif tier == CustomerPlan.TIER_CLOUD_STANDARD:plan_type = Realm.PLAN_TYPE_STANDARD- elif (- tier == CustomerPlan.TIER_CLOUD_PLUS- ): # nocoverage # Plus plan doesn't use this code path yet.+ elif tier == CustomerPlan.TIER_CLOUD_PLUS:plan_type = Realm.PLAN_TYPE_PLUSelse:raise AssertionError("Unexpected tier")@@ -4976,7 +4974,7 @@ def get_price_per_license() -> int:price_map: Dict[int, Dict[str, int]] = {CustomerPlan.TIER_CLOUD_STANDARD: {"Annual": 8000, "Monthly": 800},- CustomerPlan.TIER_CLOUD_PLUS: {"Annual": 16000, "Monthly": 1600},+ CustomerPlan.TIER_CLOUD_PLUS: {"Annual": 12000, "Monthly": 1200},CustomerPlan.TIER_SELF_HOSTED_BASIC: {"Annual": 4200, "Monthly": 350},CustomerPlan.TIER_SELF_HOSTED_BUSINESS: {"Annual": 8000, "Monthly": 800},# To help with processing discount request on support page.diff --git a/corporate/tests/stripe_fixtures/change_plan_tier_from_standard_to_plus--Invoice.create.1.json b/corporate/tests/stripe_fixtures/change_plan_tier_from_standard_to_plus--Invoice.create.1.jsonindex 7e5d6adbd0d..584d0993385 100644--- a/corporate/tests/stripe_fixtures/change_plan_tier_from_standard_to_plus--Invoice.create.1.json+++ b/corporate/tests/stripe_fixtures/change_plan_tier_from_standard_to_plus--Invoice.create.1.json@@ -2,9 +2,9 @@"account_country": "US","account_name": "Kandra Labs, Inc.","account_tax_ids": null,- "amount_due": 7200,+ "amount_due": 3600,"amount_paid": 0,- "amount_remaining": 7200,+ "amount_remaining": 3600,"amount_shipping": 0,"application": null,"application_fee_amount": null,@@ -52,8 +52,8 @@"lines": {"data": [{- "amount": 14400,- "amount_excluding_tax": 14400,+ "amount": 10800,+ "amount_excluding_tax": 10800,"currency": "usd","description": "Zulip Cloud Plus - renewal","discount_amounts": [],@@ -88,8 +88,8 @@"tiers_mode": null,"transform_quantity": null,"type": "one_time",- "unit_amount": 1600,- "unit_amount_decimal": "1600"+ "unit_amount": 1200,+ "unit_amount_decimal": "1200"},"proration": false,"proration_details": {@@ -100,7 +100,7 @@"tax_amounts": [],"tax_rates": [],"type": "invoiceitem",- "unit_amount_excluding_tax": "1600"+ "unit_amount_excluding_tax": "1200"}],"has_more": false,@@ -150,13 +150,13 @@"subscription_details": {"metadata": null},- "subtotal": 14400,- "subtotal_excluding_tax": 14400,+ "subtotal": 10800,+ "subtotal_excluding_tax": 10800,"tax": null,"test_clock": null,- "total": 14400,+ "total": 10800,"total_discount_amounts": [],- "total_excluding_tax": 14400,+ "total_excluding_tax": 10800,"total_tax_amounts": [],"transfer_data": null,"webhooks_delivered_at": nulldiff --git a/corporate/tests/stripe_fixtures/change_plan_tier_from_standard_to_plus--Invoice.finalize_invoice.1.json b/corporate/tests/stripe_fixtures/change_plan_tier_from_standard_to_plus--Invoice.finalize_invoice.1.jsonindex c4b76be668f..28d6a8f4fcb 100644--- a/corporate/tests/stripe_fixtures/change_plan_tier_from_standard_to_plus--Invoice.finalize_invoice.1.json+++ b/corporate/tests/stripe_fixtures/change_plan_tier_from_standard_to_plus--Invoice.finalize_invoice.1.json@@ -2,9 +2,9 @@"account_country": "US","account_name": "Kandra Labs, Inc.","account_tax_ids": null,- "amount_due": 7200,+ "amount_due": 3600,"amount_paid": 0,- "amount_remaining": 7200,+ "amount_remaining": 3600,"amount_shipping": 0,"application": null,"application_fee_amount": null,@@ -41,9 +41,9 @@"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBPU0syRlc3MWNLNFl1NTU3Wnl6TGQ4cW9zNFRHLDEwMzI5ODU1OA0200PK7p99QH?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9Qdnl1SmpnTWZ2Smc5QnhjdDJQTkY1SFpYZWt0RXU1LDEwMzc5NTI1Ng0200K50EuBcH?s=ap","id": "in_NORMALIZED00000000000001",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBPU0syRlc3MWNLNFl1NTU3Wnl6TGQ4cW9zNFRHLDEwMzI5ODU1OA0200PK7p99QH/pdf?s=ap",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9Qdnl1SmpnTWZ2Smc5QnhjdDJQTkY1SFpYZWt0RXU1LDEwMzc5NTI1Ng0200K50EuBcH/pdf?s=ap","issuer": {"type": "self"},@@ -52,8 +52,8 @@"lines": {"data": [{- "amount": 14400,- "amount_excluding_tax": 14400,+ "amount": 10800,+ "amount_excluding_tax": 10800,"currency": "usd","description": "Zulip Cloud Plus - renewal","discount_amounts": [],@@ -88,8 +88,8 @@"tiers_mode": null,"transform_quantity": null,"type": "one_time",- "unit_amount": 1600,- "unit_amount_decimal": "1600"+ "unit_amount": 1200,+ "unit_amount_decimal": "1200"},"proration": false,"proration_details": {@@ -100,7 +100,7 @@"tax_amounts": [],"tax_rates": [],"type": "invoiceitem",- "unit_amount_excluding_tax": "1600"+ "unit_amount_excluding_tax": "1200"}],"has_more": false,@@ -150,13 +150,13 @@"subscription_details": {"metadata": null},- "subtotal": 14400,- "subtotal_excluding_tax": 14400,+ "subtotal": 10800,+ "subtotal_excluding_tax": 10800,"tax": null,"test_clock": null,- "total": 14400,+ "total": 10800,"total_discount_amounts": [],- "total_excluding_tax": 14400,+ "total_excluding_tax": 10800,"total_tax_amounts": [],"transfer_data": null,"webhooks_delivered_at": nulldiff --git a/corporate/tests/stripe_fixtures/change_plan_tier_from_standard_to_plus--Invoice.list.1.json b/corporate/tests/stripe_fixtures/change_plan_tier_from_standard_to_plus--Invoice.list.1.jsonindex 1d2fd28c0e3..f845c9e9d5b 100644--- a/corporate/tests/stripe_fixtures/change_plan_tier_from_standard_to_plus--Invoice.list.1.json+++ b/corporate/tests/stripe_fixtures/change_plan_tier_from_standard_to_plus--Invoice.list.1.json@@ -4,9 +4,9 @@"account_country": "US","account_name": "Kandra Labs, Inc.","account_tax_ids": null,- "amount_due": 7200,+ "amount_due": 3600,"amount_paid": 0,- "amount_remaining": 7200,+ "amount_remaining": 3600,"amount_shipping": 0,"application": null,"application_fee_amount": null,@@ -43,9 +43,9 @@"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBPU0syRlc3MWNLNFl1NTU3Wnl6TGQ4cW9zNFRHLDEwMzI5ODU1OA0200PK7p99QH?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9Qdnl1SmpnTWZ2Smc5QnhjdDJQTkY1SFpYZWt0RXU1LDEwMzc5NTI1Ng0200K50EuBcH?s=ap","id": "in_NORMALIZED00000000000001",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBPU0syRlc3MWNLNFl1NTU3Wnl6TGQ4cW9zNFRHLDEwMzI5ODU1OA0200PK7p99QH/pdf?s=ap",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9Qdnl1SmpnTWZ2Smc5QnhjdDJQTkY1SFpYZWt0RXU1LDEwMzc5NTI1Ng0200K50EuBcH/pdf?s=ap","issuer": {"type": "self"},@@ -54,8 +54,8 @@"lines": {"data": [{- "amount": 14400,- "amount_excluding_tax": 14400,+ "amount": 10800,+ "amount_excluding_tax": 10800,"currency": "usd","description": "Zulip Cloud Plus - renewal","discount_amounts": [],@@ -90,8 +90,8 @@"tiers_mode": null,"transform_quantity": null,"type": "one_time",- "unit_amount": 1600,- "unit_amount_decimal": "1600"+ "unit_amount": 1200,+ "unit_amount_decimal": "1200"},"proration": false,"proration_details": {@@ -102,7 +102,7 @@"tax_amounts": [],"tax_rates": [],"type": "invoiceitem",- "unit_amount_excluding_tax": "1600"+ "unit_amount_excluding_tax": "1200"}],"has_more": false,@@ -152,13 +152,13 @@"subscription_details": {"metadata": null},- "subtotal": 14400,- "subtotal_excluding_tax": 14400,+ "subtotal": 10800,+ "subtotal_excluding_tax": 10800,"tax": null,"test_clock": null,- "total": 14400,+ "total": 10800,"total_discount_amounts": [],- "total_excluding_tax": 14400,+ "total_excluding_tax": 10800,"total_tax_amounts": [],"transfer_data": null,"webhooks_delivered_at": nulldiff --git a/corporate/tests/stripe_fixtures/change_plan_tier_from_standard_to_plus--InvoiceItem.create.1.json b/corporate/tests/stripe_fixtures/change_plan_tier_from_standard_to_plus--InvoiceItem.create.1.jsonindex 386176bf860..4174b380d16 100644--- a/corporate/tests/stripe_fixtures/change_plan_tier_from_standard_to_plus--InvoiceItem.create.1.json+++ b/corporate/tests/stripe_fixtures/change_plan_tier_from_standard_to_plus--InvoiceItem.create.1.json@@ -1,5 +1,5 @@{- "amount": 14400,+ "amount": 10800,"currency": "usd","customer": "cus_NORMALIZED0001","date": 1000000000,@@ -34,14 +34,14 @@"tiers_mode": null,"transform_quantity": null,"type": "one_time",- "unit_amount": 1600,- "unit_amount_decimal": "1600"+ "unit_amount": 1200,+ "unit_amount_decimal": "1200"},"proration": false,"quantity": 9,"subscription": null,"tax_rates": [],"test_clock": null,- "unit_amount": 1600,- "unit_amount_decimal": "1600"+ "unit_amount": 1200,+ "unit_amount_decimal": "1200"}diff --git a/corporate/tests/stripe_fixtures/customer_has_credit_card_as_default_payment_method--Event.list.10.json b/corporate/tests/stripe_fixtures/customer_has_credit_card_as_default_payment_method--Event.list.10.jsonnew file mode 100644index 00000000000..daa2561cf42--- /dev/null+++ b/corporate/tests/stripe_fixtures/customer_has_credit_card_as_default_payment_method--Event.list.10.json@@ -0,0 +1,287 @@+{+ "data": [+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 7685,+ "amount_paid": 0,+ "amount_remaining": 7685,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": true,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "charge_automatically",+ "created": 1000000000,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0002",+ "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": null,+ "ending_balance": null,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": null,+ "id": "in_NORMALIZED00000000000002",+ "invoice_pdf": null,+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": -2000,+ "amount_excluding_tax": -2000,+ "currency": "usd",+ "description": "$20.00/month new customer discount",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000003",+ "invoice": "in_NORMALIZED00000000000002",+ "invoice_item": "ii_NORMALIZED00000000000003",+ "livemode": false,+ "metadata": {},+ "object": "line_item",+ "period": {+ "end": 1330657445,+ "start": 1328151845+ },+ "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": -2000,+ "unit_amount_decimal": "-2000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 1,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "-2000"+ },+ {+ "amount": 8050,+ "amount_excluding_tax": 8050,+ "currency": "usd",+ "description": "Zulip Basic - renewal",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000004",+ "invoice": "in_NORMALIZED00000000000002",+ "invoice_item": "ii_NORMALIZED00000000000004",+ "livemode": false,+ "metadata": {},+ "object": "line_item",+ "period": {+ "end": 1330657445,+ "start": 1328151845+ },+ "plan": null,+ "price": {+ "active": false,+ "billing_scheme": "per_unit",+ "created": 1000000000,+ "currency": "usd",+ "custom_unit_amount": null,+ "id": "price_NORMALIZED00000000000003",+ "livemode": false,+ "lookup_key": null,+ "metadata": {},+ "nickname": null,+ "object": "price",+ "product": "prod_NORMALIZED0003",+ "recurring": null,+ "tax_behavior": "unspecified",+ "tiers_mode": null,+ "transform_quantity": null,+ "type": "one_time",+ "unit_amount": 350,+ "unit_amount_decimal": "350"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 23,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "350"+ },+ {+ "amount": 1635,+ "amount_excluding_tax": 1635,+ "currency": "usd",+ "description": "Additional license (Jan 4, 2012 - Feb 2, 2012)",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000005",+ "invoice": "in_NORMALIZED00000000000002",+ "invoice_item": "ii_NORMALIZED00000000000005",+ "livemode": false,+ "metadata": {},+ "object": "line_item",+ "period": {+ "end": 1328151845,+ "start": 1325646245+ },+ "plan": null,+ "price": {+ "active": false,+ "billing_scheme": "per_unit",+ "created": 1000000000,+ "currency": "usd",+ "custom_unit_amount": null,+ "id": "price_NORMALIZED00000000000004",+ "livemode": false,+ "lookup_key": null,+ "metadata": {},+ "nickname": null,+ "object": "price",+ "product": "prod_NORMALIZED0004",+ "recurring": null,+ "tax_behavior": "unspecified",+ "tiers_mode": null,+ "transform_quantity": null,+ "type": "one_time",+ "unit_amount": 327,+ "unit_amount_decimal": "327"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 5,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "327"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 3,+ "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"+ },+ "livemode": false,+ "metadata": {},+ "next_payment_attempt": 1000000000,+ "number": null,+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "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": "auto"+ }+ },+ "rendering_options": null,+ "shipping_cost": null,+ "shipping_details": null,+ "starting_balance": 0,+ "statement_descriptor": "Zulip Basic",+ "status": "draft",+ "status_transitions": {+ "finalized_at": null,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 7685,+ "subtotal_excluding_tax": 7685,+ "tax": null,+ "test_clock": null,+ "total": 7685,+ "total_discount_amounts": [],+ "total_excluding_tax": 7685,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": null+ }+ },+ "id": "evt_1P67KgDEQaroqDjs9rX0ywkw",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0002",+ "idempotency_key": "ec4443a4-fda7-4f6b-a3ac-ff9b3f48894c"+ },+ "type": "invoice.created"+ }+ ],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/customer_has_credit_card_as_default_payment_method--Event.list.11.json b/corporate/tests/stripe_fixtures/customer_has_credit_card_as_default_payment_method--Event.list.11.jsonnew file mode 100644index 00000000000..a96d9615985--- /dev/null+++ b/corporate/tests/stripe_fixtures/customer_has_credit_card_as_default_payment_method--Event.list.11.json@@ -0,0 +1,167 @@+{+ "data": [+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "amount": 10000,+ "amount_capturable": 0,+ "amount_details": {+ "tip": {}+ },+ "amount_received": 0,+ "application": null,+ "application_fee_amount": null,+ "automatic_payment_methods": null,+ "canceled_at": null,+ "cancellation_reason": null,+ "capture_method": "automatic",+ "charges": {+ "data": [],+ "has_more": false,+ "object": "list",+ "total_count": 0,+ "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000002"+ },+ "client_secret": "pi_NORMALIZED00000000000002_secret_K7tLEjrIXsUhVwu7Qp5rTGjnF",+ "confirmation_method": "automatic",+ "created": 1000000000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0003",+ "description": "Payment for Invoice",+ "id": "pi_NORMALIZED00000000000002",+ "invoice": "in_NORMALIZED00000000000003",+ "last_payment_error": null,+ "latest_charge": null,+ "livemode": false,+ "metadata": {},+ "next_action": null,+ "object": "payment_intent",+ "on_behalf_of": null,+ "payment_method": null,+ "payment_method_configuration_details": null,+ "payment_method_options": {+ "card": {+ "installments": null,+ "mandate_options": null,+ "network": null,+ "request_three_d_secure": "automatic"+ },+ "cashapp": {}+ },+ "payment_method_types": [+ "card",+ "cashapp"+ ],+ "processing": null,+ "receipt_email": "[email protected]",+ "review": null,+ "setup_future_usage": null,+ "shipping": null,+ "source": null,+ "statement_descriptor": "Zulip Basic",+ "statement_descriptor_suffix": null,+ "status": "requires_payment_method",+ "transfer_data": null,+ "transfer_group": null+ }+ },+ "id": "evt_3P67KhDEQaroqDjs1gCwkzNw",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 2,+ "request": {+ "id": "req_NORMALIZED0003",+ "idempotency_key": "f99b3769-39e7-4f7c-a597-ce855de69782"+ },+ "type": "payment_intent.created"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "amount": 984000,+ "amount_capturable": 0,+ "amount_details": {+ "tip": {}+ },+ "amount_received": 0,+ "application": null,+ "application_fee_amount": null,+ "automatic_payment_methods": null,+ "canceled_at": null,+ "cancellation_reason": null,+ "capture_method": "automatic",+ "charges": {+ "data": [],+ "has_more": false,+ "object": "list",+ "total_count": 0,+ "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000003"+ },+ "client_secret": "pi_NORMALIZED00000000000003_secret_2gD6hxBXToGwRnaABpdOibD2T",+ "confirmation_method": "automatic",+ "created": 1000000000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0004",+ "description": "Payment for Invoice",+ "id": "pi_NORMALIZED00000000000003",+ "invoice": "in_NORMALIZED00000000000004",+ "last_payment_error": null,+ "latest_charge": null,+ "livemode": false,+ "metadata": {},+ "next_action": null,+ "object": "payment_intent",+ "on_behalf_of": null,+ "payment_method": null,+ "payment_method_configuration_details": null,+ "payment_method_options": {+ "card": {+ "installments": null,+ "mandate_options": null,+ "network": null,+ "request_three_d_secure": "automatic"+ },+ "cashapp": {},+ "wechat_pay": {+ "app_id": null,+ "client": null+ }+ },+ "payment_method_types": [+ "ach_credit_transfer",+ "card",+ "cashapp",+ "wechat_pay"+ ],+ "processing": null,+ "receipt_email": "[email protected]",+ "review": null,+ "setup_future_usage": null,+ "shipping": null,+ "source": null,+ "statement_descriptor": "Zulip Cloud Standard",+ "statement_descriptor_suffix": null,+ "status": "requires_payment_method",+ "transfer_data": null,+ "transfer_group": null+ }+ },+ "id": "evt_3P67KhDEQaroqDjs17D0UnpA",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 2,+ "request": {+ "id": "req_NORMALIZED0004",+ "idempotency_key": "65e84c04-68bc-4b14-92ff-3ca0b94df549"+ },+ "type": "payment_intent.created"+ }+ ],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/customer_has_credit_card_as_default_payment_method--Event.list.12.json b/corporate/tests/stripe_fixtures/customer_has_credit_card_as_default_payment_method--Event.list.12.jsonnew file mode 100644index 00000000000..4b1c6816e8c--- /dev/null+++ b/corporate/tests/stripe_fixtures/customer_has_credit_card_as_default_payment_method--Event.list.12.json@@ -0,0 +1,824 @@+{+ "data": [+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "ach_credit_transfer": {+ "account_number": "test_NORMALIZED02",+ "bank_name": "TEST BANK",+ "fingerprint": "NORMALIZED000002",+ "refund_account_holder_name": null,+ "refund_account_holder_type": null,+ "refund_routing_number": null,+ "routing_number": "110000000",+ "swift_code": "TSTEZ122"+ },+ "amount": null,+ "client_secret": "src_client_secret_NORMALIZED00000000000001",+ "created": 1000000000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0004",+ "flow": "receiver",+ "id": "src_NORMALIZED00000000000001",+ "livemode": false,+ "metadata": {},+ "object": "source",+ "owner": {+ "address": null,+ "email": "[email protected]",+ "name": null,+ "phone": null,+ "verified_address": null,+ "verified_email": null,+ "verified_name": null,+ "verified_phone": null+ },+ "receiver": {+ "address": "000000000-test_NORMALIZED01",+ "amount_charged": 0,+ "amount_received": 0,+ "amount_returned": 0,+ "refund_attributes_method": "email",+ "refund_attributes_status": "missing"+ },+ "statement_descriptor": null,+ "status": "pending",+ "type": "ach_credit_transfer",+ "usage": "reusable"+ }+ },+ "id": "evt_1P67KhDEQaroqDjskRjff5SZ",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 2,+ "request": {+ "id": null,+ "idempotency_key": "7b296295-6688-40f3-9305-da5dc36c6872"+ },+ "type": "customer.source.created"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 984000,+ "amount_paid": 0,+ "amount_remaining": 984000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": true,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "send_invoice",+ "created": 1000000000,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0004",+ "customer_address": null,+ "customer_email": "[email protected]",+ "customer_name": null,+ "customer_phone": null,+ "customer_shipping": null,+ "customer_tax_exempt": "none",+ "customer_tax_ids": [],+ "default_payment_method": null,+ "default_source": null,+ "default_tax_rates": [],+ "description": null,+ "discount": null,+ "discounts": [],+ "due_date": 1000000000,+ "effective_at": 1000000000,+ "ending_balance": 0,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKMXpQYmtwSUpjRVVsSEpxaGFoMklCODBuZWZKLDEwMzc5NjczOQ0200kyQw1rc2?s=ap",+ "id": "in_NORMALIZED00000000000004",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKMXpQYmtwSUpjRVVsSEpxaGFoMklCODBuZWZKLDEwMzc5NjczOQ0200kyQw1rc2/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 984000,+ "amount_excluding_tax": 984000,+ "currency": "usd",+ "description": "Zulip Cloud Standard - renewal",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000006",+ "invoice": "in_NORMALIZED00000000000004",+ "invoice_item": "ii_NORMALIZED00000000000006",+ "livemode": false,+ "metadata": {},+ "object": "line_item",+ "period": {+ "end": 1388631845,+ "start": 1357095845+ },+ "plan": null,+ "price": {+ "active": false,+ "billing_scheme": "per_unit",+ "created": 1000000000,+ "currency": "usd",+ "custom_unit_amount": null,+ "id": "price_NORMALIZED00000000000005",+ "livemode": false,+ "lookup_key": null,+ "metadata": {},+ "nickname": null,+ "object": "price",+ "product": "prod_NORMALIZED0005",+ "recurring": null,+ "tax_behavior": "unspecified",+ "tiers_mode": null,+ "transform_quantity": null,+ "type": "one_time",+ "unit_amount": 8000,+ "unit_amount_decimal": "8000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 123,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "8000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000004/lines"+ },+ "livemode": false,+ "metadata": {},+ "next_payment_attempt": null,+ "number": "NORMALI-0002",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "paid_out_of_band": false,+ "payment_intent": "pi_NORMALIZED00000000000003",+ "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": "open",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 984000,+ "subtotal_excluding_tax": 984000,+ "tax": null,+ "test_clock": null,+ "total": 984000,+ "total_discount_amounts": [],+ "total_excluding_tax": 984000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": null+ }+ },+ "id": "evt_1P67KhDEQaroqDjsUISBo7pp",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 2,+ "request": {+ "id": "req_NORMALIZED0004",+ "idempotency_key": "65e84c04-68bc-4b14-92ff-3ca0b94df549"+ },+ "type": "invoice.finalized"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 984000,+ "amount_paid": 0,+ "amount_remaining": 984000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": true,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "send_invoice",+ "created": 1000000000,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0004",+ "customer_address": null,+ "customer_email": "[email protected]",+ "customer_name": null,+ "customer_phone": null,+ "customer_shipping": null,+ "customer_tax_exempt": "none",+ "customer_tax_ids": [],+ "default_payment_method": null,+ "default_source": null,+ "default_tax_rates": [],+ "description": null,+ "discount": null,+ "discounts": [],+ "due_date": 1000000000,+ "effective_at": 1000000000,+ "ending_balance": 0,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKMXpQYmtwSUpjRVVsSEpxaGFoMklCODBuZWZKLDEwMzc5NjczOQ0200kyQw1rc2?s=ap",+ "id": "in_NORMALIZED00000000000004",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKMXpQYmtwSUpjRVVsSEpxaGFoMklCODBuZWZKLDEwMzc5NjczOQ0200kyQw1rc2/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 984000,+ "amount_excluding_tax": 984000,+ "currency": "usd",+ "description": "Zulip Cloud Standard - renewal",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000006",+ "invoice": "in_NORMALIZED00000000000004",+ "invoice_item": "ii_NORMALIZED00000000000006",+ "livemode": false,+ "metadata": {},+ "object": "line_item",+ "period": {+ "end": 1388631845,+ "start": 1357095845+ },+ "plan": null,+ "price": {+ "active": false,+ "billing_scheme": "per_unit",+ "created": 1000000000,+ "currency": "usd",+ "custom_unit_amount": null,+ "id": "price_NORMALIZED00000000000005",+ "livemode": false,+ "lookup_key": null,+ "metadata": {},+ "nickname": null,+ "object": "price",+ "product": "prod_NORMALIZED0005",+ "recurring": null,+ "tax_behavior": "unspecified",+ "tiers_mode": null,+ "transform_quantity": null,+ "type": "one_time",+ "unit_amount": 8000,+ "unit_amount_decimal": "8000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 123,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "8000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000004/lines"+ },+ "livemode": false,+ "metadata": {},+ "next_payment_attempt": null,+ "number": "NORMALI-0002",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "paid_out_of_band": false,+ "payment_intent": "pi_NORMALIZED00000000000003",+ "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": "open",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 984000,+ "subtotal_excluding_tax": 984000,+ "tax": null,+ "test_clock": null,+ "total": 984000,+ "total_discount_amounts": [],+ "total_excluding_tax": 984000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": null+ },+ "previous_attributes": {+ "effective_at": null,+ "ending_balance": null,+ "hosted_invoice_url": null,+ "invoice_pdf": null,+ "number": null,+ "payment_intent": null,+ "rendering": {+ "pdf": {+ "page_size": "auto"+ }+ },+ "status": "draft",+ "status_transitions": {+ "finalized_at": null+ }+ }+ },+ "id": "evt_1P67KhDEQaroqDjs3ulITGa3",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0004",+ "idempotency_key": "65e84c04-68bc-4b14-92ff-3ca0b94df549"+ },+ "type": "invoice.updated"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 10000,+ "amount_paid": 0,+ "amount_remaining": 10000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": false,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "charge_automatically",+ "created": 1000000000,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0003",+ "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKNHNTd2wzejQ4N2VoZ1FRd2JkblJzZTJRVHlILDEwMzc5NjczOQ0200RRoy0P6l?s=ap",+ "id": "in_NORMALIZED00000000000003",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKNHNTd2wzejQ4N2VoZ1FRd2JkblJzZTJRVHlILDEwMzc5NjczOQ0200RRoy0P6l/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 10000,+ "amount_excluding_tax": 10000,+ "currency": "usd",+ "description": "Zulip Basic",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000007",+ "invoice": "in_NORMALIZED00000000000003",+ "invoice_item": "ii_NORMALIZED00000000000007",+ "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_NORMALIZED00000000000006",+ "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": 10000,+ "unit_amount_decimal": "10000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 1,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "10000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000003/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "2",+ "license_management": "automatic",+ "licenses": "11",+ "on_free_trial": "False",+ "plan_tier": "103"+ },+ "next_payment_attempt": null,+ "number": "NORMALI-0003",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "paid_out_of_band": false,+ "payment_intent": "pi_NORMALIZED00000000000002",+ "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 Basic",+ "status": "open",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 10000,+ "subtotal_excluding_tax": 10000,+ "tax": null,+ "test_clock": null,+ "total": 10000,+ "total_discount_amounts": [],+ "total_excluding_tax": 10000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": null+ }+ },+ "id": "evt_1P67KhDEQaroqDjsb2galo81",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 2,+ "request": {+ "id": "req_NORMALIZED0003",+ "idempotency_key": "f99b3769-39e7-4f7c-a597-ce855de69782"+ },+ "type": "invoice.finalized"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 10000,+ "amount_paid": 0,+ "amount_remaining": 10000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": false,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "charge_automatically",+ "created": 1000000000,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0003",+ "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKNHNTd2wzejQ4N2VoZ1FRd2JkblJzZTJRVHlILDEwMzc5NjczOQ0200RRoy0P6l?s=ap",+ "id": "in_NORMALIZED00000000000003",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKNHNTd2wzejQ4N2VoZ1FRd2JkblJzZTJRVHlILDEwMzc5NjczOQ0200RRoy0P6l/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 10000,+ "amount_excluding_tax": 10000,+ "currency": "usd",+ "description": "Zulip Basic",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000007",+ "invoice": "in_NORMALIZED00000000000003",+ "invoice_item": "ii_NORMALIZED00000000000007",+ "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_NORMALIZED00000000000006",+ "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": 10000,+ "unit_amount_decimal": "10000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 1,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "10000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000003/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "2",+ "license_management": "automatic",+ "licenses": "11",+ "on_free_trial": "False",+ "plan_tier": "103"+ },+ "next_payment_attempt": null,+ "number": "NORMALI-0003",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "paid_out_of_band": false,+ "payment_intent": "pi_NORMALIZED00000000000002",+ "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 Basic",+ "status": "open",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 10000,+ "subtotal_excluding_tax": 10000,+ "tax": null,+ "test_clock": null,+ "total": 10000,+ "total_discount_amounts": [],+ "total_excluding_tax": 10000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": null+ },+ "previous_attributes": {+ "effective_at": null,+ "ending_balance": null,+ "hosted_invoice_url": null,+ "invoice_pdf": null,+ "number": null,+ "payment_intent": null,+ "rendering": {+ "pdf": {+ "page_size": "auto"+ }+ },+ "status": "draft",+ "status_transitions": {+ "finalized_at": null+ }+ }+ },+ "id": "evt_1P67KhDEQaroqDjsbZUxzSnc",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0003",+ "idempotency_key": "f99b3769-39e7-4f7c-a597-ce855de69782"+ },+ "type": "invoice.updated"+ }+ ],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/customer_has_credit_card_as_default_payment_method--Event.list.13.json b/corporate/tests/stripe_fixtures/customer_has_credit_card_as_default_payment_method--Event.list.13.jsonnew file mode 100644index 00000000000..6d922067afe--- /dev/null+++ b/corporate/tests/stripe_fixtures/customer_has_credit_card_as_default_payment_method--Event.list.13.json@@ -0,0 +1,6 @@+{+ "data": [],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/invoice_initial_remote_realm_upgrade--Event.list.7.json b/corporate/tests/stripe_fixtures/invoice_initial_remote_realm_upgrade--Event.list.7.jsonnew file mode 100644index 00000000000..6d922067afe--- /dev/null+++ b/corporate/tests/stripe_fixtures/invoice_initial_remote_realm_upgrade--Event.list.7.json@@ -0,0 +1,6 @@+{+ "data": [],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/invoice_plan--Event.list.10.json b/corporate/tests/stripe_fixtures/invoice_plan--Event.list.10.jsonnew file mode 100644index 00000000000..e101adc6a78--- /dev/null+++ b/corporate/tests/stripe_fixtures/invoice_plan--Event.list.10.json@@ -0,0 +1,234 @@+{+ "data": [+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 3600,+ "amount_paid": 0,+ "amount_remaining": 3600,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": true,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "send_invoice",+ "created": 1000000000,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0003",+ "customer_address": null,+ "customer_email": "[email protected]",+ "customer_name": null,+ "customer_phone": null,+ "customer_shipping": null,+ "customer_tax_exempt": "none",+ "customer_tax_ids": [],+ "default_payment_method": null,+ "default_source": null,+ "default_tax_rates": [],+ "description": null,+ "discount": null,+ "discounts": [],+ "due_date": 1000000000,+ "effective_at": null,+ "ending_balance": null,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": null,+ "id": "in_NORMALIZED00000000000001",+ "invoice_pdf": null,+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 10800,+ "amount_excluding_tax": 10800,+ "currency": "usd",+ "description": "Zulip Cloud Plus - renewal",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000001",+ "invoice": "in_NORMALIZED00000000000001",+ "invoice_item": "ii_NORMALIZED00000000000001",+ "livemode": false,+ "metadata": {},+ "object": "line_item",+ "period": {+ "end": 1000000000,+ "start": 1000000000+ },+ "plan": null,+ "price": {+ "active": false,+ "billing_scheme": "per_unit",+ "created": 1000000000,+ "currency": "usd",+ "custom_unit_amount": null,+ "id": "price_NORMALIZED00000000000001",+ "livemode": false,+ "lookup_key": null,+ "metadata": {},+ "nickname": null,+ "object": "price",+ "product": "prod_NORMALIZED0001",+ "recurring": null,+ "tax_behavior": "unspecified",+ "tiers_mode": null,+ "transform_quantity": null,+ "type": "one_time",+ "unit_amount": 1200,+ "unit_amount_decimal": "1200"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 9,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "1200"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"+ },+ "livemode": false,+ "metadata": {},+ "next_payment_attempt": null,+ "number": null,+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "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": "auto"+ }+ },+ "rendering_options": null,+ "shipping_cost": null,+ "shipping_details": null,+ "starting_balance": -7200,+ "statement_descriptor": "Zulip Cloud Plus",+ "status": "draft",+ "status_transitions": {+ "finalized_at": null,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 10800,+ "subtotal_excluding_tax": 10800,+ "tax": null,+ "test_clock": null,+ "total": 10800,+ "total_discount_amounts": [],+ "total_excluding_tax": 10800,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": null+ }+ },+ "id": "evt_1P67JoDEQaroqDjs2T5M0M8a",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0002",+ "idempotency_key": "4122fcd2-1868-4a6e-a616-a81230595d14"+ },+ "type": "invoice.created"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "application": null,+ "automatic_payment_methods": null,+ "cancellation_reason": null,+ "client_secret": "seti_1P67JnDEQaroqDjsFIXJqJEi_secret_PvzIsQqUSIy5c92rlnGl9QKBza02xL1",+ "created": 1000000000,+ "customer": "cus_NORMALIZED0004",+ "description": null,+ "flow_directions": null,+ "id": "seti_1P67JnDEQaroqDjsFIXJqJEi",+ "last_setup_error": null,+ "latest_attempt": "setatt_1P67JnDEQaroqDjs4c1Xr9TG",+ "livemode": false,+ "mandate": null,+ "metadata": {},+ "next_action": null,+ "object": "setup_intent",+ "on_behalf_of": null,+ "payment_method": "pm_1P67JnDEQaroqDjsyyK5kMnU",+ "payment_method_configuration_details": null,+ "payment_method_options": {+ "card": {+ "mandate_options": null,+ "network": null,+ "request_three_d_secure": "automatic"+ }+ },+ "payment_method_types": [+ "card"+ ],+ "single_use_mandate": null,+ "status": "succeeded",+ "usage": "off_session"+ }+ },+ "id": "evt_1P67JoDEQaroqDjsFaPRoIgY",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0003",+ "idempotency_key": "bb949a79-a6cd-4f02-9ff8-932034174a57"+ },+ "type": "setup_intent.succeeded"+ }+ ],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/invoice_plan--Event.list.11.json b/corporate/tests/stripe_fixtures/invoice_plan--Event.list.11.jsonnew file mode 100644index 00000000000..c9c4b511bfc--- /dev/null+++ b/corporate/tests/stripe_fixtures/invoice_plan--Event.list.11.json@@ -0,0 +1,60 @@+{+ "data": [+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": null,+ "default_currency": null,+ "default_source": null,+ "delinquent": false,+ "description": "demo.example.com 6cde5f7a-1f7",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0005",+ "invoice_prefix": "NORMA03",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": "pm_1P67JmDEQaroqDjs3fM8n3NE",+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"+ },+ "name": null,+ "next_invoice_sequence": 1,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+ },+ "previous_attributes": {+ "invoice_settings": {+ "default_payment_method": null+ }+ }+ },+ "id": "evt_1P67JpDEQaroqDjswZoJ7zBz",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 2,+ "request": {+ "id": "req_NORMALIZED0004",+ "idempotency_key": "7f6812f0-cf21-4b10-bfac-255a07614532"+ },+ "type": "customer.updated"+ }+ ],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/invoice_plan--Event.list.12.json b/corporate/tests/stripe_fixtures/invoice_plan--Event.list.12.jsonnew file mode 100644index 00000000000..6d922067afe--- /dev/null+++ b/corporate/tests/stripe_fixtures/invoice_plan--Event.list.12.json@@ -0,0 +1,6 @@+{+ "data": [],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/invoice_plan--Event.list.8.json b/corporate/tests/stripe_fixtures/invoice_plan--Event.list.8.jsonnew file mode 100644index 00000000000..f20671acc25--- /dev/null+++ b/corporate/tests/stripe_fixtures/invoice_plan--Event.list.8.json@@ -0,0 +1,132 @@+{+ "data": [+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "amount": 10800,+ "currency": "usd",+ "customer": "cus_NORMALIZED0003",+ "date": 1000000000,+ "description": "Zulip Cloud Plus - renewal",+ "discountable": false,+ "discounts": [],+ "id": "ii_NORMALIZED00000000000001",+ "invoice": null,+ "livemode": false,+ "metadata": {},+ "object": "invoiceitem",+ "period": {+ "end": 1000000000,+ "start": 1000000000+ },+ "plan": null,+ "price": {+ "active": false,+ "billing_scheme": "per_unit",+ "created": 1000000000,+ "currency": "usd",+ "custom_unit_amount": null,+ "id": "price_NORMALIZED00000000000001",+ "livemode": false,+ "lookup_key": null,+ "metadata": {},+ "nickname": null,+ "object": "price",+ "product": "prod_NORMALIZED0001",+ "recurring": null,+ "tax_behavior": "unspecified",+ "tiers_mode": null,+ "transform_quantity": null,+ "type": "one_time",+ "unit_amount": 1200,+ "unit_amount_decimal": "1200"+ },+ "proration": false,+ "quantity": 9,+ "subscription": null,+ "tax_rates": [],+ "test_clock": null,+ "unit_amount": 1200,+ "unit_amount_decimal": "1200"+ }+ },+ "id": "evt_1P67JoDEQaroqDjsCdxfgCVB",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 2,+ "request": {+ "id": "req_NORMALIZED0021",+ "idempotency_key": "5d928c9b-47c4-4c53-a049-753db261db0a"+ },+ "type": "invoiceitem.created"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "billing_details": {+ "address": {+ "city": "San Francisco",+ "country": "US",+ "line1": "123 Main St",+ "line2": null,+ "postal_code": "94105",+ "state": "CA"+ },+ "email": null,+ "name": "John Doe",+ "phone": null+ },+ "card": {+ "brand": "visa",+ "checks": {+ "address_line1_check": null,+ "address_postal_code_check": null,+ "cvc_check": "pass"+ },+ "country": "US",+ "display_brand": "visa",+ "exp_month": 4,+ "exp_year": 2025,+ "fingerprint": "NORMALIZED000001",+ "funding": "credit",+ "generated_from": null,+ "last4": "4242",+ "networks": {+ "available": [+ "visa"+ ],+ "preferred": null+ },+ "three_d_secure_usage": {+ "supported": true+ },+ "wallet": null+ },+ "created": 1000000000,+ "customer": "cus_NORMALIZED0005",+ "id": "pm_1P67JmDEQaroqDjs3fM8n3NE",+ "livemode": false,+ "metadata": {},+ "object": "payment_method",+ "type": "card"+ }+ },+ "id": "evt_1P67JoDEQaroqDjs9fFwHgkM",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 1,+ "request": {+ "id": "req_NORMALIZED0022",+ "idempotency_key": "bb8beb31-f9c0-4967-91f2-869214f968d8"+ },+ "type": "payment_method.attached"+ }+ ],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/invoice_plan--Event.list.9.json b/corporate/tests/stripe_fixtures/invoice_plan--Event.list.9.jsonnew file mode 100644index 00000000000..c2d538d16b9--- /dev/null+++ b/corporate/tests/stripe_fixtures/invoice_plan--Event.list.9.json@@ -0,0 +1,70 @@+{+ "data": [+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "billing_details": {+ "address": {+ "city": "San Francisco",+ "country": "US",+ "line1": "123 Main St",+ "line2": null,+ "postal_code": "94105",+ "state": "CA"+ },+ "email": null,+ "name": "John Doe",+ "phone": null+ },+ "card": {+ "brand": "visa",+ "checks": {+ "address_line1_check": null,+ "address_postal_code_check": null,+ "cvc_check": "pass"+ },+ "country": "US",+ "display_brand": "visa",+ "exp_month": 4,+ "exp_year": 2025,+ "fingerprint": "NORMALIZED000001",+ "funding": "credit",+ "generated_from": null,+ "last4": "4242",+ "networks": {+ "available": [+ "visa"+ ],+ "preferred": null+ },+ "three_d_secure_usage": {+ "supported": true+ },+ "wallet": null+ },+ "created": 1000000000,+ "customer": "cus_NORMALIZED0004",+ "id": "pm_1P67JnDEQaroqDjsyyK5kMnU",+ "livemode": false,+ "metadata": {},+ "object": "payment_method",+ "type": "card"+ }+ },+ "id": "evt_1P67JoDEQaroqDjsUxXdQZqM",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 2,+ "request": {+ "id": "req_NORMALIZED0003",+ "idempotency_key": "bb949a79-a6cd-4f02-9ff8-932034174a57"+ },+ "type": "payment_method.attached"+ }+ ],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/invoice_plans_as_needed--Event.list.7.json b/corporate/tests/stripe_fixtures/invoice_plans_as_needed--Event.list.7.jsonnew file mode 100644index 00000000000..6d922067afe--- /dev/null+++ b/corporate/tests/stripe_fixtures/invoice_plans_as_needed--Event.list.7.json@@ -0,0 +1,6 @@+{+ "data": [],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/non_sponsorship_billing--Event.list.11.json b/corporate/tests/stripe_fixtures/non_sponsorship_billing--Event.list.11.jsonnew file mode 100644index 00000000000..6d922067afe--- /dev/null+++ b/corporate/tests/stripe_fixtures/non_sponsorship_billing--Event.list.11.json@@ -0,0 +1,6 @@+{+ "data": [],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/payment_method_string--Event.list.5.json b/corporate/tests/stripe_fixtures/payment_method_string--Event.list.5.jsonnew file mode 100644index 00000000000..f7acfe54fdc--- /dev/null+++ b/corporate/tests/stripe_fixtures/payment_method_string--Event.list.5.json@@ -0,0 +1,56 @@+{+ "data": [+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "application": null,+ "automatic_payment_methods": null,+ "cancellation_reason": null,+ "client_secret": "seti_1P67MCDEQaroqDjsEludk9kA_secret_PvzKgLRYaE4cnTtbqc0tKfUQdNJpUKE",+ "created": 1000000000,+ "customer": "cus_NORMALIZED0003",+ "description": null,+ "flow_directions": null,+ "id": "seti_1P67MCDEQaroqDjsEludk9kA",+ "last_setup_error": null,+ "latest_attempt": null,+ "livemode": false,+ "mandate": null,+ "metadata": {},+ "next_action": null,+ "object": "setup_intent",+ "on_behalf_of": null,+ "payment_method": null,+ "payment_method_configuration_details": null,+ "payment_method_options": {+ "card": {+ "mandate_options": null,+ "network": null,+ "request_three_d_secure": "automatic"+ }+ },+ "payment_method_types": [+ "card"+ ],+ "single_use_mandate": null,+ "status": "requires_payment_method",+ "usage": "off_session"+ }+ },+ "id": "evt_1P67MCDEQaroqDjs0C05ciyc",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0011",+ "idempotency_key": "9c6ad1b9-ad9d-4a53-9f4b-85c85a795e50"+ },+ "type": "setup_intent.created"+ }+ ],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/payment_method_string--Event.list.6.json b/corporate/tests/stripe_fixtures/payment_method_string--Event.list.6.jsonnew file mode 100644index 00000000000..6d922067afe--- /dev/null+++ b/corporate/tests/stripe_fixtures/payment_method_string--Event.list.6.json@@ -0,0 +1,6 @@+{+ "data": [],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls_for_remote_server--Event.list.6.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls_for_remote_server--Event.list.6.jsonnew file mode 100644index 00000000000..d1613e29c3b--- /dev/null+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls_for_remote_server--Event.list.6.json@@ -0,0 +1,69 @@+{+ "data": [+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "amount": -2000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0002",+ "date": 1000000000,+ "description": "$20.00/month new customer discount",+ "discountable": false,+ "discounts": [],+ "id": "ii_NORMALIZED00000000000008",+ "invoice": null,+ "livemode": false,+ "metadata": {},+ "object": "invoiceitem",+ "period": {+ "end": 1328151845,+ "start": 1325473445+ },+ "plan": null,+ "price": {+ "active": false,+ "billing_scheme": "per_unit",+ "created": 1000000000,+ "currency": "usd",+ "custom_unit_amount": null,+ "id": "price_NORMALIZED00000000000006",+ "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": -2000,+ "unit_amount_decimal": "-2000"+ },+ "proration": false,+ "quantity": 1,+ "subscription": null,+ "tax_rates": [],+ "test_clock": null,+ "unit_amount": -2000,+ "unit_amount_decimal": "-2000"+ }+ },+ "id": "evt_1P67LtDEQaroqDjswOnQceg9",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0014",+ "idempotency_key": "22523d46-0b8a-4e27-92a8-b036f53c4b85"+ },+ "type": "invoiceitem.created"+ }+ ],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/stripe_billing_portal_urls_for_remote_server--Event.list.7.json b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls_for_remote_server--Event.list.7.jsonnew file mode 100644index 00000000000..6d922067afe--- /dev/null+++ b/corporate/tests/stripe_fixtures/stripe_billing_portal_urls_for_remote_server--Event.list.7.json@@ -0,0 +1,6 @@+{+ "data": [],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.create_balance_transaction.1.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.create_balance_transaction.1.jsonindex 0d8cb482a5f..6c43189e736 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.create_balance_transaction.1.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.create_balance_transaction.1.json@@ -1,11 +1,11 @@{- "amount": -2695,+ "amount": -2636,"created": 1000000000,"credit_note": null,"currency": "usd","customer": "cus_NORMALIZED0001","description": "Credit from early termination of active plan",- "ending_balance": -2695,+ "ending_balance": -2636,"id": "cbtxn_NORMALIZED00000000000001","invoice": null,"livemode": false,diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.modify.1.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.modify.1.jsonindex 651d8988c77..d39e365536b 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.modify.1.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.modify.1.json@@ -13,7 +13,7 @@"invoice_prefix": "NORMA01","invoice_settings": {"custom_fields": null,- "default_payment_method": "pm_1P41kTDEQaroqDjsnRkdmbrR",+ "default_payment_method": "pm_1P66vbDEQaroqDjsUrXkyfgm","footer": null,"rendering_options": null},diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.retrieve.1.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.retrieve.1.jsonindex d3fc1043934..84469be10c5 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.retrieve.1.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.retrieve.1.json@@ -55,7 +55,7 @@},"created": 1000000000,"customer": "cus_NORMALIZED0001",- "id": "pm_1P41kTDEQaroqDjsnRkdmbrR",+ "id": "pm_1P66vbDEQaroqDjsUrXkyfgm","livemode": false,"metadata": {},"object": "payment_method",diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.retrieve.2.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.retrieve.2.jsonindex d3fc1043934..84469be10c5 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.retrieve.2.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.retrieve.2.json@@ -55,7 +55,7 @@},"created": 1000000000,"customer": "cus_NORMALIZED0001",- "id": "pm_1P41kTDEQaroqDjsnRkdmbrR",+ "id": "pm_1P66vbDEQaroqDjsUrXkyfgm","livemode": false,"metadata": {},"object": "payment_method",diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.retrieve.3.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.retrieve.3.jsonindex d3fc1043934..84469be10c5 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.retrieve.3.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.retrieve.3.json@@ -55,7 +55,7 @@},"created": 1000000000,"customer": "cus_NORMALIZED0001",- "id": "pm_1P41kTDEQaroqDjsnRkdmbrR",+ "id": "pm_1P66vbDEQaroqDjsUrXkyfgm","livemode": false,"metadata": {},"object": "payment_method",diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.retrieve.4.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.retrieve.4.jsonindex d3fc1043934..84469be10c5 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.retrieve.4.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Customer.retrieve.4.json@@ -55,7 +55,7 @@},"created": 1000000000,"customer": "cus_NORMALIZED0001",- "id": "pm_1P41kTDEQaroqDjsnRkdmbrR",+ "id": "pm_1P66vbDEQaroqDjsUrXkyfgm","livemode": false,"metadata": {},"object": "payment_method",diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.1.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.1.jsonindex 2654b20b995..9c46bc614f3 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.1.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.1.json@@ -12,21 +12,21 @@"default_currency": null,"default_source": null,"delinquent": false,- "description": "test-realm-2 (test-realm-2)",+ "description": "zulip (Zulip Dev)","discount": null,- "email": "[email protected]",- "id": "cus_NORMALIZED0002",- "invoice_prefix": "NORMA02",+ "email": "[email protected]",+ "id": "cus_NORMALIZED0001",+ "invoice_prefix": "NORMA01","invoice_settings": {"custom_fields": null,- "default_payment_method": null,+ "default_payment_method": "pm_1P66vbDEQaroqDjsUrXkyfgm","footer": null,"rendering_options": null},"livemode": false,"metadata": {- "realm_id": "2",- "realm_str": "test-realm-2"+ "realm_id": "1",+ "realm_str": "zulip"},"name": null,"next_invoice_sequence": 1,@@ -36,17 +36,22 @@"shipping": null,"tax_exempt": "none","test_clock": null+ },+ "previous_attributes": {+ "invoice_settings": {+ "default_payment_method": null+ }}},- "id": "evt_1P41kXDEQaroqDjsCZ2aTSzW",+ "id": "evt_1P66veDEQaroqDjsENGQDs82","livemode": false,"object": "event","pending_webhooks": 0,"request": {"id": "req_NORMALIZED0001",- "idempotency_key": "3c327c5e-e0de-4e49-8c04-02b7e3f7dc63"+ "idempotency_key": "19b1ff8b-f68e-4550-9061-af37759fec35"},- "type": "customer.created"+ "type": "customer.updated"}],"has_more": true,diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.10.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.10.jsonindex 6d922067afe..bbc5a8aec1d 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.10.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.10.json@@ -1,5 +1,298 @@{- "data": [],+ "data": [+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 10000,+ "amount_paid": 0,+ "amount_remaining": 10000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": true,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "charge_automatically",+ "created": 1000000000,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0002",+ "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": null,+ "ending_balance": null,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": null,+ "id": "in_NORMALIZED00000000000002",+ "invoice_pdf": null,+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 10000,+ "amount_excluding_tax": 10000,+ "currency": "usd",+ "description": "Zulip Basic - renewal",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000002",+ "invoice": "in_NORMALIZED00000000000002",+ "invoice_item": "ii_NORMALIZED00000000000002",+ "livemode": false,+ "metadata": {},+ "object": "line_item",+ "period": {+ "end": 1346555045,+ "start": 1343876645+ },+ "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": 10000,+ "unit_amount_decimal": "10000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 1,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "10000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"+ },+ "livemode": false,+ "metadata": {},+ "next_payment_attempt": 1000000000,+ "number": null,+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "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": "auto"+ }+ },+ "rendering_options": null,+ "shipping_cost": null,+ "shipping_details": null,+ "starting_balance": 0,+ "statement_descriptor": "Zulip Basic",+ "status": "draft",+ "status_transitions": {+ "finalized_at": null,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 10000,+ "subtotal_excluding_tax": 10000,+ "tax": null,+ "test_clock": null,+ "total": 10000,+ "total_discount_amounts": [],+ "total_excluding_tax": 10000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": null+ }+ },+ "id": "evt_1P67KxDEQaroqDjs5jvMIGtF",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 2,+ "request": {+ "id": "req_NORMALIZED0002",+ "idempotency_key": "f7ba4586-a7bb-44aa-8a17-27f387bfe0ae"+ },+ "type": "invoice.created"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "amount": 10000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0003",+ "date": 1000000000,+ "description": "Zulip Cloud Standard",+ "discountable": false,+ "discounts": [],+ "id": "ii_NORMALIZED00000000000003",+ "invoice": null,+ "livemode": false,+ "metadata": {},+ "object": "invoiceitem",+ "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": 10000,+ "unit_amount_decimal": "10000"+ },+ "proration": false,+ "quantity": 1,+ "subscription": null,+ "tax_rates": [],+ "test_clock": null,+ "unit_amount": 10000,+ "unit_amount_decimal": "10000"+ }+ },+ "id": "evt_1P67KxDEQaroqDjslYle9zwV",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 1,+ "request": {+ "id": "req_NORMALIZED0003",+ "idempotency_key": "e3a8eb57-ce40-4cc1-9f7b-2ae9bb2f09f1"+ },+ "type": "invoiceitem.created"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": "usd",+ "default_currency": "usd",+ "default_source": null,+ "delinquent": false,+ "description": "test-realm-6 (test-realm-6)",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0003",+ "invoice_prefix": "NORMA02",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": null,+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "realm_id": "2",+ "realm_str": "test-realm-6"+ },+ "name": null,+ "next_invoice_sequence": 1,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+ },+ "previous_attributes": {+ "currency": null,+ "default_currency": null+ }+ },+ "id": "evt_1P67KxDEQaroqDjsvgV9DVGg",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0003",+ "idempotency_key": "e3a8eb57-ce40-4cc1-9f7b-2ae9bb2f09f1"+ },+ "type": "customer.updated"+ }+ ],"has_more": false,"object": "list","url": "/v1/events"diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.11.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.11.jsonnew file mode 100644index 00000000000..f326b61ad96--- /dev/null+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.11.json@@ -0,0 +1,238 @@+{+ "data": [+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 10000,+ "amount_paid": 0,+ "amount_remaining": 10000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": true,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "send_invoice",+ "created": 1000000000,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0003",+ "customer_address": null,+ "customer_email": "[email protected]",+ "customer_name": null,+ "customer_phone": null,+ "customer_shipping": null,+ "customer_tax_exempt": "none",+ "customer_tax_ids": [],+ "default_payment_method": null,+ "default_source": null,+ "default_tax_rates": [],+ "description": null,+ "discount": null,+ "discounts": [],+ "due_date": 1000000000,+ "effective_at": null,+ "ending_balance": null,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": null,+ "id": "in_NORMALIZED00000000000003",+ "invoice_pdf": null,+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 10000,+ "amount_excluding_tax": 10000,+ "currency": "usd",+ "description": "Zulip Cloud Standard",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000003",+ "invoice": "in_NORMALIZED00000000000003",+ "invoice_item": "ii_NORMALIZED00000000000003",+ "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": 10000,+ "unit_amount_decimal": "10000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 1,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "10000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000003/lines"+ },+ "livemode": false,+ "metadata": {},+ "next_payment_attempt": null,+ "number": null,+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "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": "auto"+ }+ },+ "rendering_options": null,+ "shipping_cost": null,+ "shipping_details": null,+ "starting_balance": 0,+ "statement_descriptor": "Zulip Cloud Standard",+ "status": "draft",+ "status_transitions": {+ "finalized_at": null,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 10000,+ "subtotal_excluding_tax": 10000,+ "tax": null,+ "test_clock": null,+ "total": 10000,+ "total_discount_amounts": [],+ "total_excluding_tax": 10000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": null+ }+ },+ "id": "evt_1P67KxDEQaroqDjsCYIVlIKm",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 2,+ "request": {+ "id": "req_NORMALIZED0004",+ "idempotency_key": "0ed376cc-6d9a-4b80-bb71-f93f8cb67816"+ },+ "type": "invoice.created"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": null,+ "default_currency": null,+ "default_source": null,+ "delinquent": false,+ "description": "demo.example.com 6cde5f7a-1f7",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0004",+ "invoice_prefix": "NORMA03",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": "pm_1P67KvDEQaroqDjs8nXGcRQQ",+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"+ },+ "name": null,+ "next_invoice_sequence": 1,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+ },+ "previous_attributes": {+ "invoice_settings": {+ "default_payment_method": null+ }+ }+ },+ "id": "evt_1P67KxDEQaroqDjsGSlxuSza",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0005",+ "idempotency_key": "a3d41c30-9ae4-4005-8126-dba2f3f4f11c"+ },+ "type": "customer.updated"+ }+ ],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.12.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.12.jsonnew file mode 100644index 00000000000..6d922067afe--- /dev/null+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.12.json@@ -0,0 +1,6 @@+{+ "data": [],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.2.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.2.jsonindex b02f6def1ce..419d940a129 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.2.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.2.json@@ -6,61 +6,190 @@"data": {"object": {"amount": 48000,+ "amount_capturable": 0,+ "amount_details": {+ "tip": {}+ },+ "amount_received": 48000,+ "application": null,+ "application_fee_amount": null,+ "automatic_payment_methods": null,+ "canceled_at": null,+ "cancellation_reason": null,+ "capture_method": "automatic",+ "charges": {+ "data": [+ {+ "amount": 48000,+ "amount_captured": 48000,+ "amount_refunded": 0,+ "application": null,+ "application_fee": null,+ "application_fee_amount": null,+ "balance_transaction": "txn_NORMALIZED00000000000002",+ "billing_details": {+ "address": {+ "city": "San Francisco",+ "country": "US",+ "line1": "123 Main St",+ "line2": null,+ "postal_code": "94105",+ "state": "CA"+ },+ "email": null,+ "name": "John Doe",+ "phone": null+ },+ "calculated_statement_descriptor": "ZULIP CLOUD STANDARD",+ "captured": true,+ "created": 1000000000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0001",+ "description": "Payment for Invoice",+ "destination": null,+ "dispute": null,+ "disputed": false,+ "failure_balance_transaction": null,+ "failure_code": null,+ "failure_message": null,+ "fraud_details": {},+ "id": "ch_NORMALIZED00000000000001",+ "invoice": "in_NORMALIZED00000000000001",+ "livemode": false,+ "metadata": {},+ "object": "charge",+ "on_behalf_of": null,+ "order": null,+ "outcome": {+ "network_status": "approved_by_network",+ "reason": null,+ "risk_level": "normal",+ "risk_score": 0,+ "seller_message": "Payment complete.",+ "type": "authorized"+ },+ "paid": true,+ "payment_intent": "pi_NORMALIZED00000000000001",+ "payment_method": "pm_1P66vbDEQaroqDjsUrXkyfgm",+ "payment_method_details": {+ "card": {+ "amount_authorized": 48000,+ "brand": "visa",+ "checks": {+ "address_line1_check": null,+ "address_postal_code_check": null,+ "cvc_check": "pass"+ },+ "country": "US",+ "exp_month": 4,+ "exp_year": 2025,+ "extended_authorization": {+ "status": "disabled"+ },+ "fingerprint": "NORMALIZED000001",+ "funding": "credit",+ "incremental_authorization": {+ "status": "unavailable"+ },+ "installments": null,+ "last4": "4242",+ "mandate": null,+ "multicapture": {+ "status": "unavailable"+ },+ "network": "visa",+ "network_token": {+ "used": false+ },+ "overcapture": {+ "maximum_amount_capturable": 48000,+ "status": "unavailable"+ },+ "three_d_secure": null,+ "wallet": null+ },+ "type": "card"+ },+ "radar_options": {},+ "receipt_email": "[email protected]",+ "receipt_number": null,+ "receipt_url": "https://pay.stripe.com/receipts/invoices/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKPjf-LAGMgYoWEB6pKc6LBb9f4OGW4Rl9xi6fHactiaVswCfaxpXl23AzmDIzZbl1M_HLtNCTctaRPK8?s=ap",+ "refunded": false,+ "refunds": {+ "data": [],+ "has_more": false,+ "object": "list",+ "total_count": 0,+ "url": "/v1/charges/ch_NORMALIZED00000000000001/refunds"+ },+ "review": null,+ "shipping": null,+ "source": null,+ "source_transfer": null,+ "statement_descriptor": "Zulip Cloud Standard",+ "statement_descriptor_suffix": null,+ "status": "succeeded",+ "transfer_data": null,+ "transfer_group": null+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000001"+ },+ "client_secret": "pi_NORMALIZED00000000000001_secret_5wXX5ya6BjJ9n0jvPxoJ17hp6",+ "confirmation_method": "automatic",+ "created": 1000000000,"currency": "usd","customer": "cus_NORMALIZED0001",- "date": 1000000000,- "description": "Zulip Cloud Standard",- "discountable": false,- "discounts": [],- "id": "ii_NORMALIZED00000000000001",- "invoice": null,+ "description": "Payment for Invoice",+ "id": "pi_NORMALIZED00000000000001",+ "invoice": "in_NORMALIZED00000000000001",+ "last_payment_error": null,+ "latest_charge": "ch_NORMALIZED00000000000001","livemode": false,"metadata": {},- "object": "invoiceitem",- "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"+ "next_action": null,+ "object": "payment_intent",+ "on_behalf_of": null,+ "payment_method": "pm_1P66vbDEQaroqDjsUrXkyfgm",+ "payment_method_configuration_details": null,+ "payment_method_options": {+ "card": {+ "installments": null,+ "mandate_options": null,+ "network": null,+ "request_three_d_secure": "automatic"+ },+ "cashapp": {}},- "proration": false,- "quantity": 6,- "subscription": null,- "tax_rates": [],- "test_clock": null,- "unit_amount": 8000,- "unit_amount_decimal": "8000"+ "payment_method_types": [+ "card",+ "cashapp"+ ],+ "processing": null,+ "receipt_email": "[email protected]",+ "review": null,+ "setup_future_usage": null,+ "shipping": null,+ "source": null,+ "statement_descriptor": "Zulip Cloud Standard",+ "statement_descriptor_suffix": null,+ "status": "succeeded",+ "transfer_data": null,+ "transfer_group": null}},- "id": "evt_1P41kYDEQaroqDjsQPv1Ji7t",+ "id": "evt_3P66vhDEQaroqDjs0CBYS4BD","livemode": false,"object": "event",- "pending_webhooks": 0,+ "pending_webhooks": 1,"request": {"id": "req_NORMALIZED0002",- "idempotency_key": "7b9875f2-42d7-44ea-a58d-19f08fa00b4f"+ "idempotency_key": "21f3f613-0dbe-4f49-b784-f139ab2561a7"},- "type": "invoiceitem.created"+ "type": "payment_intent.succeeded"},{"api_version": "2020-08-27",@@ -70,15 +199,15 @@"account_country": "US","account_name": "Kandra Labs, Inc.","account_tax_ids": null,- "amount_due": 10000,+ "amount_due": 48000,"amount_paid": 0,- "amount_remaining": 10000,+ "amount_remaining": 48000,"amount_shipping": 0,"application": null,"application_fee_amount": null,"attempt_count": 0,"attempted": false,- "auto_advance": true,+ "auto_advance": false,"automatic_tax": {"enabled": false,"liability": null,@@ -90,7 +219,7 @@"created": 1000000000,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0003",+ "customer": "cus_NORMALIZED0001","customer_address": null,"customer_email": "[email protected]","customer_name": null,@@ -109,9 +238,9 @@"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQV25ZbktyMWZFSHFNRjdZTjBXejBzVE9ydTA3LDEwMzI5ODYyMg0200emQENoEB?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9Qdnl0QUh2SjFEVzY5UGl5elAzNFpwS0JJY1NEWFV4LDEwMzc5NTE5MA0200MUTQx8i2?s=ap","id": "in_NORMALIZED00000000000001",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQV25ZbktyMWZFSHFNRjdZTjBXejBzVE9ydTA3LDEwMzI5ODYyMg0200emQENoEB/pdf?s=ap",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9Qdnl0QUh2SjFEVzY5UGl5elAzNFpwS0JJY1NEWFV4LDEwMzc5NTE5MA0200MUTQx8i2/pdf?s=ap","issuer": {"type": "self"},@@ -120,22 +249,22 @@"lines": {"data": [{- "amount": 10000,- "amount_excluding_tax": 10000,+ "amount": 48000,+ "amount_excluding_tax": 48000,"currency": "usd",- "description": "Zulip Basic - renewal",+ "description": "Zulip Cloud Standard","discount_amounts": [],"discountable": false,"discounts": [],"id": "il_NORMALIZED00000000000001","invoice": "in_NORMALIZED00000000000001",- "invoice_item": "ii_NORMALIZED00000000000002",+ "invoice_item": "ii_NORMALIZED00000000000001","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1333335845,- "start": 1330657445+ "end": 1357095845,+ "start": 1325473445},"plan": null,"price": {@@ -144,31 +273,31 @@"created": 1000000000,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000002",+ "id": "price_NORMALIZED00000000000001","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0002",+ "product": "prod_NORMALIZED0001","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,"transform_quantity": null,"type": "one_time",- "unit_amount": 10000,- "unit_amount_decimal": "10000"+ "unit_amount": 8000,+ "unit_amount_decimal": "8000"},"proration": false,"proration_details": {"credited_items": null},- "quantity": 1,+ "quantity": 6,"subscription": null,"tax_amounts": [],"tax_rates": [],"type": "invoiceitem",- "unit_amount_excluding_tax": "10000"+ "unit_amount_excluding_tax": "8000"}],"has_more": false,@@ -177,8 +306,15 @@"url": "/v1/invoices/in_NORMALIZED00000000000001/lines"},"livemode": false,- "metadata": {},- "next_payment_attempt": 1000000000,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "automatic",+ "licenses": "6",+ "on_free_trial": "False",+ "plan_tier": "1",+ "user_id": "10"+ },+ "next_payment_attempt": null,"number": "NORMALI-0001","object": "invoice","on_behalf_of": null,@@ -206,7 +342,7 @@"shipping_cost": null,"shipping_details": null,"starting_balance": 0,- "statement_descriptor": "Zulip Basic",+ "statement_descriptor": "Zulip Cloud Standard","status": "open","status_transitions": {"finalized_at": 1000000000,@@ -218,25 +354,25 @@"subscription_details": {"metadata": null},- "subtotal": 10000,- "subtotal_excluding_tax": 10000,+ "subtotal": 48000,+ "subtotal_excluding_tax": 48000,"tax": null,"test_clock": null,- "total": 10000,+ "total": 48000,"total_discount_amounts": [],- "total_excluding_tax": 10000,+ "total_excluding_tax": 48000,"total_tax_amounts": [],"transfer_data": null,"webhooks_delivered_at": null}},- "id": "evt_1P41kYDEQaroqDjsAOd8IdF1",+ "id": "evt_1P66viDEQaroqDjsYbRBL7kM","livemode": false,"object": "event","pending_webhooks": 0,"request": {"id": "req_NORMALIZED0003",- "idempotency_key": "3695130b-d0cc-42dc-996b-562f092f7472"+ "idempotency_key": "f03cf410-8768-4455-9e7a-cc1b73c3d7ec"},"type": "invoice.finalized"},@@ -248,15 +384,15 @@"account_country": "US","account_name": "Kandra Labs, Inc.","account_tax_ids": null,- "amount_due": 10000,+ "amount_due": 48000,"amount_paid": 0,- "amount_remaining": 10000,+ "amount_remaining": 48000,"amount_shipping": 0,"application": null,"application_fee_amount": null,"attempt_count": 0,"attempted": false,- "auto_advance": true,+ "auto_advance": false,"automatic_tax": {"enabled": false,"liability": null,@@ -268,7 +404,7 @@"created": 1000000000,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0003",+ "customer": "cus_NORMALIZED0001","customer_address": null,"customer_email": "[email protected]","customer_name": null,@@ -287,9 +423,9 @@"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQV25ZbktyMWZFSHFNRjdZTjBXejBzVE9ydTA3LDEwMzI5ODYyMg0200emQENoEB?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9Qdnl0QUh2SjFEVzY5UGl5elAzNFpwS0JJY1NEWFV4LDEwMzc5NTE5MA0200MUTQx8i2?s=ap","id": "in_NORMALIZED00000000000001",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQV25ZbktyMWZFSHFNRjdZTjBXejBzVE9ydTA3LDEwMzI5ODYyMg0200emQENoEB/pdf?s=ap",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9Qdnl0QUh2SjFEVzY5UGl5elAzNFpwS0JJY1NEWFV4LDEwMzc5NTE5MA0200MUTQx8i2/pdf?s=ap","issuer": {"type": "self"},@@ -298,22 +434,22 @@"lines": {"data": [{- "amount": 10000,- "amount_excluding_tax": 10000,+ "amount": 48000,+ "amount_excluding_tax": 48000,"currency": "usd",- "description": "Zulip Basic - renewal",+ "description": "Zulip Cloud Standard","discount_amounts": [],"discountable": false,"discounts": [],"id": "il_NORMALIZED00000000000001","invoice": "in_NORMALIZED00000000000001",- "invoice_item": "ii_NORMALIZED00000000000002",+ "invoice_item": "ii_NORMALIZED00000000000001","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1333335845,- "start": 1330657445+ "end": 1357095845,+ "start": 1325473445},"plan": null,"price": {@@ -322,31 +458,31 @@"created": 1000000000,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000002",+ "id": "price_NORMALIZED00000000000001","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0002",+ "product": "prod_NORMALIZED0001","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,"transform_quantity": null,"type": "one_time",- "unit_amount": 10000,- "unit_amount_decimal": "10000"+ "unit_amount": 8000,+ "unit_amount_decimal": "8000"},"proration": false,"proration_details": {"credited_items": null},- "quantity": 1,+ "quantity": 6,"subscription": null,"tax_amounts": [],"tax_rates": [],"type": "invoiceitem",- "unit_amount_excluding_tax": "10000"+ "unit_amount_excluding_tax": "8000"}],"has_more": false,@@ -355,8 +491,15 @@"url": "/v1/invoices/in_NORMALIZED00000000000001/lines"},"livemode": false,- "metadata": {},- "next_payment_attempt": 1000000000,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "automatic",+ "licenses": "6",+ "on_free_trial": "False",+ "plan_tier": "1",+ "user_id": "10"+ },+ "next_payment_attempt": null,"number": "NORMALI-0001","object": "invoice","on_behalf_of": null,@@ -384,7 +527,7 @@"shipping_cost": null,"shipping_details": null,"starting_balance": 0,- "statement_descriptor": "Zulip Basic",+ "statement_descriptor": "Zulip Cloud Standard","status": "open","status_transitions": {"finalized_at": 1000000000,@@ -396,13 +539,13 @@"subscription_details": {"metadata": null},- "subtotal": 10000,- "subtotal_excluding_tax": 10000,+ "subtotal": 48000,+ "subtotal_excluding_tax": 48000,"tax": null,"test_clock": null,- "total": 10000,+ "total": 48000,"total_discount_amounts": [],- "total_excluding_tax": 10000,+ "total_excluding_tax": 48000,"total_tax_amounts": [],"transfer_data": null,"webhooks_delivered_at": null@@ -425,13 +568,13 @@}}},- "id": "evt_1P41kYDEQaroqDjsyOT9E9wQ",+ "id": "evt_1P66viDEQaroqDjsQedPZnkH","livemode": false,"object": "event","pending_webhooks": 0,"request": {"id": "req_NORMALIZED0003",- "idempotency_key": "3695130b-d0cc-42dc-996b-562f092f7472"+ "idempotency_key": "f03cf410-8768-4455-9e7a-cc1b73c3d7ec"},"type": "invoice.updated"},@@ -440,173 +583,7 @@"created": 1000000000,"data": {"object": {- "address": null,- "balance": 0,- "created": 1000000000,- "currency": "usd",- "default_currency": "usd",- "default_source": null,- "delinquent": false,- "description": "zulip (Zulip Dev)",- "discount": null,- "email": "[email protected]",- "id": "cus_NORMALIZED0001",- "invoice_prefix": "NORMA01",- "invoice_settings": {- "custom_fields": null,- "default_payment_method": "pm_1P41kTDEQaroqDjsnRkdmbrR",- "footer": null,- "rendering_options": null- },- "livemode": false,- "metadata": {- "realm_id": "1",- "realm_str": "zulip"- },- "name": null,- "next_invoice_sequence": 1,- "object": "customer",- "phone": null,- "preferred_locales": [],- "shipping": null,- "tax_exempt": "none",- "test_clock": null- },- "previous_attributes": {- "currency": null,- "default_currency": null- }- },- "id": "evt_1P41kYDEQaroqDjs8WO7frnd",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0002",- "idempotency_key": "7b9875f2-42d7-44ea-a58d-19f08fa00b4f"- },- "type": "customer.updated"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "amount": 10000,- "currency": "usd",- "customer": "cus_NORMALIZED0004",- "date": 1000000000,- "description": "Zulip Cloud Standard",- "discountable": false,- "discounts": [],- "id": "ii_NORMALIZED00000000000003",- "invoice": null,- "livemode": false,- "metadata": {},- "object": "invoiceitem",- "period": {- "end": 1000000000,- "start": 1000000000- },- "plan": null,- "price": {- "active": false,- "billing_scheme": "per_unit",- "created": 1000000000,- "currency": "usd",- "custom_unit_amount": null,- "id": "price_NORMALIZED00000000000003",- "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": 10000,- "unit_amount_decimal": "10000"- },- "proration": false,- "quantity": 1,- "subscription": null,- "tax_rates": [],- "test_clock": null,- "unit_amount": 10000,- "unit_amount_decimal": "10000"- }- },- "id": "evt_1P41kYDEQaroqDjsyUn5zaaU",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0004",- "idempotency_key": "337717b3-2a9a-4ef1-9cfa-33b07668770d"- },- "type": "invoiceitem.created"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "address": null,- "balance": 0,- "created": 1000000000,- "currency": "usd",- "default_currency": "usd",- "default_source": null,- "delinquent": false,- "description": "test-realm-3 (test-realm-3)",- "discount": null,- "email": "[email protected]",- "id": "cus_NORMALIZED0004",- "invoice_prefix": "NORMA03",- "invoice_settings": {- "custom_fields": null,- "default_payment_method": null,- "footer": null,- "rendering_options": null- },- "livemode": false,- "metadata": {- "realm_id": "3",- "realm_str": "test-realm-3"- },- "name": null,- "next_invoice_sequence": 1,- "object": "customer",- "phone": null,- "preferred_locales": [],- "shipping": null,- "tax_exempt": "none",- "test_clock": null- },- "previous_attributes": {- "currency": null,- "default_currency": null- }- },- "id": "evt_1P41kYDEQaroqDjsYQb5KDTm",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0004",- "idempotency_key": "337717b3-2a9a-4ef1-9cfa-33b07668770d"- },- "type": "customer.updated"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "amount": 10000,+ "amount": 48000,"amount_capturable": 0,"amount_details": {"tip": {}@@ -625,11 +602,11 @@"total_count": 0,"url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000001"},- "client_secret": "pi_NORMALIZED00000000000001_secret_P8dNy5r8HoImGSMsoDXgfJXzi",+ "client_secret": "pi_NORMALIZED00000000000001_secret_5wXX5ya6BjJ9n0jvPxoJ17hp6","confirmation_method": "automatic","created": 1000000000,"currency": "usd",- "customer": "cus_NORMALIZED0003",+ "customer": "cus_NORMALIZED0001","description": "Payment for Invoice","id": "pi_NORMALIZED00000000000001","invoice": "in_NORMALIZED00000000000001",@@ -661,71 +638,23 @@"setup_future_usage": null,"shipping": null,"source": null,- "statement_descriptor": "Zulip Basic",+ "statement_descriptor": "Zulip Cloud Standard","statement_descriptor_suffix": null,"status": "requires_payment_method","transfer_data": null,"transfer_group": null}},- "id": "evt_3P41kYDEQaroqDjs0H4wNuZC",+ "id": "evt_3P66vhDEQaroqDjs0C2n0De9","livemode": false,"object": "event","pending_webhooks": 0,"request": {"id": "req_NORMALIZED0003",- "idempotency_key": "3695130b-d0cc-42dc-996b-562f092f7472"+ "idempotency_key": "f03cf410-8768-4455-9e7a-cc1b73c3d7ec"},"type": "payment_intent.created"},- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "address": null,- "balance": 0,- "created": 1000000000,- "currency": null,- "default_currency": null,- "default_source": null,- "delinquent": false,- "description": "test-realm-3 (test-realm-3)",- "discount": null,- "email": "[email protected]",- "id": "cus_NORMALIZED0004",- "invoice_prefix": "NORMA03",- "invoice_settings": {- "custom_fields": null,- "default_payment_method": null,- "footer": null,- "rendering_options": null- },- "livemode": false,- "metadata": {- "realm_id": "3",- "realm_str": "test-realm-3"- },- "name": null,- "next_invoice_sequence": 1,- "object": "customer",- "phone": null,- "preferred_locales": [],- "shipping": null,- "tax_exempt": "none",- "test_clock": null- }- },- "id": "evt_1P41kXDEQaroqDjson3s4Z2L",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0005",- "idempotency_key": "2b61c60c-42a1-46ad-b485-4213232192e2"- },- "type": "customer.created"- },{"api_version": "2020-08-27","created": 1000000000,@@ -734,15 +663,15 @@"account_country": "US","account_name": "Kandra Labs, Inc.","account_tax_ids": null,- "amount_due": 176000,+ "amount_due": 48000,"amount_paid": 0,- "amount_remaining": 176000,+ "amount_remaining": 48000,"amount_shipping": 0,"application": null,"application_fee_amount": null,"attempt_count": 0,"attempted": false,- "auto_advance": true,+ "auto_advance": false,"automatic_tax": {"enabled": false,"liability": null,@@ -754,7 +683,7 @@"created": 1000000000,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0005",+ "customer": "cus_NORMALIZED0001","customer_address": null,"customer_email": "[email protected]","customer_name": null,@@ -774,7 +703,7 @@"footer": null,"from_invoice": null,"hosted_invoice_url": null,- "id": "in_NORMALIZED00000000000002",+ "id": "in_NORMALIZED00000000000001","invoice_pdf": null,"issuer": {"type": "self"@@ -784,73 +713,22 @@"lines": {"data": [{- "amount": -24000,- "amount_excluding_tax": -24000,+ "amount": 48000,+ "amount_excluding_tax": 48000,"currency": "usd",- "description": "$20.00/month new customer discount",+ "description": "Zulip Cloud Standard","discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000002",- "invoice": "in_NORMALIZED00000000000002",- "invoice_item": "ii_NORMALIZED00000000000004",- "livemode": false,- "metadata": {},- "object": "line_item",- "period": {- "end": 1364871845,- "start": 1333335845- },- "plan": null,- "price": {- "active": false,- "billing_scheme": "per_unit",- "created": 1000000000,- "currency": "usd",- "custom_unit_amount": null,- "id": "price_NORMALIZED00000000000004",- "livemode": false,- "lookup_key": null,- "metadata": {},- "nickname": null,- "object": "price",- "product": "prod_NORMALIZED0003",- "recurring": null,- "tax_behavior": "unspecified",- "tiers_mode": null,- "transform_quantity": null,- "type": "one_time",- "unit_amount": -24000,- "unit_amount_decimal": "-24000"- },- "proration": false,- "proration_details": {- "credited_items": null- },- "quantity": 1,- "subscription": null,- "tax_amounts": [],- "tax_rates": [],- "type": "invoiceitem",- "unit_amount_excluding_tax": "-24000"- },- {- "amount": 200000,- "amount_excluding_tax": 200000,- "currency": "usd",- "description": "Zulip Business - renewal",- "discount_amounts": [],- "discountable": false,- "discounts": [],- "id": "il_NORMALIZED00000000000003",- "invoice": "in_NORMALIZED00000000000002",- "invoice_item": "ii_NORMALIZED00000000000005",+ "id": "il_NORMALIZED00000000000001",+ "invoice": "in_NORMALIZED00000000000001",+ "invoice_item": "ii_NORMALIZED00000000000001","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1364871845,- "start": 1333335845+ "end": 1357095845,+ "start": 1325473445},"plan": null,"price": {@@ -859,13 +737,13 @@"created": 1000000000,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000005",+ "id": "price_NORMALIZED00000000000001","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0004",+ "product": "prod_NORMALIZED0001","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -878,7 +756,7 @@"proration_details": {"credited_items": null},- "quantity": 25,+ "quantity": 6,"subscription": null,"tax_amounts": [],"tax_rates": [],@@ -888,12 +766,19 @@],"has_more": false,"object": "list",- "total_count": 2,- "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"},"livemode": false,- "metadata": {},- "next_payment_attempt": 1000000000,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "automatic",+ "licenses": "6",+ "on_free_trial": "False",+ "plan_tier": "1",+ "user_id": "10"+ },+ "next_payment_attempt": null,"number": null,"object": "invoice","on_behalf_of": null,@@ -921,7 +806,7 @@"shipping_cost": null,"shipping_details": null,"starting_balance": 0,- "statement_descriptor": "Zulip Business",+ "statement_descriptor": "Zulip Cloud Standard","status": "draft","status_transitions": {"finalized_at": null,@@ -933,25 +818,25 @@"subscription_details": {"metadata": null},- "subtotal": 176000,- "subtotal_excluding_tax": 176000,+ "subtotal": 48000,+ "subtotal_excluding_tax": 48000,"tax": null,"test_clock": null,- "total": 176000,+ "total": 48000,"total_discount_amounts": [],- "total_excluding_tax": 176000,+ "total_excluding_tax": 48000,"total_tax_amounts": [],"transfer_data": null,"webhooks_delivered_at": null}},- "id": "evt_1P41kXDEQaroqDjsvc2U60AZ",+ "id": "evt_1P66vhDEQaroqDjshFiMk5PU","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0006",- "idempotency_key": "2e64e6b9-c715-4277-9073-fdfbb64e3500"+ "id": "req_NORMALIZED0004",+ "idempotency_key": "84cbca19-71f6-46f9-8224-7ed7a7c196ae"},"type": "invoice.created"},@@ -960,181 +845,117 @@"created": 1000000000,"data": {"object": {- "account_country": "US",- "account_name": "Kandra Labs, Inc.",- "account_tax_ids": null,- "amount_due": 10000,- "amount_paid": 0,- "amount_remaining": 10000,- "amount_shipping": 0,- "application": null,- "application_fee_amount": null,- "attempt_count": 0,- "attempted": false,- "auto_advance": true,- "automatic_tax": {- "enabled": false,- "liability": null,- "status": null- },- "billing_reason": "manual",- "charge": null,- "collection_method": "charge_automatically",- "created": 1000000000,+ "amount": 48000,"currency": "usd",- "custom_fields": null,- "customer": "cus_NORMALIZED0003",- "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,+ "customer": "cus_NORMALIZED0001",+ "date": 1000000000,+ "description": "Zulip Cloud Standard",+ "discountable": false,"discounts": [],- "due_date": null,- "effective_at": null,- "ending_balance": null,- "footer": null,- "from_invoice": null,- "hosted_invoice_url": null,- "id": "in_NORMALIZED00000000000001",- "invoice_pdf": null,- "issuer": {- "type": "self"- },- "last_finalization_error": null,- "latest_revision": null,- "lines": {- "data": [- {- "amount": 10000,- "amount_excluding_tax": 10000,- "currency": "usd",- "description": "Zulip Basic - renewal",- "discount_amounts": [],- "discountable": false,- "discounts": [],- "id": "il_NORMALIZED00000000000001",- "invoice": "in_NORMALIZED00000000000001",- "invoice_item": "ii_NORMALIZED00000000000002",- "livemode": false,- "metadata": {},- "object": "line_item",- "period": {- "end": 1333335845,- "start": 1330657445- },- "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": 10000,- "unit_amount_decimal": "10000"- },- "proration": false,- "proration_details": {- "credited_items": null- },- "quantity": 1,- "subscription": null,- "tax_amounts": [],- "tax_rates": [],- "type": "invoiceitem",- "unit_amount_excluding_tax": "10000"- }- ],- "has_more": false,- "object": "list",- "total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"- },+ "id": "ii_NORMALIZED00000000000001",+ "invoice": null,"livemode": false,"metadata": {},- "next_payment_attempt": 1000000000,- "number": null,- "object": "invoice",- "on_behalf_of": null,- "paid": false,- "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": "auto"- }+ "object": "invoiceitem",+ "period": {+ "end": 1357095845,+ "start": 1325473445},- "rendering_options": null,- "shipping_cost": null,- "shipping_details": null,- "starting_balance": 0,- "statement_descriptor": "Zulip Basic",- "status": "draft",- "status_transitions": {- "finalized_at": null,- "marked_uncollectible_at": null,- "paid_at": null,- "voided_at": null+ "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,+ "quantity": 6,"subscription": null,- "subscription_details": {- "metadata": null- },- "subtotal": 10000,- "subtotal_excluding_tax": 10000,- "tax": null,+ "tax_rates": [],"test_clock": null,- "total": 10000,- "total_discount_amounts": [],- "total_excluding_tax": 10000,- "total_tax_amounts": [],- "transfer_data": null,- "webhooks_delivered_at": null+ "unit_amount": 8000,+ "unit_amount_decimal": "8000"}},- "id": "evt_1P41kXDEQaroqDjsUzXIlr78",+ "id": "evt_1P66vgDEQaroqDjs4Tp9qOzE","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0007",- "idempotency_key": "e4a1019f-c5bb-4824-b5b8-eab9a30ca26e"+ "id": "req_NORMALIZED0005",+ "idempotency_key": "40a19d3c-8a88-4485-80c3-95f5825dbfd0"},- "type": "invoice.created"+ "type": "invoiceitem.created"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": "usd",+ "default_currency": "usd",+ "default_source": null,+ "delinquent": false,+ "description": "zulip (Zulip Dev)",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0001",+ "invoice_prefix": "NORMA01",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": "pm_1P66vbDEQaroqDjsUrXkyfgm",+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "realm_id": "1",+ "realm_str": "zulip"+ },+ "name": null,+ "next_invoice_sequence": 1,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+ },+ "previous_attributes": {+ "currency": null,+ "default_currency": null+ }+ },+ "id": "evt_1P66vgDEQaroqDjs2oQjVHo4",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0005",+ "idempotency_key": "40a19d3c-8a88-4485-80c3-95f5825dbfd0"+ },+ "type": "customer.updated"}],- "has_more": true,+ "has_more": false,"object": "list","url": "/v1/events"}diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.3.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.3.jsonindex 7a4173a69a9..600e052cb0d 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.3.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.3.json@@ -8,29 +8,29 @@"account_country": "US","account_name": "Kandra Labs, Inc.","account_tax_ids": null,- "amount_due": 10000,- "amount_paid": 0,- "amount_remaining": 10000,+ "amount_due": 48000,+ "amount_paid": 48000,+ "amount_remaining": 0,"amount_shipping": 0,"application": null,"application_fee_amount": null,- "attempt_count": 0,- "attempted": false,- "auto_advance": true,+ "attempt_count": 1,+ "attempted": true,+ "auto_advance": false,"automatic_tax": {"enabled": false,"liability": null,"status": null},"billing_reason": "manual",- "charge": null,- "collection_method": "send_invoice",+ "charge": "ch_NORMALIZED00000000000001",+ "collection_method": "charge_automatically","created": 1000000000,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0004",+ "customer": "cus_NORMALIZED0001","customer_address": null,- "customer_email": "[email protected]",+ "customer_email": "[email protected]","customer_name": null,"customer_phone": null,"customer_shipping": null,@@ -42,14 +42,14 @@"description": null,"discount": null,"discounts": [],- "due_date": 1000000000,+ "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQallHRzlGOTFta3dhVUh3aG1ua3phOFRnRDB5LDEwMzI5ODYyMw0200Ub4V6b03?s=ap",- "id": "in_NORMALIZED00000000000003",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQallHRzlGOTFta3dhVUh3aG1ua3phOFRnRDB5LDEwMzI5ODYyMw0200Ub4V6b03/pdf?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9Qdnl0QUh2SjFEVzY5UGl5elAzNFpwS0JJY1NEWFV4LDEwMzc5NTE5Mg0200gU5icj9D?s=ap",+ "id": "in_NORMALIZED00000000000001",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9Qdnl0QUh2SjFEVzY5UGl5elAzNFpwS0JJY1NEWFV4LDEwMzc5NTE5Mg0200gU5icj9D/pdf?s=ap","issuer": {"type": "self"},@@ -58,22 +58,22 @@"lines": {"data": [{- "amount": 10000,- "amount_excluding_tax": 10000,+ "amount": 48000,+ "amount_excluding_tax": 48000,"currency": "usd","description": "Zulip Cloud Standard","discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000004",- "invoice": "in_NORMALIZED00000000000003",- "invoice_item": "ii_NORMALIZED00000000000003",+ "id": "il_NORMALIZED00000000000001",+ "invoice": "in_NORMALIZED00000000000001",+ "invoice_item": "ii_NORMALIZED00000000000001","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1357095845,+ "start": 1325473445},"plan": null,"price": {@@ -82,7 +82,7 @@"created": 1000000000,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000003",+ "id": "price_NORMALIZED00000000000001","livemode": false,"lookup_key": null,"metadata": {},@@ -94,35 +94,42 @@"tiers_mode": null,"transform_quantity": null,"type": "one_time",- "unit_amount": 10000,- "unit_amount_decimal": "10000"+ "unit_amount": 8000,+ "unit_amount_decimal": "8000"},"proration": false,"proration_details": {"credited_items": null},- "quantity": 1,+ "quantity": 6,"subscription": null,"tax_amounts": [],"tax_rates": [],"type": "invoiceitem",- "unit_amount_excluding_tax": "10000"+ "unit_amount_excluding_tax": "8000"}],"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000003/lines"+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"},"livemode": false,- "metadata": {},+ "metadata": {+ "billing_schedule": "1",+ "license_management": "automatic",+ "licenses": "6",+ "on_free_trial": "False",+ "plan_tier": "1",+ "user_id": "10"+ },"next_payment_attempt": null,"number": "NORMALI-0002","object": "invoice","on_behalf_of": null,- "paid": false,+ "paid": true,"paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000002",+ "payment_intent": "pi_NORMALIZED00000000000001","payment_settings": {"default_mandate": null,"payment_method_options": null,@@ -145,132 +152,38 @@"shipping_details": null,"starting_balance": 0,"statement_descriptor": "Zulip Cloud Standard",- "status": "open",+ "status": "paid","status_transitions": {"finalized_at": 1000000000,"marked_uncollectible_at": null,- "paid_at": null,+ "paid_at": 1000000000,"voided_at": null},"subscription": null,"subscription_details": {"metadata": null},- "subtotal": 10000,- "subtotal_excluding_tax": 10000,+ "subtotal": 48000,+ "subtotal_excluding_tax": 48000,"tax": null,"test_clock": null,- "total": 10000,+ "total": 48000,"total_discount_amounts": [],- "total_excluding_tax": 10000,+ "total_excluding_tax": 48000,"total_tax_amounts": [],"transfer_data": null,"webhooks_delivered_at": null- },- "previous_attributes": {- "effective_at": null,- "ending_balance": null,- "hosted_invoice_url": null,- "invoice_pdf": null,- "number": null,- "payment_intent": null,- "rendering": {- "pdf": {- "page_size": "auto"- }- },- "status": "draft",- "status_transitions": {- "finalized_at": null- }- }- },- "id": "evt_1P41kZDEQaroqDjsBPsL2oi6",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0008",- "idempotency_key": "3909aab6-a24b-40ec-8363-eb8e881e16e3"- },- "type": "invoice.updated"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "amount": 48000,- "amount_capturable": 0,- "amount_details": {- "tip": {}- },- "amount_received": 0,- "application": null,- "application_fee_amount": null,- "automatic_payment_methods": null,- "canceled_at": null,- "cancellation_reason": null,- "capture_method": "automatic",- "charges": {- "data": [],- "has_more": false,- "object": "list",- "total_count": 0,- "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000003"- },- "client_secret": "pi_NORMALIZED00000000000003_secret_MG7h6vWTK4qcjjXQxDAynnxhr",- "confirmation_method": "automatic",- "created": 1000000000,- "currency": "usd",- "customer": "cus_NORMALIZED0001",- "description": "Payment for Invoice",- "id": "pi_NORMALIZED00000000000003",- "invoice": "in_NORMALIZED00000000000004",- "last_payment_error": null,- "latest_charge": null,- "livemode": false,- "metadata": {},- "next_action": null,- "object": "payment_intent",- "on_behalf_of": null,- "payment_method": null,- "payment_method_configuration_details": null,- "payment_method_options": {- "card": {- "installments": null,- "mandate_options": null,- "network": null,- "request_three_d_secure": "automatic"- },- "cashapp": {}- },- "payment_method_types": [- "card",- "cashapp"- ],- "processing": null,- "receipt_email": "[email protected]",- "review": null,- "setup_future_usage": null,- "shipping": null,- "source": null,- "statement_descriptor": "Zulip Cloud Standard",- "statement_descriptor_suffix": null,- "status": "requires_payment_method",- "transfer_data": null,- "transfer_group": null}},- "id": "evt_3P41kZDEQaroqDjs1Nx8pQxX",+ "id": "evt_1P66vkDEQaroqDjs5ChdqUY2","livemode": false,"object": "event",- "pending_webhooks": 0,+ "pending_webhooks": 2,"request": {- "id": "req_NORMALIZED0009",- "idempotency_key": "a5f92760-f81c-4b14-a4d5-727bd1293e68"+ "id": "req_NORMALIZED0002",+ "idempotency_key": "21f3f613-0dbe-4f49-b784-f139ab2561a7"},- "type": "payment_intent.created"+ "type": "invoice.payment_succeeded"},{"api_version": "2020-08-27",@@ -280,27 +193,27 @@"account_country": "US","account_name": "Kandra Labs, Inc.","account_tax_ids": null,- "amount_due": 10000,- "amount_paid": 0,- "amount_remaining": 10000,+ "amount_due": 48000,+ "amount_paid": 48000,+ "amount_remaining": 0,"amount_shipping": 0,"application": null,"application_fee_amount": null,- "attempt_count": 0,- "attempted": false,- "auto_advance": true,+ "attempt_count": 1,+ "attempted": true,+ "auto_advance": false,"automatic_tax": {"enabled": false,"liability": null,"status": null},"billing_reason": "manual",- "charge": null,+ "charge": "ch_NORMALIZED00000000000001","collection_method": "charge_automatically","created": 1000000000,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0003",+ "customer": "cus_NORMALIZED0001","customer_address": null,"customer_email": "[email protected]","customer_name": null,@@ -315,13 +228,13 @@"discount": null,"discounts": [],"due_date": null,- "effective_at": null,- "ending_balance": null,+ "effective_at": 1000000000,+ "ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": null,- "id": "in_NORMALIZED00000000000005",- "invoice_pdf": null,+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9Qdnl0QUh2SjFEVzY5UGl5elAzNFpwS0JJY1NEWFV4LDEwMzc5NTE5Mg0200gU5icj9D?s=ap",+ "id": "in_NORMALIZED00000000000001",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9Qdnl0QUh2SjFEVzY5UGl5elAzNFpwS0JJY1NEWFV4LDEwMzc5NTE5Mg0200gU5icj9D/pdf?s=ap","issuer": {"type": "self"},@@ -330,22 +243,22 @@"lines": {"data": [{- "amount": 10000,- "amount_excluding_tax": 10000,+ "amount": 48000,+ "amount_excluding_tax": 48000,"currency": "usd",- "description": "Zulip Basic - renewal",+ "description": "Zulip Cloud Standard","discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000005",- "invoice": "in_NORMALIZED00000000000005",- "invoice_item": "ii_NORMALIZED00000000000006",+ "id": "il_NORMALIZED00000000000001",+ "invoice": "in_NORMALIZED00000000000001",+ "invoice_item": "ii_NORMALIZED00000000000001","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1335927845,- "start": 1333335845+ "end": 1357095845,+ "start": 1325473445},"plan": null,"price": {@@ -354,47 +267,54 @@"created": 1000000000,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000002",+ "id": "price_NORMALIZED00000000000001","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0002",+ "product": "prod_NORMALIZED0001","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,"transform_quantity": null,"type": "one_time",- "unit_amount": 10000,- "unit_amount_decimal": "10000"+ "unit_amount": 8000,+ "unit_amount_decimal": "8000"},"proration": false,"proration_details": {"credited_items": null},- "quantity": 1,+ "quantity": 6,"subscription": null,"tax_amounts": [],"tax_rates": [],"type": "invoiceitem",- "unit_amount_excluding_tax": "10000"+ "unit_amount_excluding_tax": "8000"}],"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000005/lines"+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"},"livemode": false,- "metadata": {},- "next_payment_attempt": 1000000000,- "number": null,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "automatic",+ "licenses": "6",+ "on_free_trial": "False",+ "plan_tier": "1",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": "NORMALI-0002","object": "invoice","on_behalf_of": null,- "paid": false,+ "paid": true,"paid_out_of_band": false,- "payment_intent": null,+ "payment_intent": "pi_NORMALIZED00000000000001","payment_settings": {"default_mandate": null,"payment_method_options": null,@@ -409,191 +329,46 @@"rendering": {"amount_tax_display": null,"pdf": {- "page_size": "auto"+ "page_size": "letter"}},"rendering_options": null,"shipping_cost": null,"shipping_details": null,"starting_balance": 0,- "statement_descriptor": "Zulip Basic",- "status": "draft",+ "statement_descriptor": "Zulip Cloud Standard",+ "status": "paid","status_transitions": {- "finalized_at": null,+ "finalized_at": 1000000000,"marked_uncollectible_at": null,- "paid_at": null,+ "paid_at": 1000000000,"voided_at": null},"subscription": null,"subscription_details": {"metadata": null},- "subtotal": 10000,- "subtotal_excluding_tax": 10000,+ "subtotal": 48000,+ "subtotal_excluding_tax": 48000,"tax": null,"test_clock": null,- "total": 10000,+ "total": 48000,"total_discount_amounts": [],- "total_excluding_tax": 10000,+ "total_excluding_tax": 48000,"total_tax_amounts": [],"transfer_data": null,"webhooks_delivered_at": null}},- "id": "evt_1P41kZDEQaroqDjsv4h2s8FK",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0010",- "idempotency_key": "84216d74-01c4-4d91-ab57-4e032f917f7b"- },- "type": "invoice.created"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "amount": 10000,- "amount_capturable": 0,- "amount_details": {- "tip": {}- },- "amount_received": 0,- "application": null,- "application_fee_amount": null,- "automatic_payment_methods": null,- "canceled_at": null,- "cancellation_reason": null,- "capture_method": "automatic",- "charges": {- "data": [],- "has_more": false,- "object": "list",- "total_count": 0,- "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000002"- },- "client_secret": "pi_NORMALIZED00000000000002_secret_D6ggn3YNOlYMmIMplCpFCWEWv",- "confirmation_method": "automatic",- "created": 1000000000,- "currency": "usd",- "customer": "cus_NORMALIZED0004",- "description": "Payment for Invoice",- "id": "pi_NORMALIZED00000000000002",- "invoice": "in_NORMALIZED00000000000003",- "last_payment_error": null,- "latest_charge": null,- "livemode": false,- "metadata": {},- "next_action": null,- "object": "payment_intent",- "on_behalf_of": null,- "payment_method": null,- "payment_method_configuration_details": null,- "payment_method_options": {- "card": {- "installments": null,- "mandate_options": null,- "network": null,- "request_three_d_secure": "automatic"- },- "cashapp": {},- "wechat_pay": {- "app_id": null,- "client": null- }- },- "payment_method_types": [- "ach_credit_transfer",- "card",- "cashapp",- "wechat_pay"- ],- "processing": null,- "receipt_email": "[email protected]",- "review": null,- "setup_future_usage": null,- "shipping": null,- "source": null,- "statement_descriptor": "Zulip Cloud Standard",- "statement_descriptor_suffix": null,- "status": "requires_payment_method",- "transfer_data": null,- "transfer_group": null- }- },- "id": "evt_3P41kZDEQaroqDjs1VMdQybH",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0008",- "idempotency_key": "3909aab6-a24b-40ec-8363-eb8e881e16e3"- },- "type": "payment_intent.created"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "amount": 10000,- "currency": "usd",- "customer": "cus_NORMALIZED0003",- "date": 1000000000,- "description": "Zulip Basic - renewal",- "discountable": false,- "discounts": [],- "id": "ii_NORMALIZED00000000000006",- "invoice": null,- "livemode": false,- "metadata": {},- "object": "invoiceitem",- "period": {- "end": 1335927845,- "start": 1333335845- },- "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": 10000,- "unit_amount_decimal": "10000"- },- "proration": false,- "quantity": 1,- "subscription": null,- "tax_rates": [],- "test_clock": null,- "unit_amount": 10000,- "unit_amount_decimal": "10000"- }- },- "id": "evt_1P41kYDEQaroqDjsIrxyyMCV",+ "id": "evt_1P66vkDEQaroqDjsDRLK5ZfC","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0011",- "idempotency_key": "477d98ea-c64a-4565-85e9-b2c0220ead44"+ "id": "req_NORMALIZED0002",+ "idempotency_key": "21f3f613-0dbe-4f49-b784-f139ab2561a7"},- "type": "invoiceitem.created"+ "type": "invoice.paid"},{"api_version": "2020-08-27",@@ -604,13 +379,13 @@"account_name": "Kandra Labs, Inc.","account_tax_ids": null,"amount_due": 48000,- "amount_paid": 0,- "amount_remaining": 48000,+ "amount_paid": 48000,+ "amount_remaining": 0,"amount_shipping": 0,"application": null,"application_fee_amount": null,- "attempt_count": 0,- "attempted": false,+ "attempt_count": 1,+ "attempted": true,"auto_advance": false,"automatic_tax": {"enabled": false,@@ -618,7 +393,7 @@"status": null},"billing_reason": "manual",- "charge": null,+ "charge": "ch_NORMALIZED00000000000001","collection_method": "charge_automatically","created": 1000000000,"currency": "usd",@@ -638,13 +413,13 @@"discount": null,"discounts": [],"due_date": null,- "effective_at": null,- "ending_balance": null,+ "effective_at": 1000000000,+ "ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": null,- "id": "in_NORMALIZED00000000000004",- "invoice_pdf": null,+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9Qdnl0QUh2SjFEVzY5UGl5elAzNFpwS0JJY1NEWFV4LDEwMzc5NTE5Mg0200gU5icj9D?s=ap",+ "id": "in_NORMALIZED00000000000001",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9Qdnl0QUh2SjFEVzY5UGl5elAzNFpwS0JJY1NEWFV4LDEwMzc5NTE5Mg0200gU5icj9D/pdf?s=ap","issuer": {"type": "self"},@@ -660,8 +435,8 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000006",- "invoice": "in_NORMALIZED00000000000004",+ "id": "il_NORMALIZED00000000000001",+ "invoice": "in_NORMALIZED00000000000001","invoice_item": "ii_NORMALIZED00000000000001","livemode": false,"metadata": {},@@ -707,7 +482,7 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000004/lines"+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"},"livemode": false,"metadata": {@@ -719,12 +494,12 @@"user_id": "10"},"next_payment_attempt": null,- "number": null,+ "number": "NORMALI-0002","object": "invoice","on_behalf_of": null,- "paid": false,+ "paid": true,"paid_out_of_band": false,- "payment_intent": null,+ "payment_intent": "pi_NORMALIZED00000000000001","payment_settings": {"default_mandate": null,"payment_method_options": null,@@ -739,7 +514,7 @@"rendering": {"amount_tax_display": null,"pdf": {- "page_size": "auto"+ "page_size": "letter"}},"rendering_options": null,@@ -747,11 +522,11 @@"shipping_details": null,"starting_balance": 0,"statement_descriptor": "Zulip Cloud Standard",- "status": "draft",+ "status": "paid","status_transitions": {- "finalized_at": null,+ "finalized_at": 1000000000,"marked_uncollectible_at": null,- "paid_at": null,+ "paid_at": 1000000000,"voided_at": null},"subscription": null,@@ -768,750 +543,32 @@"total_tax_amounts": [],"transfer_data": null,"webhooks_delivered_at": null+ },+ "previous_attributes": {+ "amount_paid": 0,+ "amount_remaining": 48000,+ "attempt_count": 0,+ "attempted": false,+ "charge": null,+ "paid": false,+ "status": "open",+ "status_transitions": {+ "paid_at": null+ }}},- "id": "evt_1P41kYDEQaroqDjsbqfB66yq",+ "id": "evt_1P66vkDEQaroqDjszaII4HZo","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0012",- "idempotency_key": "f275d05f-133e-478c-8265-9ec553185e51"- },- "type": "invoice.created"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "account_country": "US",- "account_name": "Kandra Labs, Inc.",- "account_tax_ids": null,- "amount_due": 176000,- "amount_paid": 0,- "amount_remaining": 176000,- "amount_shipping": 0,- "application": null,- "application_fee_amount": null,- "attempt_count": 0,- "attempted": false,- "auto_advance": true,- "automatic_tax": {- "enabled": false,- "liability": null,- "status": null- },- "billing_reason": "manual",- "charge": null,- "collection_method": "charge_automatically",- "created": 1000000000,- "currency": "usd",- "custom_fields": null,- "customer": "cus_NORMALIZED0005",- "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQSTY0ZUkzTU5qMmlndGFXMThsSFMycThtYk1DLDEwMzI5ODYyMw0200PaP6JIk8?s=ap",- "id": "in_NORMALIZED00000000000002",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQSTY0ZUkzTU5qMmlndGFXMThsSFMycThtYk1DLDEwMzI5ODYyMw0200PaP6JIk8/pdf?s=ap",- "issuer": {- "type": "self"- },- "last_finalization_error": null,- "latest_revision": null,- "lines": {- "data": [- {- "amount": -24000,- "amount_excluding_tax": -24000,- "currency": "usd",- "description": "$20.00/month new customer discount",- "discount_amounts": [],- "discountable": false,- "discounts": [],- "id": "il_NORMALIZED00000000000002",- "invoice": "in_NORMALIZED00000000000002",- "invoice_item": "ii_NORMALIZED00000000000004",- "livemode": false,- "metadata": {},- "object": "line_item",- "period": {- "end": 1364871845,- "start": 1333335845- },- "plan": null,- "price": {- "active": false,- "billing_scheme": "per_unit",- "created": 1000000000,- "currency": "usd",- "custom_unit_amount": null,- "id": "price_NORMALIZED00000000000004",- "livemode": false,- "lookup_key": null,- "metadata": {},- "nickname": null,- "object": "price",- "product": "prod_NORMALIZED0003",- "recurring": null,- "tax_behavior": "unspecified",- "tiers_mode": null,- "transform_quantity": null,- "type": "one_time",- "unit_amount": -24000,- "unit_amount_decimal": "-24000"- },- "proration": false,- "proration_details": {- "credited_items": null- },- "quantity": 1,- "subscription": null,- "tax_amounts": [],- "tax_rates": [],- "type": "invoiceitem",- "unit_amount_excluding_tax": "-24000"- },- {- "amount": 200000,- "amount_excluding_tax": 200000,- "currency": "usd",- "description": "Zulip Business - renewal",- "discount_amounts": [],- "discountable": false,- "discounts": [],- "id": "il_NORMALIZED00000000000003",- "invoice": "in_NORMALIZED00000000000002",- "invoice_item": "ii_NORMALIZED00000000000005",- "livemode": false,- "metadata": {},- "object": "line_item",- "period": {- "end": 1364871845,- "start": 1333335845- },- "plan": null,- "price": {- "active": false,- "billing_scheme": "per_unit",- "created": 1000000000,- "currency": "usd",- "custom_unit_amount": null,- "id": "price_NORMALIZED00000000000005",- "livemode": false,- "lookup_key": null,- "metadata": {},- "nickname": null,- "object": "price",- "product": "prod_NORMALIZED0004",- "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": 25,- "subscription": null,- "tax_amounts": [],- "tax_rates": [],- "type": "invoiceitem",- "unit_amount_excluding_tax": "8000"- }- ],- "has_more": false,- "object": "list",- "total_count": 2,- "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"- },- "livemode": false,- "metadata": {},- "next_payment_attempt": 1000000000,- "number": "NORMALI-0003",- "object": "invoice",- "on_behalf_of": null,- "paid": false,- "paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000004",- "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 Business",- "status": "open",- "status_transitions": {- "finalized_at": 1000000000,- "marked_uncollectible_at": null,- "paid_at": null,- "voided_at": null- },- "subscription": null,- "subscription_details": {- "metadata": null- },- "subtotal": 176000,- "subtotal_excluding_tax": 176000,- "tax": null,- "test_clock": null,- "total": 176000,- "total_discount_amounts": [],- "total_excluding_tax": 176000,- "total_tax_amounts": [],- "transfer_data": null,- "webhooks_delivered_at": null- }- },- "id": "evt_1P41kZDEQaroqDjsbuAnw28V",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0013",- "idempotency_key": "9766f80b-785a-4fc9-a672-dbc3b220859e"- },- "type": "invoice.finalized"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "account_country": "US",- "account_name": "Kandra Labs, Inc.",- "account_tax_ids": null,- "amount_due": 176000,- "amount_paid": 0,- "amount_remaining": 176000,- "amount_shipping": 0,- "application": null,- "application_fee_amount": null,- "attempt_count": 0,- "attempted": false,- "auto_advance": true,- "automatic_tax": {- "enabled": false,- "liability": null,- "status": null- },- "billing_reason": "manual",- "charge": null,- "collection_method": "charge_automatically",- "created": 1000000000,- "currency": "usd",- "custom_fields": null,- "customer": "cus_NORMALIZED0005",- "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQSTY0ZUkzTU5qMmlndGFXMThsSFMycThtYk1DLDEwMzI5ODYyMg0200nkDKDElL?s=ap",- "id": "in_NORMALIZED00000000000002",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQSTY0ZUkzTU5qMmlndGFXMThsSFMycThtYk1DLDEwMzI5ODYyMg0200nkDKDElL/pdf?s=ap",- "issuer": {- "type": "self"- },- "last_finalization_error": null,- "latest_revision": null,- "lines": {- "data": [- {- "amount": -24000,- "amount_excluding_tax": -24000,- "currency": "usd",- "description": "$20.00/month new customer discount",- "discount_amounts": [],- "discountable": false,- "discounts": [],- "id": "il_NORMALIZED00000000000002",- "invoice": "in_NORMALIZED00000000000002",- "invoice_item": "ii_NORMALIZED00000000000004",- "livemode": false,- "metadata": {},- "object": "line_item",- "period": {- "end": 1364871845,- "start": 1333335845- },- "plan": null,- "price": {- "active": false,- "billing_scheme": "per_unit",- "created": 1000000000,- "currency": "usd",- "custom_unit_amount": null,- "id": "price_NORMALIZED00000000000004",- "livemode": false,- "lookup_key": null,- "metadata": {},- "nickname": null,- "object": "price",- "product": "prod_NORMALIZED0003",- "recurring": null,- "tax_behavior": "unspecified",- "tiers_mode": null,- "transform_quantity": null,- "type": "one_time",- "unit_amount": -24000,- "unit_amount_decimal": "-24000"- },- "proration": false,- "proration_details": {- "credited_items": null- },- "quantity": 1,- "subscription": null,- "tax_amounts": [],- "tax_rates": [],- "type": "invoiceitem",- "unit_amount_excluding_tax": "-24000"- },- {- "amount": 200000,- "amount_excluding_tax": 200000,- "currency": "usd",- "description": "Zulip Business - renewal",- "discount_amounts": [],- "discountable": false,- "discounts": [],- "id": "il_NORMALIZED00000000000003",- "invoice": "in_NORMALIZED00000000000002",- "invoice_item": "ii_NORMALIZED00000000000005",- "livemode": false,- "metadata": {},- "object": "line_item",- "period": {- "end": 1364871845,- "start": 1333335845- },- "plan": null,- "price": {- "active": false,- "billing_scheme": "per_unit",- "created": 1000000000,- "currency": "usd",- "custom_unit_amount": null,- "id": "price_NORMALIZED00000000000005",- "livemode": false,- "lookup_key": null,- "metadata": {},- "nickname": null,- "object": "price",- "product": "prod_NORMALIZED0004",- "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": 25,- "subscription": null,- "tax_amounts": [],- "tax_rates": [],- "type": "invoiceitem",- "unit_amount_excluding_tax": "8000"- }- ],- "has_more": false,- "object": "list",- "total_count": 2,- "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"- },- "livemode": false,- "metadata": {},- "next_payment_attempt": 1000000000,- "number": "NORMALI-0003",- "object": "invoice",- "on_behalf_of": null,- "paid": false,- "paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000004",- "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 Business",- "status": "open",- "status_transitions": {- "finalized_at": 1000000000,- "marked_uncollectible_at": null,- "paid_at": null,- "voided_at": null- },- "subscription": null,- "subscription_details": {- "metadata": null- },- "subtotal": 176000,- "subtotal_excluding_tax": 176000,- "tax": null,- "test_clock": null,- "total": 176000,- "total_discount_amounts": [],- "total_excluding_tax": 176000,- "total_tax_amounts": [],- "transfer_data": null,- "webhooks_delivered_at": null- },- "previous_attributes": {- "effective_at": null,- "ending_balance": null,- "hosted_invoice_url": null,- "invoice_pdf": null,- "number": null,- "payment_intent": null,- "rendering": {- "pdf": {- "page_size": "auto"- }- },- "status": "draft",- "status_transitions": {- "finalized_at": null- }- }- },- "id": "evt_1P41kZDEQaroqDjsI0j6sUxk",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0013",- "idempotency_key": "9766f80b-785a-4fc9-a672-dbc3b220859e"+ "id": "req_NORMALIZED0002",+ "idempotency_key": "21f3f613-0dbe-4f49-b784-f139ab2561a7"},"type": "invoice.updated"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "account_country": "US",- "account_name": "Kandra Labs, Inc.",- "account_tax_ids": null,- "amount_due": 10000,- "amount_paid": 0,- "amount_remaining": 10000,- "amount_shipping": 0,- "application": null,- "application_fee_amount": null,- "attempt_count": 0,- "attempted": false,- "auto_advance": true,- "automatic_tax": {- "enabled": false,- "liability": null,- "status": null- },- "billing_reason": "manual",- "charge": null,- "collection_method": "send_invoice",- "created": 1000000000,- "currency": "usd",- "custom_fields": null,- "customer": "cus_NORMALIZED0004",- "customer_address": null,- "customer_email": "[email protected]",- "customer_name": null,- "customer_phone": null,- "customer_shipping": null,- "customer_tax_exempt": "none",- "customer_tax_ids": [],- "default_payment_method": null,- "default_source": null,- "default_tax_rates": [],- "description": null,- "discount": null,- "discounts": [],- "due_date": 1000000000,- "effective_at": null,- "ending_balance": null,- "footer": null,- "from_invoice": null,- "hosted_invoice_url": null,- "id": "in_NORMALIZED00000000000003",- "invoice_pdf": null,- "issuer": {- "type": "self"- },- "last_finalization_error": null,- "latest_revision": null,- "lines": {- "data": [- {- "amount": 10000,- "amount_excluding_tax": 10000,- "currency": "usd",- "description": "Zulip Cloud Standard",- "discount_amounts": [],- "discountable": false,- "discounts": [],- "id": "il_NORMALIZED00000000000004",- "invoice": "in_NORMALIZED00000000000003",- "invoice_item": "ii_NORMALIZED00000000000003",- "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_NORMALIZED00000000000003",- "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": 10000,- "unit_amount_decimal": "10000"- },- "proration": false,- "proration_details": {- "credited_items": null- },- "quantity": 1,- "subscription": null,- "tax_amounts": [],- "tax_rates": [],- "type": "invoiceitem",- "unit_amount_excluding_tax": "10000"- }- ],- "has_more": false,- "object": "list",- "total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000003/lines"- },- "livemode": false,- "metadata": {},- "next_payment_attempt": null,- "number": null,- "object": "invoice",- "on_behalf_of": null,- "paid": false,- "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": "auto"- }- },- "rendering_options": null,- "shipping_cost": null,- "shipping_details": null,- "starting_balance": 0,- "statement_descriptor": "Zulip Cloud Standard",- "status": "draft",- "status_transitions": {- "finalized_at": null,- "marked_uncollectible_at": null,- "paid_at": null,- "voided_at": null- },- "subscription": null,- "subscription_details": {- "metadata": null- },- "subtotal": 10000,- "subtotal_excluding_tax": 10000,- "tax": null,- "test_clock": null,- "total": 10000,- "total_discount_amounts": [],- "total_excluding_tax": 10000,- "total_tax_amounts": [],- "transfer_data": null,- "webhooks_delivered_at": null- }- },- "id": "evt_1P41kYDEQaroqDjsExuS0EZi",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0014",- "idempotency_key": "e057db25-c207-4059-bcf1-2ac8cbfe0ef0"- },- "type": "invoice.created"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "amount": 176000,- "amount_capturable": 0,- "amount_details": {- "tip": {}- },- "amount_received": 0,- "application": null,- "application_fee_amount": null,- "automatic_payment_methods": null,- "canceled_at": null,- "cancellation_reason": null,- "capture_method": "automatic",- "charges": {- "data": [],- "has_more": false,- "object": "list",- "total_count": 0,- "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000004"- },- "client_secret": "pi_NORMALIZED00000000000004_secret_pGK5Rn2YumGNyweV1OMpxf0rK",- "confirmation_method": "automatic",- "created": 1000000000,- "currency": "usd",- "customer": "cus_NORMALIZED0005",- "description": "Payment for Invoice",- "id": "pi_NORMALIZED00000000000004",- "invoice": "in_NORMALIZED00000000000002",- "last_payment_error": null,- "latest_charge": null,- "livemode": false,- "metadata": {},- "next_action": null,- "object": "payment_intent",- "on_behalf_of": null,- "payment_method": null,- "payment_method_configuration_details": null,- "payment_method_options": {- "card": {- "installments": null,- "mandate_options": null,- "network": null,- "request_three_d_secure": "automatic"- },- "cashapp": {}- },- "payment_method_types": [- "card",- "cashapp"- ],- "processing": null,- "receipt_email": "[email protected]",- "review": null,- "setup_future_usage": null,- "shipping": null,- "source": null,- "statement_descriptor": "Zulip Business",- "statement_descriptor_suffix": null,- "status": "requires_payment_method",- "transfer_data": null,- "transfer_group": null- }- },- "id": "evt_3P41kYDEQaroqDjs1EWZy8de",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0013",- "idempotency_key": "9766f80b-785a-4fc9-a672-dbc3b220859e"- },- "type": "payment_intent.created"}],- "has_more": true,+ "has_more": false,"object": "list","url": "/v1/events"}diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.4.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.4.jsonindex 6cd366b56ec..6d922067afe 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.4.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.4.json@@ -1,1231 +1,6 @@{- "data": [- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "address": null,- "balance": 0,- "created": 1000000000,- "currency": "usd",- "default_currency": "usd",- "default_source": "src_NORMALIZED00000000000001",- "delinquent": false,- "description": "test-realm-3 (test-realm-3)",- "discount": null,- "email": "[email protected]",- "id": "cus_NORMALIZED0004",- "invoice_prefix": "NORMA03",- "invoice_settings": {- "custom_fields": null,- "default_payment_method": null,- "footer": null,- "rendering_options": null- },- "livemode": false,- "metadata": {- "realm_id": "3",- "realm_str": "test-realm-3"- },- "name": null,- "next_invoice_sequence": 2,- "object": "customer",- "phone": null,- "preferred_locales": [],- "shipping": null,- "tax_exempt": "none",- "test_clock": null- },- "previous_attributes": {- "default_source": null- }- },- "id": "evt_1P41kbDEQaroqDjstTbQC9c6",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": null,- "idempotency_key": "1a113b04-179c-4d01-9f46-19d8ddec7d62"- },- "type": "customer.updated"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "address": null,- "balance": 0,- "created": 1000000000,- "currency": null,- "default_currency": null,- "default_source": null,- "delinquent": false,- "description": "test-realm-5 (test-realm-5)",- "discount": null,- "email": "[email protected]",- "id": "cus_NORMALIZED0006",- "invoice_prefix": "NORMA04",- "invoice_settings": {- "custom_fields": null,- "default_payment_method": null,- "footer": null,- "rendering_options": null- },- "livemode": false,- "metadata": {- "realm_id": "4",- "realm_str": "test-realm-5"- },- "name": null,- "next_invoice_sequence": 1,- "object": "customer",- "phone": null,- "preferred_locales": [],- "shipping": null,- "tax_exempt": "none",- "test_clock": null- }- },- "id": "evt_1P41kbDEQaroqDjsE2M48oDv",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0015",- "idempotency_key": "c891730e-622f-4a8f-9bc6-b6eac075077e"- },- "type": "customer.created"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "amount": 10000,- "currency": "usd",- "customer": "cus_NORMALIZED0003",- "date": 1000000000,- "description": "Zulip Basic - renewal",- "discountable": false,- "discounts": [],- "id": "ii_NORMALIZED00000000000007",- "invoice": null,- "livemode": false,- "metadata": {},- "object": "invoiceitem",- "period": {- "end": 1338606245,- "start": 1335927845- },- "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": 10000,- "unit_amount_decimal": "10000"- },- "proration": false,- "quantity": 1,- "subscription": null,- "tax_rates": [],- "test_clock": null,- "unit_amount": 10000,- "unit_amount_decimal": "10000"- }- },- "id": "evt_1P41kaDEQaroqDjsbODpPI7X",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0016",- "idempotency_key": "ba7f4617-24b4-4cab-96f6-2198f0a7bed4"- },- "type": "invoiceitem.created"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "address": null,- "balance": 0,- "created": 1000000000,- "currency": null,- "default_currency": null,- "default_source": null,- "delinquent": false,- "description": "test-realm-4 (test-realm-4)",- "discount": null,- "email": "[email protected]",- "id": "cus_NORMALIZED0007",- "invoice_prefix": "NORMA05",- "invoice_settings": {- "custom_fields": null,- "default_payment_method": null,- "footer": null,- "rendering_options": null- },- "livemode": false,- "metadata": {- "realm_id": "5",- "realm_str": "test-realm-4"- },- "name": null,- "next_invoice_sequence": 1,- "object": "customer",- "phone": null,- "preferred_locales": [],- "shipping": null,- "tax_exempt": "none",- "test_clock": null- }- },- "id": "evt_1P41kaDEQaroqDjsY5Nd9JUa",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0017",- "idempotency_key": "92d7dfec-1b94-4f74-8fca-f291176dd732"- },- "type": "customer.created"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "account_country": "US",- "account_name": "Kandra Labs, Inc.",- "account_tax_ids": null,- "amount_due": 10000,- "amount_paid": 0,- "amount_remaining": 10000,- "amount_shipping": 0,- "application": null,- "application_fee_amount": null,- "attempt_count": 0,- "attempted": false,- "auto_advance": true,- "automatic_tax": {- "enabled": false,- "liability": null,- "status": null- },- "billing_reason": "manual",- "charge": null,- "collection_method": "charge_automatically",- "created": 1000000000,- "currency": "usd",- "custom_fields": null,- "customer": "cus_NORMALIZED0003",- "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQeUs3eGZGMEljTURKbDB2bk5FaFJiZlcxU0FKLDEwMzI5ODYyNA02004Yywa8E7?s=ap",- "id": "in_NORMALIZED00000000000005",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQeUs3eGZGMEljTURKbDB2bk5FaFJiZlcxU0FKLDEwMzI5ODYyNA02004Yywa8E7/pdf?s=ap",- "issuer": {- "type": "self"- },- "last_finalization_error": null,- "latest_revision": null,- "lines": {- "data": [- {- "amount": 10000,- "amount_excluding_tax": 10000,- "currency": "usd",- "description": "Zulip Basic - renewal",- "discount_amounts": [],- "discountable": false,- "discounts": [],- "id": "il_NORMALIZED00000000000005",- "invoice": "in_NORMALIZED00000000000005",- "invoice_item": "ii_NORMALIZED00000000000006",- "livemode": false,- "metadata": {},- "object": "line_item",- "period": {- "end": 1335927845,- "start": 1333335845- },- "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": 10000,- "unit_amount_decimal": "10000"- },- "proration": false,- "proration_details": {- "credited_items": null- },- "quantity": 1,- "subscription": null,- "tax_amounts": [],- "tax_rates": [],- "type": "invoiceitem",- "unit_amount_excluding_tax": "10000"- }- ],- "has_more": false,- "object": "list",- "total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000005/lines"- },- "livemode": false,- "metadata": {},- "next_payment_attempt": 1000000000,- "number": "NORMALI-0004",- "object": "invoice",- "on_behalf_of": null,- "paid": false,- "paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000005",- "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 Basic",- "status": "open",- "status_transitions": {- "finalized_at": 1000000000,- "marked_uncollectible_at": null,- "paid_at": null,- "voided_at": null- },- "subscription": null,- "subscription_details": {- "metadata": null- },- "subtotal": 10000,- "subtotal_excluding_tax": 10000,- "tax": null,- "test_clock": null,- "total": 10000,- "total_discount_amounts": [],- "total_excluding_tax": 10000,- "total_tax_amounts": [],- "transfer_data": null,- "webhooks_delivered_at": 1000000000- }- },- "id": "evt_1P41kaDEQaroqDjsdJQB0pCd",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0018",- "idempotency_key": "576e2d24-1935-42e6-8ee4-3a49e9349d93"- },- "type": "invoice.finalized"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "account_country": "US",- "account_name": "Kandra Labs, Inc.",- "account_tax_ids": null,- "amount_due": 10000,- "amount_paid": 0,- "amount_remaining": 10000,- "amount_shipping": 0,- "application": null,- "application_fee_amount": null,- "attempt_count": 0,- "attempted": false,- "auto_advance": true,- "automatic_tax": {- "enabled": false,- "liability": null,- "status": null- },- "billing_reason": "manual",- "charge": null,- "collection_method": "charge_automatically",- "created": 1000000000,- "currency": "usd",- "custom_fields": null,- "customer": "cus_NORMALIZED0003",- "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQeUs3eGZGMEljTURKbDB2bk5FaFJiZlcxU0FKLDEwMzI5ODYyNA02004Yywa8E7?s=ap",- "id": "in_NORMALIZED00000000000005",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQeUs3eGZGMEljTURKbDB2bk5FaFJiZlcxU0FKLDEwMzI5ODYyNA02004Yywa8E7/pdf?s=ap",- "issuer": {- "type": "self"- },- "last_finalization_error": null,- "latest_revision": null,- "lines": {- "data": [- {- "amount": 10000,- "amount_excluding_tax": 10000,- "currency": "usd",- "description": "Zulip Basic - renewal",- "discount_amounts": [],- "discountable": false,- "discounts": [],- "id": "il_NORMALIZED00000000000005",- "invoice": "in_NORMALIZED00000000000005",- "invoice_item": "ii_NORMALIZED00000000000006",- "livemode": false,- "metadata": {},- "object": "line_item",- "period": {- "end": 1335927845,- "start": 1333335845- },- "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": 10000,- "unit_amount_decimal": "10000"- },- "proration": false,- "proration_details": {- "credited_items": null- },- "quantity": 1,- "subscription": null,- "tax_amounts": [],- "tax_rates": [],- "type": "invoiceitem",- "unit_amount_excluding_tax": "10000"- }- ],- "has_more": false,- "object": "list",- "total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000005/lines"- },- "livemode": false,- "metadata": {},- "next_payment_attempt": 1000000000,- "number": "NORMALI-0004",- "object": "invoice",- "on_behalf_of": null,- "paid": false,- "paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000005",- "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 Basic",- "status": "open",- "status_transitions": {- "finalized_at": 1000000000,- "marked_uncollectible_at": null,- "paid_at": null,- "voided_at": null- },- "subscription": null,- "subscription_details": {- "metadata": null- },- "subtotal": 10000,- "subtotal_excluding_tax": 10000,- "tax": null,- "test_clock": null,- "total": 10000,- "total_discount_amounts": [],- "total_excluding_tax": 10000,- "total_tax_amounts": [],- "transfer_data": null,- "webhooks_delivered_at": 1000000000- },- "previous_attributes": {- "effective_at": null,- "ending_balance": null,- "hosted_invoice_url": null,- "invoice_pdf": null,- "number": null,- "payment_intent": null,- "rendering": {- "pdf": {- "page_size": "auto"- }- },- "status": "draft",- "status_transitions": {- "finalized_at": null- }- }- },- "id": "evt_1P41kaDEQaroqDjsdMdifORm",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0018",- "idempotency_key": "576e2d24-1935-42e6-8ee4-3a49e9349d93"- },- "type": "invoice.updated"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "amount": 10000,- "amount_capturable": 0,- "amount_details": {- "tip": {}- },- "amount_received": 0,- "application": null,- "application_fee_amount": null,- "automatic_payment_methods": null,- "canceled_at": null,- "cancellation_reason": null,- "capture_method": "automatic",- "charges": {- "data": [],- "has_more": false,- "object": "list",- "total_count": 0,- "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000005"- },- "client_secret": "pi_NORMALIZED00000000000005_secret_lDH9YDgvzCPNwPrtBXElseMIK",- "confirmation_method": "automatic",- "created": 1000000000,- "currency": "usd",- "customer": "cus_NORMALIZED0003",- "description": "Payment for Invoice",- "id": "pi_NORMALIZED00000000000005",- "invoice": "in_NORMALIZED00000000000005",- "last_payment_error": null,- "latest_charge": null,- "livemode": false,- "metadata": {},- "next_action": null,- "object": "payment_intent",- "on_behalf_of": null,- "payment_method": null,- "payment_method_configuration_details": null,- "payment_method_options": {- "card": {- "installments": null,- "mandate_options": null,- "network": null,- "request_three_d_secure": "automatic"- },- "cashapp": {}- },- "payment_method_types": [- "card",- "cashapp"- ],- "processing": null,- "receipt_email": "[email protected]",- "review": null,- "setup_future_usage": null,- "shipping": null,- "source": null,- "statement_descriptor": "Zulip Basic",- "statement_descriptor_suffix": null,- "status": "requires_payment_method",- "transfer_data": null,- "transfer_group": null- }- },- "id": "evt_3P41kaDEQaroqDjs14UQjPC3",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0018",- "idempotency_key": "576e2d24-1935-42e6-8ee4-3a49e9349d93"- },- "type": "payment_intent.created"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "account_country": "US",- "account_name": "Kandra Labs, Inc.",- "account_tax_ids": null,- "amount_due": 48000,- "amount_paid": 0,- "amount_remaining": 48000,- "amount_shipping": 0,- "application": null,- "application_fee_amount": null,- "attempt_count": 0,- "attempted": false,- "auto_advance": false,- "automatic_tax": {- "enabled": false,- "liability": null,- "status": null- },- "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQVFpoUHlFUUpQSkUwc3ZDekVwc2tnRXhaSFJSLDEwMzI5ODYyNA0200iTGMd87e?s=ap",- "id": "in_NORMALIZED00000000000004",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQVFpoUHlFUUpQSkUwc3ZDekVwc2tnRXhaSFJSLDEwMzI5ODYyNA0200iTGMd87e/pdf?s=ap",- "issuer": {- "type": "self"- },- "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_NORMALIZED00000000000006",- "invoice": "in_NORMALIZED00000000000004",- "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"- }- ],- "has_more": false,- "object": "list",- "total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000004/lines"- },- "livemode": false,- "metadata": {- "billing_schedule": "1",- "license_management": "automatic",- "licenses": "6",- "on_free_trial": "False",- "plan_tier": "1",- "user_id": "10"- },- "next_payment_attempt": null,- "number": "NORMALI-0005",- "object": "invoice",- "on_behalf_of": null,- "paid": false,- "paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000003",- "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": "open",- "status_transitions": {- "finalized_at": 1000000000,- "marked_uncollectible_at": null,- "paid_at": null,- "voided_at": null- },- "subscription": null,- "subscription_details": {- "metadata": null- },- "subtotal": 48000,- "subtotal_excluding_tax": 48000,- "tax": null,- "test_clock": null,- "total": 48000,- "total_discount_amounts": [],- "total_excluding_tax": 48000,- "total_tax_amounts": [],- "transfer_data": null,- "webhooks_delivered_at": null- }- },- "id": "evt_1P41kaDEQaroqDjsUM5p3NKH",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0009",- "idempotency_key": "a5f92760-f81c-4b14-a4d5-727bd1293e68"- },- "type": "invoice.finalized"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "account_country": "US",- "account_name": "Kandra Labs, Inc.",- "account_tax_ids": null,- "amount_due": 48000,- "amount_paid": 0,- "amount_remaining": 48000,- "amount_shipping": 0,- "application": null,- "application_fee_amount": null,- "attempt_count": 0,- "attempted": false,- "auto_advance": false,- "automatic_tax": {- "enabled": false,- "liability": null,- "status": null- },- "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQVFpoUHlFUUpQSkUwc3ZDekVwc2tnRXhaSFJSLDEwMzI5ODYyMw02004QaAPaaq?s=ap",- "id": "in_NORMALIZED00000000000004",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQVFpoUHlFUUpQSkUwc3ZDekVwc2tnRXhaSFJSLDEwMzI5ODYyMw02004QaAPaaq/pdf?s=ap",- "issuer": {- "type": "self"- },- "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_NORMALIZED00000000000006",- "invoice": "in_NORMALIZED00000000000004",- "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"- }- ],- "has_more": false,- "object": "list",- "total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000004/lines"- },- "livemode": false,- "metadata": {- "billing_schedule": "1",- "license_management": "automatic",- "licenses": "6",- "on_free_trial": "False",- "plan_tier": "1",- "user_id": "10"- },- "next_payment_attempt": null,- "number": "NORMALI-0005",- "object": "invoice",- "on_behalf_of": null,- "paid": false,- "paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000003",- "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": "open",- "status_transitions": {- "finalized_at": 1000000000,- "marked_uncollectible_at": null,- "paid_at": null,- "voided_at": null- },- "subscription": null,- "subscription_details": {- "metadata": null- },- "subtotal": 48000,- "subtotal_excluding_tax": 48000,- "tax": null,- "test_clock": null,- "total": 48000,- "total_discount_amounts": [],- "total_excluding_tax": 48000,- "total_tax_amounts": [],- "transfer_data": null,- "webhooks_delivered_at": null- },- "previous_attributes": {- "effective_at": null,- "ending_balance": null,- "hosted_invoice_url": null,- "invoice_pdf": null,- "number": null,- "payment_intent": null,- "rendering": {- "pdf": {- "page_size": "auto"- }- },- "status": "draft",- "status_transitions": {- "finalized_at": null- }- }- },- "id": "evt_1P41kZDEQaroqDjsWzFGf3rC",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0009",- "idempotency_key": "a5f92760-f81c-4b14-a4d5-727bd1293e68"- },- "type": "invoice.updated"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "account_country": "US",- "account_name": "Kandra Labs, Inc.",- "account_tax_ids": null,- "amount_due": 10000,- "amount_paid": 0,- "amount_remaining": 10000,- "amount_shipping": 0,- "application": null,- "application_fee_amount": null,- "attempt_count": 0,- "attempted": false,- "auto_advance": true,- "automatic_tax": {- "enabled": false,- "liability": null,- "status": null- },- "billing_reason": "manual",- "charge": null,- "collection_method": "send_invoice",- "created": 1000000000,- "currency": "usd",- "custom_fields": null,- "customer": "cus_NORMALIZED0004",- "customer_address": null,- "customer_email": "[email protected]",- "customer_name": null,- "customer_phone": null,- "customer_shipping": null,- "customer_tax_exempt": "none",- "customer_tax_ids": [],- "default_payment_method": null,- "default_source": null,- "default_tax_rates": [],- "description": null,- "discount": null,- "discounts": [],- "due_date": 1000000000,- "effective_at": 1000000000,- "ending_balance": 0,- "footer": null,- "from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQallHRzlGOTFta3dhVUh3aG1ua3phOFRnRDB5LDEwMzI5ODYyMw0200Ub4V6b03?s=ap",- "id": "in_NORMALIZED00000000000003",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQallHRzlGOTFta3dhVUh3aG1ua3phOFRnRDB5LDEwMzI5ODYyMw0200Ub4V6b03/pdf?s=ap",- "issuer": {- "type": "self"- },- "last_finalization_error": null,- "latest_revision": null,- "lines": {- "data": [- {- "amount": 10000,- "amount_excluding_tax": 10000,- "currency": "usd",- "description": "Zulip Cloud Standard",- "discount_amounts": [],- "discountable": false,- "discounts": [],- "id": "il_NORMALIZED00000000000004",- "invoice": "in_NORMALIZED00000000000003",- "invoice_item": "ii_NORMALIZED00000000000003",- "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_NORMALIZED00000000000003",- "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": 10000,- "unit_amount_decimal": "10000"- },- "proration": false,- "proration_details": {- "credited_items": null- },- "quantity": 1,- "subscription": null,- "tax_amounts": [],- "tax_rates": [],- "type": "invoiceitem",- "unit_amount_excluding_tax": "10000"- }- ],- "has_more": false,- "object": "list",- "total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000003/lines"- },- "livemode": false,- "metadata": {},- "next_payment_attempt": null,- "number": "NORMALI-0006",- "object": "invoice",- "on_behalf_of": null,- "paid": false,- "paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000002",- "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": "open",- "status_transitions": {- "finalized_at": 1000000000,- "marked_uncollectible_at": null,- "paid_at": null,- "voided_at": null- },- "subscription": null,- "subscription_details": {- "metadata": null- },- "subtotal": 10000,- "subtotal_excluding_tax": 10000,- "tax": null,- "test_clock": null,- "total": 10000,- "total_discount_amounts": [],- "total_excluding_tax": 10000,- "total_tax_amounts": [],- "transfer_data": null,- "webhooks_delivered_at": null- }- },- "id": "evt_1P41kZDEQaroqDjsp2H1e0W8",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0008",- "idempotency_key": "3909aab6-a24b-40ec-8363-eb8e881e16e3"- },- "type": "invoice.finalized"- }- ],- "has_more": true,+ "data": [],+ "has_more": false,"object": "list","url": "/v1/events"}diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.5.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.5.jsonindex db3b88320b9..5cebcf07327 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.5.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.5.json@@ -1,5 +1,523 @@{"data": [+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 10000,+ "amount_paid": 0,+ "amount_remaining": 10000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": true,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "send_invoice",+ "created": 1000000000,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0006",+ "customer_address": null,+ "customer_email": "[email protected]",+ "customer_name": null,+ "customer_phone": null,+ "customer_shipping": null,+ "customer_tax_exempt": "none",+ "customer_tax_ids": [],+ "default_payment_method": null,+ "default_source": null,+ "default_tax_rates": [],+ "description": null,+ "discount": null,+ "discounts": [],+ "due_date": 1000000000,+ "effective_at": 1000000000,+ "ending_balance": 0,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKeXRRclNFcWwxT05KZ3NLTWtlVWxSblRRaEZDLDEwMzc5Njc1Mg0200tFr80OGl?s=ap",+ "id": "in_NORMALIZED00000000000008",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKeXRRclNFcWwxT05KZ3NLTWtlVWxSblRRaEZDLDEwMzc5Njc1Mg0200tFr80OGl/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 10000,+ "amount_excluding_tax": 10000,+ "currency": "usd",+ "description": "Zulip Cloud Standard",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000009",+ "invoice": "in_NORMALIZED00000000000008",+ "invoice_item": "ii_NORMALIZED00000000000009",+ "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": 10000,+ "unit_amount_decimal": "10000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 1,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "10000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000008/lines"+ },+ "livemode": false,+ "metadata": {},+ "next_payment_attempt": null,+ "number": "NORMALI-0006",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "paid_out_of_band": false,+ "payment_intent": "pi_NORMALIZED00000000000006",+ "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": "open",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 10000,+ "subtotal_excluding_tax": 10000,+ "tax": null,+ "test_clock": null,+ "total": 10000,+ "total_discount_amounts": [],+ "total_excluding_tax": 10000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": null+ }+ },+ "id": "evt_1P67KuDEQaroqDjs8jGdX3jG",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0023",+ "idempotency_key": "a734995f-4109-454c-abbb-9b9d0fa87912"+ },+ "type": "invoice.finalized"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 10000,+ "amount_paid": 0,+ "amount_remaining": 10000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": true,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "send_invoice",+ "created": 1000000000,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0006",+ "customer_address": null,+ "customer_email": "[email protected]",+ "customer_name": null,+ "customer_phone": null,+ "customer_shipping": null,+ "customer_tax_exempt": "none",+ "customer_tax_ids": [],+ "default_payment_method": null,+ "default_source": null,+ "default_tax_rates": [],+ "description": null,+ "discount": null,+ "discounts": [],+ "due_date": 1000000000,+ "effective_at": 1000000000,+ "ending_balance": 0,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKeXRRclNFcWwxT05KZ3NLTWtlVWxSblRRaEZDLDEwMzc5Njc1MQ0200MGFIlTMv?s=ap",+ "id": "in_NORMALIZED00000000000008",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKeXRRclNFcWwxT05KZ3NLTWtlVWxSblRRaEZDLDEwMzc5Njc1MQ0200MGFIlTMv/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 10000,+ "amount_excluding_tax": 10000,+ "currency": "usd",+ "description": "Zulip Cloud Standard",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000009",+ "invoice": "in_NORMALIZED00000000000008",+ "invoice_item": "ii_NORMALIZED00000000000009",+ "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": 10000,+ "unit_amount_decimal": "10000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 1,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "10000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000008/lines"+ },+ "livemode": false,+ "metadata": {},+ "next_payment_attempt": null,+ "number": "NORMALI-0006",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "paid_out_of_band": false,+ "payment_intent": "pi_NORMALIZED00000000000006",+ "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": "open",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 10000,+ "subtotal_excluding_tax": 10000,+ "tax": null,+ "test_clock": null,+ "total": 10000,+ "total_discount_amounts": [],+ "total_excluding_tax": 10000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": null+ },+ "previous_attributes": {+ "effective_at": null,+ "ending_balance": null,+ "hosted_invoice_url": null,+ "invoice_pdf": null,+ "number": null,+ "payment_intent": null,+ "rendering": {+ "pdf": {+ "page_size": "auto"+ }+ },+ "status": "draft",+ "status_transitions": {+ "finalized_at": null+ }+ }+ },+ "id": "evt_1P67KuDEQaroqDjsuDXMeS4h",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0023",+ "idempotency_key": "a734995f-4109-454c-abbb-9b9d0fa87912"+ },+ "type": "invoice.updated"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "amount": 10000,+ "amount_capturable": 0,+ "amount_details": {+ "tip": {}+ },+ "amount_received": 0,+ "application": null,+ "application_fee_amount": null,+ "automatic_payment_methods": null,+ "canceled_at": null,+ "cancellation_reason": null,+ "capture_method": "automatic",+ "charges": {+ "data": [],+ "has_more": false,+ "object": "list",+ "total_count": 0,+ "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000006"+ },+ "client_secret": "pi_NORMALIZED00000000000006_secret_L7gqWYJorn5AkawkGR2qUZq6A",+ "confirmation_method": "automatic",+ "created": 1000000000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0006",+ "description": "Payment for Invoice",+ "id": "pi_NORMALIZED00000000000006",+ "invoice": "in_NORMALIZED00000000000008",+ "last_payment_error": null,+ "latest_charge": null,+ "livemode": false,+ "metadata": {},+ "next_action": null,+ "object": "payment_intent",+ "on_behalf_of": null,+ "payment_method": null,+ "payment_method_configuration_details": null,+ "payment_method_options": {+ "card": {+ "installments": null,+ "mandate_options": null,+ "network": null,+ "request_three_d_secure": "automatic"+ },+ "cashapp": {},+ "wechat_pay": {+ "app_id": null,+ "client": null+ }+ },+ "payment_method_types": [+ "ach_credit_transfer",+ "card",+ "cashapp",+ "wechat_pay"+ ],+ "processing": null,+ "receipt_email": "[email protected]",+ "review": null,+ "setup_future_usage": null,+ "shipping": null,+ "source": null,+ "statement_descriptor": "Zulip Cloud Standard",+ "statement_descriptor_suffix": null,+ "status": "requires_payment_method",+ "transfer_data": null,+ "transfer_group": null+ }+ },+ "id": "evt_3P67KtDEQaroqDjs0STvh6b9",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0023",+ "idempotency_key": "a734995f-4109-454c-abbb-9b9d0fa87912"+ },+ "type": "payment_intent.created"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "amount": 10000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0002",+ "date": 1000000000,+ "description": "Zulip Basic - renewal",+ "discountable": false,+ "discounts": [],+ "id": "ii_NORMALIZED00000000000010",+ "invoice": null,+ "livemode": false,+ "metadata": {},+ "object": "invoiceitem",+ "period": {+ "end": 1341198245,+ "start": 1338606245+ },+ "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": 10000,+ "unit_amount_decimal": "10000"+ },+ "proration": false,+ "quantity": 1,+ "subscription": null,+ "tax_rates": [],+ "test_clock": null,+ "unit_amount": 10000,+ "unit_amount_decimal": "10000"+ }+ },+ "id": "evt_1P67KtDEQaroqDjsytbncCkc",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0024",+ "idempotency_key": "c7b35795-3261-451a-a141-0ce33e06ac68"+ },+ "type": "invoiceitem.created"+ },{"api_version": "2020-08-27","created": 1000000000,@@ -47,9 +565,9 @@"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQVFpoUHlFUUpQSkUwc3ZDekVwc2tnRXhaSFJSLDEwMzI5ODYyNg0200gFNfJUOM?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKZWdzRW1XVURrc2JhM2lDSjVneEZMQlJMZ3k4LDEwMzc5Njc1MQ0200owKohrRW?s=ap","id": "in_NORMALIZED00000000000004",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQVFpoUHlFUUpQSkUwc3ZDekVwc2tnRXhaSFJSLDEwMzI5ODYyNg0200gFNfJUOM/pdf?s=ap",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKZWdzRW1XVURrc2JhM2lDSjVneEZMQlJMZ3k4LDEwMzc5Njc1MQ0200owKohrRW/pdf?s=ap","issuer": {"type": "self"},@@ -65,9 +583,9 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000006",+ "id": "il_NORMALIZED00000000000004","invoice": "in_NORMALIZED00000000000004",- "invoice_item": "ii_NORMALIZED00000000000001",+ "invoice_item": "ii_NORMALIZED00000000000004","livemode": false,"metadata": {},"object": "line_item",@@ -82,13 +600,13 @@"created": 1000000000,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000001",+ "id": "price_NORMALIZED00000000000003","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0001",+ "product": "prod_NORMALIZED0002","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -124,12 +642,12 @@"user_id": "10"},"next_payment_attempt": null,- "number": "NORMALI-0005",+ "number": "NORMALI-0004","object": "invoice","on_behalf_of": null,"paid": true,"paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000003",+ "payment_intent": "pi_NORMALIZED00000000000004","payment_settings": {"default_mandate": null,"payment_method_options": null,@@ -175,13 +693,13 @@"webhooks_delivered_at": 1000000000}},- "id": "evt_1P41kcDEQaroqDjsCKun7mUF",+ "id": "evt_1P67KuDEQaroqDjsrLsfRJtl","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0019",- "idempotency_key": "a12b80d6-2321-43f9-a7cc-495689da9427"+ "id": "req_NORMALIZED0025",+ "idempotency_key": "ad82f7d0-1a12-4d73-9757-16a581c067cf"},"type": "invoice.payment_succeeded"},@@ -232,9 +750,9 @@"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQVFpoUHlFUUpQSkUwc3ZDekVwc2tnRXhaSFJSLDEwMzI5ODYyNg0200gFNfJUOM?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKZWdzRW1XVURrc2JhM2lDSjVneEZMQlJMZ3k4LDEwMzc5Njc1MQ0200owKohrRW?s=ap","id": "in_NORMALIZED00000000000004",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQVFpoUHlFUUpQSkUwc3ZDekVwc2tnRXhaSFJSLDEwMzI5ODYyNg0200gFNfJUOM/pdf?s=ap",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKZWdzRW1XVURrc2JhM2lDSjVneEZMQlJMZ3k4LDEwMzc5Njc1MQ0200owKohrRW/pdf?s=ap","issuer": {"type": "self"},@@ -250,9 +768,9 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000006",+ "id": "il_NORMALIZED00000000000004","invoice": "in_NORMALIZED00000000000004",- "invoice_item": "ii_NORMALIZED00000000000001",+ "invoice_item": "ii_NORMALIZED00000000000004","livemode": false,"metadata": {},"object": "line_item",@@ -267,13 +785,13 @@"created": 1000000000,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000001",+ "id": "price_NORMALIZED00000000000003","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0001",+ "product": "prod_NORMALIZED0002","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -309,12 +827,12 @@"user_id": "10"},"next_payment_attempt": null,- "number": "NORMALI-0005",+ "number": "NORMALI-0004","object": "invoice","on_behalf_of": null,"paid": true,"paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000003",+ "payment_intent": "pi_NORMALIZED00000000000004","payment_settings": {"default_mandate": null,"payment_method_options": null,@@ -360,13 +878,13 @@"webhooks_delivered_at": 1000000000}},- "id": "evt_1P41kcDEQaroqDjskQDNXwyP",+ "id": "evt_1P67KtDEQaroqDjsZwYFKKrQ","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0019",- "idempotency_key": "a12b80d6-2321-43f9-a7cc-495689da9427"+ "id": "req_NORMALIZED0025",+ "idempotency_key": "ad82f7d0-1a12-4d73-9757-16a581c067cf"},"type": "invoice.paid"},@@ -417,9 +935,9 @@"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQVFpoUHlFUUpQSkUwc3ZDekVwc2tnRXhaSFJSLDEwMzI5ODYyNg0200gFNfJUOM?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKZWdzRW1XVURrc2JhM2lDSjVneEZMQlJMZ3k4LDEwMzc5Njc1MQ0200owKohrRW?s=ap","id": "in_NORMALIZED00000000000004",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQVFpoUHlFUUpQSkUwc3ZDekVwc2tnRXhaSFJSLDEwMzI5ODYyNg0200gFNfJUOM/pdf?s=ap",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKZWdzRW1XVURrc2JhM2lDSjVneEZMQlJMZ3k4LDEwMzc5Njc1MQ0200owKohrRW/pdf?s=ap","issuer": {"type": "self"},@@ -435,9 +953,9 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000006",+ "id": "il_NORMALIZED00000000000004","invoice": "in_NORMALIZED00000000000004",- "invoice_item": "ii_NORMALIZED00000000000001",+ "invoice_item": "ii_NORMALIZED00000000000004","livemode": false,"metadata": {},"object": "line_item",@@ -452,13 +970,13 @@"created": 1000000000,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000001",+ "id": "price_NORMALIZED00000000000003","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0001",+ "product": "prod_NORMALIZED0002","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,@@ -494,12 +1012,12 @@"user_id": "10"},"next_payment_attempt": null,- "number": "NORMALI-0005",+ "number": "NORMALI-0004","object": "invoice","on_behalf_of": null,"paid": true,"paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000003",+ "payment_intent": "pi_NORMALIZED00000000000004","payment_settings": {"default_mandate": null,"payment_method_options": null,@@ -557,13 +1075,13 @@}}},- "id": "evt_1P41kcDEQaroqDjszW6gQNFc",+ "id": "evt_1P67KtDEQaroqDjsxEnuRuQY","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0019",- "idempotency_key": "a12b80d6-2321-43f9-a7cc-495689da9427"+ "id": "req_NORMALIZED0025",+ "idempotency_key": "ad82f7d0-1a12-4d73-9757-16a581c067cf"},"type": "invoice.updated"},@@ -636,8 +1154,8 @@"type": "authorized"},"paid": true,- "payment_intent": "pi_NORMALIZED00000000000003",- "payment_method": "pm_1P41kTDEQaroqDjsnRkdmbrR",+ "payment_intent": "pi_NORMALIZED00000000000004",+ "payment_method": "pm_1P67KkDEQaroqDjsB7cKBfEM","payment_method_details": {"card": {"amount_authorized": 48000,@@ -680,7 +1198,7 @@"radar_options": {},"receipt_email": "[email protected]","receipt_number": null,- "receipt_url": "https://pay.stripe.com/receipts/invoices/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKMK42rAGMgbWxG1WSMg6LBZMgRCqRrAjCSTvwLhQAqCj3PMakcS3MbZyDJ31_cvUHM6wbzvmyeIB3otq?s=ap",+ "receipt_url": "https://pay.stripe.com/receipts/invoices/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKI_s-LAGMgaHTBOZ5wk6LBbnVEKojeegblgsSVJNnj8H_KZQKgPL6SDgoRD67ODbjzwW3Z903gySm0sD?s=ap","refunded": false,"refunds": {"data": [],@@ -703,15 +1221,15 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000003"+ "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000004"},- "client_secret": "pi_NORMALIZED00000000000003_secret_MG7h6vWTK4qcjjXQxDAynnxhr",+ "client_secret": "pi_NORMALIZED00000000000004_secret_oSg7HsOxosMOjokQb7AmErj3n","confirmation_method": "automatic","created": 1000000000,"currency": "usd","customer": "cus_NORMALIZED0001","description": "Payment for Invoice",- "id": "pi_NORMALIZED00000000000003",+ "id": "pi_NORMALIZED00000000000004","invoice": "in_NORMALIZED00000000000004","last_payment_error": null,"latest_charge": "ch_NORMALIZED00000000000001",@@ -720,7 +1238,7 @@"next_action": null,"object": "payment_intent","on_behalf_of": null,- "payment_method": "pm_1P41kTDEQaroqDjsnRkdmbrR",+ "payment_method": "pm_1P67KkDEQaroqDjsB7cKBfEM","payment_method_configuration_details": null,"payment_method_options": {"card": {@@ -748,13 +1266,13 @@"transfer_group": null}},- "id": "evt_3P41kZDEQaroqDjs1QPH7xE9",+ "id": "evt_3P67KqDEQaroqDjs1XI8W7ys","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0019",- "idempotency_key": "a12b80d6-2321-43f9-a7cc-495689da9427"+ "id": "req_NORMALIZED0025",+ "idempotency_key": "ad82f7d0-1a12-4d73-9757-16a581c067cf"},"type": "payment_intent.succeeded"},@@ -812,8 +1330,8 @@"type": "authorized"},"paid": true,- "payment_intent": "pi_NORMALIZED00000000000003",- "payment_method": "pm_1P41kTDEQaroqDjsnRkdmbrR",+ "payment_intent": "pi_NORMALIZED00000000000004",+ "payment_method": "pm_1P67KkDEQaroqDjsB7cKBfEM","payment_method_details": {"card": {"amount_authorized": 48000,@@ -856,7 +1374,7 @@"radar_options": {},"receipt_email": "[email protected]","receipt_number": null,- "receipt_url": "https://pay.stripe.com/receipts/invoices/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKMK42rAGMgbp1qpsOFc6LBbS2sKLm3AViDe9pcMtrbbyolfrVjVY_Lr43jHVJfu2fc2JTCuw2FF-P68g?s=ap",+ "receipt_url": "https://pay.stripe.com/receipts/invoices/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKI_s-LAGMgb4seZnbAA6LBZS30M_Yh9clKvvVg3pZpj0eIDK0xTCz70U7oWdmLtVijfvZqiWzLPxT0Yb?s=ap","refunded": false,"refunds": {"data": [],@@ -876,64 +1394,16 @@"transfer_group": null}},- "id": "evt_3P41kZDEQaroqDjs194nevw5",+ "id": "evt_3P67KqDEQaroqDjs1Wi72PbQ","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0019",- "idempotency_key": "a12b80d6-2321-43f9-a7cc-495689da9427"+ "id": "req_NORMALIZED0025",+ "idempotency_key": "ad82f7d0-1a12-4d73-9757-16a581c067cf"},"type": "charge.succeeded"},- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "address": null,- "balance": 0,- "created": 1000000000,- "currency": null,- "default_currency": null,- "default_source": null,- "delinquent": false,- "description": "demo.example.com 6cde5f7a-1f7",- "discount": null,- "email": "[email protected]",- "id": "cus_NORMALIZED0008",- "invoice_prefix": "NORMA06",- "invoice_settings": {- "custom_fields": null,- "default_payment_method": null,- "footer": null,- "rendering_options": null- },- "livemode": false,- "metadata": {- "remote_server_str": "demo.example.com 6cde5f7a-1f7",- "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"- },- "name": null,- "next_invoice_sequence": 1,- "object": "customer",- "phone": null,- "preferred_locales": [],- "shipping": null,- "tax_exempt": "none",- "test_clock": null- }- },- "id": "evt_1P41kbDEQaroqDjsePDdAj6j",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0020",- "idempotency_key": "4de781c2-b113-4af5-bd06-bd6dc2832f10"- },- "type": "customer.created"- },{"api_version": "2020-08-27","created": 1000000000,@@ -958,13 +1428,13 @@},"billing_reason": "manual","charge": null,- "collection_method": "charge_automatically",+ "collection_method": "send_invoice","created": 1000000000,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0003",+ "customer": "cus_NORMALIZED0006","customer_address": null,- "customer_email": "[email protected]",+ "customer_email": "[email protected]","customer_name": null,"customer_phone": null,"customer_shipping": null,@@ -976,13 +1446,13 @@"description": null,"discount": null,"discounts": [],- "due_date": null,+ "due_date": 1000000000,"effective_at": null,"ending_balance": null,"footer": null,"from_invoice": null,"hosted_invoice_url": null,- "id": "in_NORMALIZED00000000000006",+ "id": "in_NORMALIZED00000000000008","invoice_pdf": null,"issuer": {"type": "self"@@ -995,19 +1465,19 @@"amount": 10000,"amount_excluding_tax": 10000,"currency": "usd",- "description": "Zulip Basic - renewal",+ "description": "Zulip Cloud Standard","discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000007",- "invoice": "in_NORMALIZED00000000000006",- "invoice_item": "ii_NORMALIZED00000000000007",+ "id": "il_NORMALIZED00000000000009",+ "invoice": "in_NORMALIZED00000000000008",+ "invoice_item": "ii_NORMALIZED00000000000009","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1338606245,- "start": 1335927845+ "end": 1000000000,+ "start": 1000000000},"plan": null,"price": {@@ -1046,11 +1516,11 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000006/lines"+ "url": "/v1/invoices/in_NORMALIZED00000000000008/lines"},"livemode": false,"metadata": {},- "next_payment_attempt": 1000000000,+ "next_payment_attempt": null,"number": null,"object": "invoice","on_behalf_of": null,@@ -1078,7 +1548,7 @@"shipping_cost": null,"shipping_details": null,"starting_balance": 0,- "statement_descriptor": "Zulip Basic",+ "statement_descriptor": "Zulip Cloud Standard","status": "draft","status_transitions": {"finalized_at": null,@@ -1102,188 +1572,15 @@"webhooks_delivered_at": null}},- "id": "evt_1P41kbDEQaroqDjsJWOawbY7",+ "id": "evt_1P67KsDEQaroqDjs3FoxPLAu","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0021",- "idempotency_key": "7bd6270f-93b5-464a-bec2-13aed40e2953"+ "id": "req_NORMALIZED0026",+ "idempotency_key": "36ad17d8-55ff-4836-a31b-a8bce373d921"},"type": "invoice.created"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "amount": 10000,- "currency": "usd",- "customer": "cus_NORMALIZED0006",- "date": 1000000000,- "description": "Zulip Cloud Standard",- "discountable": false,- "discounts": [],- "id": "ii_NORMALIZED00000000000008",- "invoice": null,- "livemode": false,- "metadata": {},- "object": "invoiceitem",- "period": {- "end": 1000000000,- "start": 1000000000- },- "plan": null,- "price": {- "active": false,- "billing_scheme": "per_unit",- "created": 1000000000,- "currency": "usd",- "custom_unit_amount": null,- "id": "price_NORMALIZED00000000000003",- "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": 10000,- "unit_amount_decimal": "10000"- },- "proration": false,- "quantity": 1,- "subscription": null,- "tax_rates": [],- "test_clock": null,- "unit_amount": 10000,- "unit_amount_decimal": "10000"- }- },- "id": "evt_1P41kbDEQaroqDjsbGh7AlN5",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0022",- "idempotency_key": "45ea3b8e-372f-4981-8f83-523c3a6c0cb7"- },- "type": "invoiceitem.created"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "address": null,- "balance": 0,- "created": 1000000000,- "currency": "usd",- "default_currency": "usd",- "default_source": null,- "delinquent": false,- "description": "test-realm-5 (test-realm-5)",- "discount": null,- "email": "[email protected]",- "id": "cus_NORMALIZED0006",- "invoice_prefix": "NORMA04",- "invoice_settings": {- "custom_fields": null,- "default_payment_method": null,- "footer": null,- "rendering_options": null- },- "livemode": false,- "metadata": {- "realm_id": "4",- "realm_str": "test-realm-5"- },- "name": null,- "next_invoice_sequence": 1,- "object": "customer",- "phone": null,- "preferred_locales": [],- "shipping": null,- "tax_exempt": "none",- "test_clock": null- },- "previous_attributes": {- "currency": null,- "default_currency": null- }- },- "id": "evt_1P41kbDEQaroqDjsaMoD6U88",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0022",- "idempotency_key": "45ea3b8e-372f-4981-8f83-523c3a6c0cb7"- },- "type": "customer.updated"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "ach_credit_transfer": {- "account_number": "test_NORMALIZED02",- "bank_name": "TEST BANK",- "fingerprint": "NORMALIZED000002",- "refund_account_holder_name": null,- "refund_account_holder_type": null,- "refund_routing_number": null,- "routing_number": "110000000",- "swift_code": "TSTEZ122"- },- "amount": null,- "client_secret": "src_client_secret_NORMALIZED00000000000001",- "created": 1000000000,- "currency": "usd",- "customer": "cus_NORMALIZED0004",- "flow": "receiver",- "id": "src_NORMALIZED00000000000001",- "livemode": false,- "metadata": {},- "object": "source",- "owner": {- "address": null,- "email": "[email protected]",- "name": null,- "phone": null,- "verified_address": null,- "verified_email": null,- "verified_name": null,- "verified_phone": null- },- "receiver": {- "address": "000000000-test_NORMALIZED01",- "amount_charged": 0,- "amount_received": 0,- "amount_returned": 0,- "refund_attributes_method": "email",- "refund_attributes_status": "missing"- },- "statement_descriptor": null,- "status": "pending",- "type": "ach_credit_transfer",- "usage": "reusable"- }- },- "id": "evt_1P41kbDEQaroqDjsuXxmPVhI",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": null,- "idempotency_key": "1a113b04-179c-4d01-9f46-19d8ddec7d62"- },- "type": "customer.source.created"}],"has_more": true,diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.6.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.6.jsonindex f4b4f567bd0..5e642610c25 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.6.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.6.json@@ -1,5 +1,53 @@{"data": [+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": null,+ "default_currency": null,+ "default_source": null,+ "delinquent": false,+ "description": "test-realm-5 (test-realm-5)",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0008",+ "invoice_prefix": "NORMA07",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": null,+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "realm_id": "5",+ "realm_str": "test-realm-5"+ },+ "name": null,+ "next_invoice_sequence": 1,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+ }+ },+ "id": "evt_1P67KuDEQaroqDjs467ADlKa",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0027",+ "idempotency_key": "aa3e4cfb-5ea2-4b05-b5b6-5679490f67a8"+ },+ "type": "customer.created"+ },{"api_version": "2020-08-27","created": 1000000000,@@ -8,21 +56,21 @@"application": null,"automatic_payment_methods": null,"cancellation_reason": null,- "client_secret": "seti_1P41kdDEQaroqDjskJlek9HI_secret_PtpPQkQjgOYNuLz5c0qw0D4wmMWGh9U",+ "client_secret": "seti_1P67KuDEQaroqDjsZUdmQrJj_secret_PvzJAxNQagRbkbXR6YpjUtXheCymdHm","created": 1000000000,- "customer": "cus_NORMALIZED0008",+ "customer": "cus_NORMALIZED0004","description": null,"flow_directions": null,- "id": "seti_1P41kdDEQaroqDjskJlek9HI",+ "id": "seti_1P67KuDEQaroqDjsZUdmQrJj","last_setup_error": null,- "latest_attempt": "setatt_1P41kdDEQaroqDjs8fT02ECC",+ "latest_attempt": null,"livemode": false,"mandate": null,"metadata": {},"next_action": null,"object": "setup_intent","on_behalf_of": null,- "payment_method": "pm_1P41kcDEQaroqDjsFn90ABKY",+ "payment_method": null,"payment_method_configuration_details": null,"payment_method_options": {"card": {@@ -35,82 +83,20 @@"card"],"single_use_mandate": null,- "status": "succeeded",+ "status": "requires_payment_method","usage": "off_session"}},- "id": "evt_1P41kdDEQaroqDjsjgD7mx3M",+ "id": "evt_1P67KuDEQaroqDjsAVJMCXrR","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0023",- "idempotency_key": "b9c74e12-26a2-4c50-b5d4-f1fbe8e57a0c"+ "id": "req_NORMALIZED0028",+ "idempotency_key": "378a98ee-e071-406c-879c-15afec5b1f8c"},"type": "setup_intent.created"},- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "amount": 10000,- "currency": "usd",- "customer": "cus_NORMALIZED0003",- "date": 1000000000,- "description": "Zulip Basic - renewal",- "discountable": false,- "discounts": [],- "id": "ii_NORMALIZED00000000000009",- "invoice": null,- "livemode": false,- "metadata": {},- "object": "invoiceitem",- "period": {- "end": 1341198245,- "start": 1338606245- },- "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": 10000,- "unit_amount_decimal": "10000"- },- "proration": false,- "quantity": 1,- "subscription": null,- "tax_rates": [],- "test_clock": null,- "unit_amount": 10000,- "unit_amount_decimal": "10000"- }- },- "id": "evt_1P41kdDEQaroqDjsDFb1GDTo",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0024",- "idempotency_key": "b6c7aa55-6f64-4ad1-81ae-cc39057731fb"- },- "type": "invoiceitem.created"- },{"api_version": "2020-08-27","created": 1000000000,@@ -135,13 +121,13 @@},"billing_reason": "manual","charge": null,- "collection_method": "send_invoice",+ "collection_method": "charge_automatically","created": 1000000000,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0006",+ "customer": "cus_NORMALIZED0002","customer_address": null,- "customer_email": "[email protected]",+ "customer_email": "[email protected]","customer_name": null,"customer_phone": null,"customer_shipping": null,@@ -153,14 +139,14 @@"description": null,"discount": null,"discounts": [],- "due_date": 1000000000,+ "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQbUxoMWFNVzB4aGZsRG5uVTUyRHVyTmFhZHBtLDEwMzI5ODYyNw02003X6ybKuO?s=ap",- "id": "in_NORMALIZED00000000000007",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQbUxoMWFNVzB4aGZsRG5uVTUyRHVyTmFhZHBtLDEwMzI5ODYyNw02003X6ybKuO/pdf?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKdVZGN1l3SDF4blhaOWFMcjJjRUU2YWFKRG9FLDEwMzc5Njc1Mg0200RYVUX3QG?s=ap",+ "id": "in_NORMALIZED00000000000009",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKdVZGN1l3SDF4blhaOWFMcjJjRUU2YWFKRG9FLDEwMzc5Njc1Mg0200RYVUX3QG/pdf?s=ap","issuer": {"type": "self"},@@ -172,19 +158,19 @@"amount": 10000,"amount_excluding_tax": 10000,"currency": "usd",- "description": "Zulip Cloud Standard",+ "description": "Zulip Basic - renewal","discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000008",- "invoice": "in_NORMALIZED00000000000007",- "invoice_item": "ii_NORMALIZED00000000000008",+ "id": "il_NORMALIZED00000000000010",+ "invoice": "in_NORMALIZED00000000000009",+ "invoice_item": "ii_NORMALIZED00000000000010","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1341198245,+ "start": 1338606245},"plan": null,"price": {@@ -193,7 +179,7 @@"created": 1000000000,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000003",+ "id": "price_NORMALIZED00000000000001","livemode": false,"lookup_key": null,"metadata": {},@@ -223,17 +209,17 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000007/lines"+ "url": "/v1/invoices/in_NORMALIZED00000000000009/lines"},"livemode": false,"metadata": {},- "next_payment_attempt": null,+ "next_payment_attempt": 1000000000,"number": "NORMALI-0007","object": "invoice","on_behalf_of": null,"paid": false,"paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000006",+ "payment_intent": "pi_NORMALIZED00000000000007","payment_settings": {"default_mandate": null,"payment_method_options": null,@@ -255,7 +241,7 @@"shipping_cost": null,"shipping_details": null,"starting_balance": 0,- "statement_descriptor": "Zulip Cloud Standard",+ "statement_descriptor": "Zulip Basic","status": "open","status_transitions": {"finalized_at": 1000000000,@@ -279,13 +265,13 @@"webhooks_delivered_at": null}},- "id": "evt_1P41kdDEQaroqDjs8GZCTppg",+ "id": "evt_1P67KuDEQaroqDjswUFRjt9N","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0025",- "idempotency_key": "1fd3f786-e46d-4d6d-89ba-05cc9fd089e4"+ "id": "req_NORMALIZED0029",+ "idempotency_key": "e4fb79e5-cd99-4886-8ed9-e3f1ecda0e18"},"type": "invoice.finalized"},@@ -313,13 +299,13 @@},"billing_reason": "manual","charge": null,- "collection_method": "send_invoice",+ "collection_method": "charge_automatically","created": 1000000000,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0006",+ "customer": "cus_NORMALIZED0002","customer_address": null,- "customer_email": "[email protected]",+ "customer_email": "[email protected]","customer_name": null,"customer_phone": null,"customer_shipping": null,@@ -331,14 +317,14 @@"description": null,"discount": null,"discounts": [],- "due_date": 1000000000,+ "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQbUxoMWFNVzB4aGZsRG5uVTUyRHVyTmFhZHBtLDEwMzI5ODYyNg0200GlLGHUoM?s=ap",- "id": "in_NORMALIZED00000000000007",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQbUxoMWFNVzB4aGZsRG5uVTUyRHVyTmFhZHBtLDEwMzI5ODYyNg0200GlLGHUoM/pdf?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKdVZGN1l3SDF4blhaOWFMcjJjRUU2YWFKRG9FLDEwMzc5Njc1Mg0200RYVUX3QG?s=ap",+ "id": "in_NORMALIZED00000000000009",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKdVZGN1l3SDF4blhaOWFMcjJjRUU2YWFKRG9FLDEwMzc5Njc1Mg0200RYVUX3QG/pdf?s=ap","issuer": {"type": "self"},@@ -350,19 +336,19 @@"amount": 10000,"amount_excluding_tax": 10000,"currency": "usd",- "description": "Zulip Cloud Standard",+ "description": "Zulip Basic - renewal","discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000008",- "invoice": "in_NORMALIZED00000000000007",- "invoice_item": "ii_NORMALIZED00000000000008",+ "id": "il_NORMALIZED00000000000010",+ "invoice": "in_NORMALIZED00000000000009",+ "invoice_item": "ii_NORMALIZED00000000000010","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1341198245,+ "start": 1338606245},"plan": null,"price": {@@ -371,7 +357,7 @@"created": 1000000000,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000003",+ "id": "price_NORMALIZED00000000000001","livemode": false,"lookup_key": null,"metadata": {},@@ -401,17 +387,17 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000007/lines"+ "url": "/v1/invoices/in_NORMALIZED00000000000009/lines"},"livemode": false,"metadata": {},- "next_payment_attempt": null,+ "next_payment_attempt": 1000000000,"number": "NORMALI-0007","object": "invoice","on_behalf_of": null,"paid": false,"paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000006",+ "payment_intent": "pi_NORMALIZED00000000000007","payment_settings": {"default_mandate": null,"payment_method_options": null,@@ -433,7 +419,7 @@"shipping_cost": null,"shipping_details": null,"starting_balance": 0,- "statement_descriptor": "Zulip Cloud Standard",+ "statement_descriptor": "Zulip Basic","status": "open","status_transitions": {"finalized_at": 1000000000,@@ -474,13 +460,13 @@}}},- "id": "evt_1P41kdDEQaroqDjsRzU9ekdb",+ "id": "evt_1P67KuDEQaroqDjsALmWbdUX","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0025",- "idempotency_key": "1fd3f786-e46d-4d6d-89ba-05cc9fd089e4"+ "id": "req_NORMALIZED0029",+ "idempotency_key": "e4fb79e5-cd99-4886-8ed9-e3f1ecda0e18"},"type": "invoice.updated"},@@ -489,456 +475,110 @@"created": 1000000000,"data": {"object": {- "amount": 10000,- "amount_capturable": 0,- "amount_details": {- "tip": {}- },- "amount_received": 0,- "application": null,- "application_fee_amount": null,- "automatic_payment_methods": null,- "canceled_at": null,- "cancellation_reason": null,- "capture_method": "automatic",- "charges": {- "data": [],- "has_more": false,- "object": "list",- "total_count": 0,- "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000006"- },- "client_secret": "pi_NORMALIZED00000000000006_secret_3XsiYwP4sf2cD3SIOBYuvulBA",- "confirmation_method": "automatic",+ "ach_credit_transfer": {+ "account_number": "test_NORMALIZED02",+ "bank_name": "TEST BANK",+ "fingerprint": "NORMALIZED000002",+ "refund_account_holder_name": null,+ "refund_account_holder_type": null,+ "refund_routing_number": null,+ "routing_number": "110000000",+ "swift_code": "TSTEZ122"+ },+ "amount": null,+ "client_secret": "src_client_secret_NORMALIZED00000000000001","created": 1000000000,"currency": "usd","customer": "cus_NORMALIZED0006",- "description": "Payment for Invoice",- "id": "pi_NORMALIZED00000000000006",- "invoice": "in_NORMALIZED00000000000007",- "last_payment_error": null,- "latest_charge": null,+ "flow": "receiver",+ "id": "src_NORMALIZED00000000000001","livemode": false,"metadata": {},- "next_action": null,- "object": "payment_intent",- "on_behalf_of": null,- "payment_method": null,- "payment_method_configuration_details": null,- "payment_method_options": {- "card": {- "installments": null,- "mandate_options": null,- "network": null,- "request_three_d_secure": "automatic"- },- "cashapp": {},- "wechat_pay": {- "app_id": null,- "client": null- }- },- "payment_method_types": [- "ach_credit_transfer",- "card",- "cashapp",- "wechat_pay"- ],- "processing": null,- "receipt_email": "[email protected]",- "review": null,- "setup_future_usage": null,- "shipping": null,- "source": null,- "statement_descriptor": "Zulip Cloud Standard",- "statement_descriptor_suffix": null,- "status": "requires_payment_method",- "transfer_data": null,- "transfer_group": null+ "object": "source",+ "owner": {+ "address": null,+ "email": "[email protected]",+ "name": null,+ "phone": null,+ "verified_address": null,+ "verified_email": null,+ "verified_name": null,+ "verified_phone": null+ },+ "receiver": {+ "address": "000000000-test_NORMALIZED01",+ "amount_charged": 0,+ "amount_received": 0,+ "amount_returned": 0,+ "refund_attributes_method": "email",+ "refund_attributes_status": "missing"+ },+ "statement_descriptor": null,+ "status": "pending",+ "type": "ach_credit_transfer",+ "usage": "reusable"}},- "id": "evt_3P41kcDEQaroqDjs0lpCK4sw",+ "id": "evt_1P67KuDEQaroqDjsZKnp5wuH","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0025",- "idempotency_key": "1fd3f786-e46d-4d6d-89ba-05cc9fd089e4"+ "id": null,+ "idempotency_key": "74e4dfbb-5536-466b-aaf7-6f4823e0943f"},- "type": "payment_intent.created"+ "type": "customer.source.created"},{"api_version": "2020-08-27","created": 1000000000,"data": {"object": {- "account_country": "US",- "account_name": "Kandra Labs, Inc.",- "account_tax_ids": null,- "amount_due": 10000,- "amount_paid": 0,- "amount_remaining": 10000,- "amount_shipping": 0,- "application": null,- "application_fee_amount": null,- "attempt_count": 0,- "attempted": false,- "auto_advance": true,- "automatic_tax": {- "enabled": false,- "liability": null,- "status": null- },- "billing_reason": "manual",- "charge": null,- "collection_method": "charge_automatically",+ "address": null,+ "balance": 0,"created": 1000000000,"currency": "usd",- "custom_fields": null,- "customer": "cus_NORMALIZED0003",- "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,+ "default_currency": "usd",+ "default_source": "src_NORMALIZED00000000000001",+ "delinquent": false,+ "description": "test-realm-3 (test-realm-3)","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_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQa1BHNVZvak9jNXNYVm9YYlh0SHlzMWJPQmtoLDEwMzI5ODYyNg0200jJmsaOpM?s=ap",- "id": "in_NORMALIZED00000000000006",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQa1BHNVZvak9jNXNYVm9YYlh0SHlzMWJPQmtoLDEwMzI5ODYyNg0200jJmsaOpM/pdf?s=ap",- "issuer": {- "type": "self"- },- "last_finalization_error": null,- "latest_revision": null,- "lines": {- "data": [- {- "amount": 10000,- "amount_excluding_tax": 10000,- "currency": "usd",- "description": "Zulip Basic - renewal",- "discount_amounts": [],- "discountable": false,- "discounts": [],- "id": "il_NORMALIZED00000000000007",- "invoice": "in_NORMALIZED00000000000006",- "invoice_item": "ii_NORMALIZED00000000000007",- "livemode": false,- "metadata": {},- "object": "line_item",- "period": {- "end": 1338606245,- "start": 1335927845- },- "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": 10000,- "unit_amount_decimal": "10000"- },- "proration": false,- "proration_details": {- "credited_items": null- },- "quantity": 1,- "subscription": null,- "tax_amounts": [],- "tax_rates": [],- "type": "invoiceitem",- "unit_amount_excluding_tax": "10000"- }- ],- "has_more": false,- "object": "list",- "total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000006/lines"+ "email": "[email protected]",+ "id": "cus_NORMALIZED0006",+ "invoice_prefix": "NORMA05",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": null,+ "footer": null,+ "rendering_options": null},"livemode": false,- "metadata": {},- "next_payment_attempt": 1000000000,- "number": "NORMALI-0008",- "object": "invoice",- "on_behalf_of": null,- "paid": false,- "paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000007",- "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 Basic",- "status": "open",- "status_transitions": {- "finalized_at": 1000000000,- "marked_uncollectible_at": null,- "paid_at": null,- "voided_at": null- },- "subscription": null,- "subscription_details": {- "metadata": null- },- "subtotal": 10000,- "subtotal_excluding_tax": 10000,- "tax": null,- "test_clock": null,- "total": 10000,- "total_discount_amounts": [],- "total_excluding_tax": 10000,- "total_tax_amounts": [],- "transfer_data": null,- "webhooks_delivered_at": 1000000000- }- },- "id": "evt_1P41kcDEQaroqDjsrgzmIJyp",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0026",- "idempotency_key": "226e371e-2b3d-4f5b-9e7c-56b46d81d0c4"- },- "type": "invoice.finalized"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "account_country": "US",- "account_name": "Kandra Labs, Inc.",- "account_tax_ids": null,- "amount_due": 10000,- "amount_paid": 0,- "amount_remaining": 10000,- "amount_shipping": 0,- "application": null,- "application_fee_amount": null,- "attempt_count": 0,- "attempted": false,- "auto_advance": true,- "automatic_tax": {- "enabled": false,- "liability": null,- "status": null- },- "billing_reason": "manual",- "charge": null,- "collection_method": "charge_automatically",- "created": 1000000000,- "currency": "usd",- "custom_fields": null,- "customer": "cus_NORMALIZED0003",- "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQa1BHNVZvak9jNXNYVm9YYlh0SHlzMWJPQmtoLDEwMzI5ODYyNg0200jJmsaOpM?s=ap",- "id": "in_NORMALIZED00000000000006",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQa1BHNVZvak9jNXNYVm9YYlh0SHlzMWJPQmtoLDEwMzI5ODYyNg0200jJmsaOpM/pdf?s=ap",- "issuer": {- "type": "self"- },- "last_finalization_error": null,- "latest_revision": null,- "lines": {- "data": [- {- "amount": 10000,- "amount_excluding_tax": 10000,- "currency": "usd",- "description": "Zulip Basic - renewal",- "discount_amounts": [],- "discountable": false,- "discounts": [],- "id": "il_NORMALIZED00000000000007",- "invoice": "in_NORMALIZED00000000000006",- "invoice_item": "ii_NORMALIZED00000000000007",- "livemode": false,- "metadata": {},- "object": "line_item",- "period": {- "end": 1338606245,- "start": 1335927845- },- "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": 10000,- "unit_amount_decimal": "10000"- },- "proration": false,- "proration_details": {- "credited_items": null- },- "quantity": 1,- "subscription": null,- "tax_amounts": [],- "tax_rates": [],- "type": "invoiceitem",- "unit_amount_excluding_tax": "10000"- }- ],- "has_more": false,- "object": "list",- "total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000006/lines"- },- "livemode": false,- "metadata": {},- "next_payment_attempt": 1000000000,- "number": "NORMALI-0008",- "object": "invoice",- "on_behalf_of": null,- "paid": false,- "paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000007",- "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 Basic",- "status": "open",- "status_transitions": {- "finalized_at": 1000000000,- "marked_uncollectible_at": null,- "paid_at": null,- "voided_at": null- },- "subscription": null,- "subscription_details": {- "metadata": null- },- "subtotal": 10000,- "subtotal_excluding_tax": 10000,- "tax": null,- "test_clock": null,- "total": 10000,- "total_discount_amounts": [],- "total_excluding_tax": 10000,- "total_tax_amounts": [],- "transfer_data": null,- "webhooks_delivered_at": 1000000000+ "metadata": {+ "realm_id": "3",+ "realm_str": "test-realm-3"+ },+ "name": null,+ "next_invoice_sequence": 2,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null},"previous_attributes": {- "effective_at": null,- "ending_balance": null,- "hosted_invoice_url": null,- "invoice_pdf": null,- "number": null,- "payment_intent": null,- "rendering": {- "pdf": {- "page_size": "auto"- }- },- "status": "draft",- "status_transitions": {- "finalized_at": null- }+ "default_source": null}},- "id": "evt_1P41kcDEQaroqDjsgP4SYXG0",+ "id": "evt_1P67KuDEQaroqDjswxnGB6si","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0026",- "idempotency_key": "226e371e-2b3d-4f5b-9e7c-56b46d81d0c4"+ "id": null,+ "idempotency_key": "74e4dfbb-5536-466b-aaf7-6f4823e0943f"},- "type": "invoice.updated"+ "type": "customer.updated"},{"api_version": "2020-08-27",@@ -964,14 +604,14 @@"total_count": 0,"url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000007"},- "client_secret": "pi_NORMALIZED00000000000007_secret_cQxPrGn5nhg0DNYicEQHJyqqI",+ "client_secret": "pi_NORMALIZED00000000000007_secret_jllN4ntXALbg9A1zagQt3FgOm","confirmation_method": "automatic","created": 1000000000,"currency": "usd",- "customer": "cus_NORMALIZED0003",+ "customer": "cus_NORMALIZED0002","description": "Payment for Invoice","id": "pi_NORMALIZED00000000000007",- "invoice": "in_NORMALIZED00000000000006",+ "invoice": "in_NORMALIZED00000000000009","last_payment_error": null,"latest_charge": null,"livemode": false,@@ -1007,13 +647,13 @@"transfer_group": null}},- "id": "evt_3P41kcDEQaroqDjs093VeSvm",+ "id": "evt_3P67KuDEQaroqDjs0LKJ9gCf","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0026",- "idempotency_key": "226e371e-2b3d-4f5b-9e7c-56b46d81d0c4"+ "id": "req_NORMALIZED0029",+ "idempotency_key": "e4fb79e5-cd99-4886-8ed9-e3f1ecda0e18"},"type": "payment_intent.created"},@@ -1022,49 +662,96 @@"created": 1000000000,"data": {"object": {- "application": null,- "automatic_payment_methods": null,- "cancellation_reason": null,- "client_secret": "seti_1P41kbDEQaroqDjsG1JcA2l5_secret_PtpPq4nAbQonFcipXkCH9If2RqptokS",+ "address": null,+ "balance": 0,"created": 1000000000,- "customer": "cus_NORMALIZED0008",- "description": null,- "flow_directions": null,- "id": "seti_1P41kbDEQaroqDjsG1JcA2l5",- "last_setup_error": null,- "latest_attempt": null,+ "currency": null,+ "default_currency": null,+ "default_source": null,+ "delinquent": false,+ "description": "test-realm-4 (test-realm-4)",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0009",+ "invoice_prefix": "NORMA08",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": null,+ "footer": null,+ "rendering_options": null+ },"livemode": false,- "mandate": null,- "metadata": {},- "next_action": null,- "object": "setup_intent",- "on_behalf_of": null,- "payment_method": null,- "payment_method_configuration_details": null,- "payment_method_options": {- "card": {- "mandate_options": null,- "network": null,- "request_three_d_secure": "automatic"- }+ "metadata": {+ "realm_id": "6",+ "realm_str": "test-realm-4"+ },+ "name": null,+ "next_invoice_sequence": 1,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+ }+ },+ "id": "evt_1P67KuDEQaroqDjsccvfTIZL",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0030",+ "idempotency_key": "46a8b738-ec4d-450f-8ae0-f962e995c197"+ },+ "type": "customer.created"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": null,+ "default_currency": null,+ "default_source": null,+ "delinquent": false,+ "description": "demo.example.com 6cde5f7a-1f7",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0004",+ "invoice_prefix": "NORMA03",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": null,+ "footer": null,+ "rendering_options": null},- "payment_method_types": [- "card"- ],- "single_use_mandate": null,- "status": "requires_payment_method",- "usage": "off_session"+ "livemode": false,+ "metadata": {+ "remote_server_str": "demo.example.com 6cde5f7a-1f7",+ "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"+ },+ "name": null,+ "next_invoice_sequence": 1,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null}},- "id": "evt_1P41kcDEQaroqDjshk75GRW1",+ "id": "evt_1P67KuDEQaroqDjsnk9f2rRM","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0027",- "idempotency_key": "1b3e8911-7ebc-44ec-a318-2135f1f66fbf"+ "id": "req_NORMALIZED0031",+ "idempotency_key": "75ead3a0-fedf-4c5a-9988-93b9a4876015"},- "type": "setup_intent.created"+ "type": "customer.created"},{"api_version": "2020-08-27",@@ -1090,13 +777,13 @@},"billing_reason": "manual","charge": null,- "collection_method": "send_invoice",+ "collection_method": "charge_automatically","created": 1000000000,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0006",+ "customer": "cus_NORMALIZED0002","customer_address": null,- "customer_email": "[email protected]",+ "customer_email": "[email protected]","customer_name": null,"customer_phone": null,"customer_shipping": null,@@ -1108,13 +795,13 @@"description": null,"discount": null,"discounts": [],- "due_date": 1000000000,+ "due_date": null,"effective_at": null,"ending_balance": null,"footer": null,"from_invoice": null,"hosted_invoice_url": null,- "id": "in_NORMALIZED00000000000007",+ "id": "in_NORMALIZED00000000000009","invoice_pdf": null,"issuer": {"type": "self"@@ -1127,19 +814,19 @@"amount": 10000,"amount_excluding_tax": 10000,"currency": "usd",- "description": "Zulip Cloud Standard",+ "description": "Zulip Basic - renewal","discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000008",- "invoice": "in_NORMALIZED00000000000007",- "invoice_item": "ii_NORMALIZED00000000000008",+ "id": "il_NORMALIZED00000000000010",+ "invoice": "in_NORMALIZED00000000000009",+ "invoice_item": "ii_NORMALIZED00000000000010","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1341198245,+ "start": 1338606245},"plan": null,"price": {@@ -1148,7 +835,7 @@"created": 1000000000,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000003",+ "id": "price_NORMALIZED00000000000001","livemode": false,"lookup_key": null,"metadata": {},@@ -1178,11 +865,11 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000007/lines"+ "url": "/v1/invoices/in_NORMALIZED00000000000009/lines"},"livemode": false,"metadata": {},- "next_payment_attempt": null,+ "next_payment_attempt": 1000000000,"number": null,"object": "invoice","on_behalf_of": null,@@ -1210,7 +897,7 @@"shipping_cost": null,"shipping_details": null,"starting_balance": 0,- "statement_descriptor": "Zulip Cloud Standard",+ "statement_descriptor": "Zulip Basic","status": "draft","status_transitions": {"finalized_at": null,@@ -1234,13 +921,13 @@"webhooks_delivered_at": null}},- "id": "evt_1P41kcDEQaroqDjsvNi4YxR7",+ "id": "evt_1P67KtDEQaroqDjsxMOQsC30","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0028",- "idempotency_key": "0a3d9bbf-2276-4d1c-b646-83b1498002c0"+ "id": "req_NORMALIZED0032",+ "idempotency_key": "f6663367-6016-4170-bce4-cf51ef566d33"},"type": "invoice.created"}diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.7.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.7.jsonindex f10e8c99201..5173f0e4f55 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.7.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.7.json@@ -24,13 +24,13 @@},"billing_reason": "manual","charge": null,- "collection_method": "send_invoice",+ "collection_method": "charge_automatically","created": 1000000000,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0009",+ "customer": "cus_NORMALIZED0002","customer_address": null,- "customer_email": "[email protected]",+ "customer_email": "[email protected]","customer_name": null,"customer_phone": null,"customer_shipping": null,@@ -42,13 +42,13 @@"description": null,"discount": null,"discounts": [],- "due_date": 1000000000,+ "due_date": null,"effective_at": null,"ending_balance": null,"footer": null,"from_invoice": null,"hosted_invoice_url": null,- "id": "in_NORMALIZED00000000000008",+ "id": "in_NORMALIZED00000000000010","invoice_pdf": null,"issuer": {"type": "self"@@ -61,19 +61,19 @@"amount": 10000,"amount_excluding_tax": 10000,"currency": "usd",- "description": "Zulip Cloud Standard",+ "description": "Zulip Basic - renewal","discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000009",- "invoice": "in_NORMALIZED00000000000008",- "invoice_item": "ii_NORMALIZED00000000000010",+ "id": "il_NORMALIZED00000000000011",+ "invoice": "in_NORMALIZED00000000000010",+ "invoice_item": "ii_NORMALIZED00000000000011","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1343876645,+ "start": 1341198245},"plan": null,"price": {@@ -82,7 +82,7 @@"created": 1000000000,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000003",+ "id": "price_NORMALIZED00000000000001","livemode": false,"lookup_key": null,"metadata": {},@@ -112,11 +112,11 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000008/lines"+ "url": "/v1/invoices/in_NORMALIZED00000000000010/lines"},"livemode": false,"metadata": {},- "next_payment_attempt": null,+ "next_payment_attempt": 1000000000,"number": null,"object": "invoice","on_behalf_of": null,@@ -144,7 +144,7 @@"shipping_cost": null,"shipping_details": null,"starting_balance": 0,- "statement_descriptor": "Zulip Cloud Standard",+ "statement_descriptor": "Zulip Basic","status": "draft","status_transitions": {"finalized_at": null,@@ -168,429 +168,16 @@"webhooks_delivered_at": null}},- "id": "evt_1P41keDEQaroqDjsAlDOCXYi",+ "id": "evt_1P67KvDEQaroqDjsCHAnaF4F","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0029",- "idempotency_key": "03051f71-7c72-4744-86f3-d4cbf1937b63"+ "id": "req_NORMALIZED0033",+ "idempotency_key": "c5fe7964-e14f-481c-84d6-60f44c5d30e2"},"type": "invoice.created"},- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "amount": 10000,- "amount_capturable": 0,- "amount_details": {- "tip": {}- },- "amount_received": 0,- "application": null,- "application_fee_amount": null,- "automatic_payment_methods": null,- "canceled_at": null,- "cancellation_reason": null,- "capture_method": "automatic",- "charges": {- "data": [],- "has_more": false,- "object": "list",- "total_count": 0,- "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000008"- },- "client_secret": "pi_NORMALIZED00000000000008_secret_iFupi6ey1wsxKSpKxOjtD9ZjX",- "confirmation_method": "automatic",- "created": 1000000000,- "currency": "usd",- "customer": "cus_NORMALIZED0003",- "description": "Payment for Invoice",- "id": "pi_NORMALIZED00000000000008",- "invoice": "in_NORMALIZED00000000000009",- "last_payment_error": null,- "latest_charge": null,- "livemode": false,- "metadata": {},- "next_action": null,- "object": "payment_intent",- "on_behalf_of": null,- "payment_method": null,- "payment_method_configuration_details": null,- "payment_method_options": {- "card": {- "installments": null,- "mandate_options": null,- "network": null,- "request_three_d_secure": "automatic"- },- "cashapp": {}- },- "payment_method_types": [- "card",- "cashapp"- ],- "processing": null,- "receipt_email": "[email protected]",- "review": null,- "setup_future_usage": null,- "shipping": null,- "source": null,- "statement_descriptor": "Zulip Basic",- "statement_descriptor_suffix": null,- "status": "requires_payment_method",- "transfer_data": null,- "transfer_group": null- }- },- "id": "evt_3P41kdDEQaroqDjs0E1SN1AS",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0030",- "idempotency_key": "4c569b60-62c1-4f37-8eee-66b623af3682"- },- "type": "payment_intent.created"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "amount": 10000,- "currency": "usd",- "customer": "cus_NORMALIZED0009",- "date": 1000000000,- "description": "Zulip Cloud Standard",- "discountable": false,- "discounts": [],- "id": "ii_NORMALIZED00000000000010",- "invoice": null,- "livemode": false,- "metadata": {},- "object": "invoiceitem",- "period": {- "end": 1000000000,- "start": 1000000000- },- "plan": null,- "price": {- "active": false,- "billing_scheme": "per_unit",- "created": 1000000000,- "currency": "usd",- "custom_unit_amount": null,- "id": "price_NORMALIZED00000000000003",- "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": 10000,- "unit_amount_decimal": "10000"- },- "proration": false,- "quantity": 1,- "subscription": null,- "tax_rates": [],- "test_clock": null,- "unit_amount": 10000,- "unit_amount_decimal": "10000"- }- },- "id": "evt_1P41kdDEQaroqDjsewk4EAUf",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0031",- "idempotency_key": "ca9e3ec4-a820-455d-99a3-c217ca54042f"- },- "type": "invoiceitem.created"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "address": null,- "balance": 0,- "created": 1000000000,- "currency": "usd",- "default_currency": "usd",- "default_source": null,- "delinquent": false,- "description": "test-realm-6 (test-realm-6)",- "discount": null,- "email": "[email protected]",- "id": "cus_NORMALIZED0009",- "invoice_prefix": "NORMA07",- "invoice_settings": {- "custom_fields": null,- "default_payment_method": null,- "footer": null,- "rendering_options": null- },- "livemode": false,- "metadata": {- "realm_id": "6",- "realm_str": "test-realm-6"- },- "name": null,- "next_invoice_sequence": 1,- "object": "customer",- "phone": null,- "preferred_locales": [],- "shipping": null,- "tax_exempt": "none",- "test_clock": null- },- "previous_attributes": {- "currency": null,- "default_currency": null- }- },- "id": "evt_1P41kdDEQaroqDjssds4rYOt",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0031",- "idempotency_key": "ca9e3ec4-a820-455d-99a3-c217ca54042f"- },- "type": "customer.updated"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "application": null,- "automatic_payment_methods": null,- "cancellation_reason": null,- "client_secret": "seti_1P41kdDEQaroqDjskJlek9HI_secret_PtpPQkQjgOYNuLz5c0qw0D4wmMWGh9U",- "created": 1000000000,- "customer": "cus_NORMALIZED0008",- "description": null,- "flow_directions": null,- "id": "seti_1P41kdDEQaroqDjskJlek9HI",- "last_setup_error": null,- "latest_attempt": "setatt_1P41kdDEQaroqDjs8fT02ECC",- "livemode": false,- "mandate": null,- "metadata": {},- "next_action": null,- "object": "setup_intent",- "on_behalf_of": null,- "payment_method": "pm_1P41kcDEQaroqDjsFn90ABKY",- "payment_method_configuration_details": null,- "payment_method_options": {- "card": {- "mandate_options": null,- "network": null,- "request_three_d_secure": "automatic"- }- },- "payment_method_types": [- "card"- ],- "single_use_mandate": null,- "status": "succeeded",- "usage": "off_session"- }- },- "id": "evt_1P41keDEQaroqDjsK7xkR62y",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0023",- "idempotency_key": "b9c74e12-26a2-4c50-b5d4-f1fbe8e57a0c"- },- "type": "setup_intent.succeeded"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "billing_details": {- "address": {- "city": "San Francisco",- "country": "US",- "line1": "123 Main St",- "line2": null,- "postal_code": "94105",- "state": "CA"- },- "email": null,- "name": "John Doe",- "phone": null- },- "card": {- "brand": "visa",- "checks": {- "address_line1_check": null,- "address_postal_code_check": null,- "cvc_check": "pass"- },- "country": "US",- "display_brand": "visa",- "exp_month": 4,- "exp_year": 2025,- "fingerprint": "NORMALIZED000001",- "funding": "credit",- "generated_from": null,- "last4": "4242",- "networks": {- "available": [- "visa"- ],- "preferred": null- },- "three_d_secure_usage": {- "supported": true- },- "wallet": null- },- "created": 1000000000,- "customer": "cus_NORMALIZED0008",- "id": "pm_1P41kcDEQaroqDjsFn90ABKY",- "livemode": false,- "metadata": {},- "object": "payment_method",- "type": "card"- }- },- "id": "evt_1P41kdDEQaroqDjs1p4NAed5",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0023",- "idempotency_key": "b9c74e12-26a2-4c50-b5d4-f1fbe8e57a0c"- },- "type": "payment_method.attached"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "ach_credit_transfer": {- "account_number": "test_NORMALIZED03",- "bank_name": "TEST BANK",- "fingerprint": "NORMALIZED000003",- "refund_account_holder_name": null,- "refund_account_holder_type": null,- "refund_routing_number": null,- "routing_number": "110000000",- "swift_code": "TSTEZ122"- },- "amount": null,- "client_secret": "src_client_secret_NORMALIZED00000000000002",- "created": 1000000000,- "currency": "usd",- "customer": "cus_NORMALIZED0006",- "flow": "receiver",- "id": "src_NORMALIZED00000000000002",- "livemode": false,- "metadata": {},- "object": "source",- "owner": {- "address": null,- "email": "[email protected]",- "name": null,- "phone": null,- "verified_address": null,- "verified_email": null,- "verified_name": null,- "verified_phone": null- },- "receiver": {- "address": "000000000-test_NORMALIZED02",- "amount_charged": 0,- "amount_received": 0,- "amount_returned": 0,- "refund_attributes_method": "email",- "refund_attributes_status": "missing"- },- "statement_descriptor": null,- "status": "pending",- "type": "ach_credit_transfer",- "usage": "reusable"- }- },- "id": "evt_1P41kdDEQaroqDjsCQFq7sOA",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": null,- "idempotency_key": "5e807264-ece2-4e2b-9e15-d605490bcf1e"- },- "type": "customer.source.created"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "address": null,- "balance": 0,- "created": 1000000000,- "currency": "usd",- "default_currency": "usd",- "default_source": "src_NORMALIZED00000000000002",- "delinquent": false,- "description": "test-realm-5 (test-realm-5)",- "discount": null,- "email": "[email protected]",- "id": "cus_NORMALIZED0006",- "invoice_prefix": "NORMA04",- "invoice_settings": {- "custom_fields": null,- "default_payment_method": null,- "footer": null,- "rendering_options": null- },- "livemode": false,- "metadata": {- "realm_id": "4",- "realm_str": "test-realm-5"- },- "name": null,- "next_invoice_sequence": 2,- "object": "customer",- "phone": null,- "preferred_locales": [],- "shipping": null,- "tax_exempt": "none",- "test_clock": null- },- "previous_attributes": {- "default_source": null- }- },- "id": "evt_1P41kdDEQaroqDjsR5nMGGGX",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": null,- "idempotency_key": "5e807264-ece2-4e2b-9e15-d605490bcf1e"- },- "type": "customer.updated"- },{"api_version": "2020-08-27","created": 1000000000,@@ -615,13 +202,13 @@},"billing_reason": "manual","charge": null,- "collection_method": "charge_automatically",+ "collection_method": "send_invoice","created": 1000000000,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0003",+ "customer": "cus_NORMALIZED0008","customer_address": null,- "customer_email": "[email protected]",+ "customer_email": "[email protected]","customer_name": null,"customer_phone": null,"customer_shipping": null,@@ -633,13 +220,13 @@"description": null,"discount": null,"discounts": [],- "due_date": null,+ "due_date": 1000000000,"effective_at": null,"ending_balance": null,"footer": null,"from_invoice": null,"hosted_invoice_url": null,- "id": "in_NORMALIZED00000000000009",+ "id": "in_NORMALIZED00000000000011","invoice_pdf": null,"issuer": {"type": "self"@@ -652,19 +239,19 @@"amount": 10000,"amount_excluding_tax": 10000,"currency": "usd",- "description": "Zulip Basic - renewal",+ "description": "Zulip Cloud Standard","discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000010",- "invoice": "in_NORMALIZED00000000000009",- "invoice_item": "ii_NORMALIZED00000000000009",+ "id": "il_NORMALIZED00000000000012",+ "invoice": "in_NORMALIZED00000000000011",+ "invoice_item": "ii_NORMALIZED00000000000012","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1341198245,- "start": 1338606245+ "end": 1000000000,+ "start": 1000000000},"plan": null,"price": {@@ -703,11 +290,11 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000009/lines"+ "url": "/v1/invoices/in_NORMALIZED00000000000011/lines"},"livemode": false,"metadata": {},- "next_payment_attempt": 1000000000,+ "next_payment_attempt": null,"number": null,"object": "invoice","on_behalf_of": null,@@ -735,7 +322,7 @@"shipping_cost": null,"shipping_details": null,"starting_balance": 0,- "statement_descriptor": "Zulip Basic",+ "statement_descriptor": "Zulip Cloud Standard","status": "draft","status_transitions": {"finalized_at": null,@@ -759,16 +346,140 @@"webhooks_delivered_at": null}},- "id": "evt_1P41kdDEQaroqDjsZVchfd6x",+ "id": "evt_1P67KvDEQaroqDjsATa252vC","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0032",- "idempotency_key": "c4e452b7-44b9-4a8e-a830-a4d336ab18b0"+ "id": "req_NORMALIZED0034",+ "idempotency_key": "fa4be760-60c6-4924-a016-fc7e59f7fefb"},"type": "invoice.created"},+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "amount": 10000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0002",+ "date": 1000000000,+ "description": "Zulip Basic - renewal",+ "discountable": false,+ "discounts": [],+ "id": "ii_NORMALIZED00000000000011",+ "invoice": null,+ "livemode": false,+ "metadata": {},+ "object": "invoiceitem",+ "period": {+ "end": 1343876645,+ "start": 1341198245+ },+ "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": 10000,+ "unit_amount_decimal": "10000"+ },+ "proration": false,+ "quantity": 1,+ "subscription": null,+ "tax_rates": [],+ "test_clock": null,+ "unit_amount": 10000,+ "unit_amount_decimal": "10000"+ }+ },+ "id": "evt_1P67KvDEQaroqDjsYRA2U6v6",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0035",+ "idempotency_key": "ce4ece13-b3f0-481d-9654-feef034bd47c"+ },+ "type": "invoiceitem.created"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "amount": 10000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0008",+ "date": 1000000000,+ "description": "Zulip Cloud Standard",+ "discountable": false,+ "discounts": [],+ "id": "ii_NORMALIZED00000000000012",+ "invoice": null,+ "livemode": false,+ "metadata": {},+ "object": "invoiceitem",+ "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": 10000,+ "unit_amount_decimal": "10000"+ },+ "proration": false,+ "quantity": 1,+ "subscription": null,+ "tax_rates": [],+ "test_clock": null,+ "unit_amount": 10000,+ "unit_amount_decimal": "10000"+ }+ },+ "id": "evt_1P67KvDEQaroqDjstpfu9Bya",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0036",+ "idempotency_key": "500311a4-b140-40e7-b6df-f4a84c0dae9a"+ },+ "type": "invoiceitem.created"+ },{"api_version": "2020-08-27","created": 1000000000,@@ -777,14 +488,14 @@"address": null,"balance": 0,"created": 1000000000,- "currency": null,- "default_currency": null,+ "currency": "usd",+ "default_currency": "usd","default_source": null,"delinquent": false,- "description": "test-realm-6 (test-realm-6)",+ "description": "test-realm-5 (test-realm-5)","discount": null,- "email": "[email protected]",- "id": "cus_NORMALIZED0009",+ "email": "[email protected]",+ "id": "cus_NORMALIZED0008","invoice_prefix": "NORMA07","invoice_settings": {"custom_fields": null,@@ -794,8 +505,8 @@},"livemode": false,"metadata": {- "realm_id": "6",- "realm_str": "test-realm-6"+ "realm_id": "5",+ "realm_str": "test-realm-5"},"name": null,"next_invoice_sequence": 1,@@ -805,20 +516,24 @@"shipping": null,"tax_exempt": "none","test_clock": null+ },+ "previous_attributes": {+ "currency": null,+ "default_currency": null}},- "id": "evt_1P41kdDEQaroqDjskqmHHhf7",+ "id": "evt_1P67KvDEQaroqDjsVGBqL8kw","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0033",- "idempotency_key": "9422b47c-50e2-42c9-9be4-66432eee5aaa"+ "id": "req_NORMALIZED0036",+ "idempotency_key": "500311a4-b140-40e7-b6df-f4a84c0dae9a"},- "type": "customer.created"+ "type": "customer.updated"}],- "has_more": true,+ "has_more": false,"object": "list","url": "/v1/events"}diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.8.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.8.jsonindex c4690cda9cb..0697bfdb160 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.8.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.8.json@@ -5,198 +5,307 @@"created": 1000000000,"data": {"object": {- "address": null,- "balance": 0,+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 10000,+ "amount_paid": 0,+ "amount_remaining": 10000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": true,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "charge_automatically","created": 1000000000,- "currency": null,- "default_currency": null,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0002",+ "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,- "delinquent": false,- "description": "demo.example.com 6cde5f7a-1f7",+ "default_tax_rates": [],+ "description": null,"discount": null,- "email": "[email protected]",- "id": "cus_NORMALIZED0008",- "invoice_prefix": "NORMA06",- "invoice_settings": {- "custom_fields": null,- "default_payment_method": "pm_1P41kcDEQaroqDjsFn90ABKY",- "footer": null,- "rendering_options": 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_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKNEhMZ05iTXVmSFpXT003R3BsWElpTFpBTmRYLDEwMzc5Njc1NA0200n453bZum?s=ap",+ "id": "in_NORMALIZED00000000000010",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKNEhMZ05iTXVmSFpXT003R3BsWElpTFpBTmRYLDEwMzc5Njc1NA0200n453bZum/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 10000,+ "amount_excluding_tax": 10000,+ "currency": "usd",+ "description": "Zulip Basic - renewal",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000011",+ "invoice": "in_NORMALIZED00000000000010",+ "invoice_item": "ii_NORMALIZED00000000000011",+ "livemode": false,+ "metadata": {},+ "object": "line_item",+ "period": {+ "end": 1343876645,+ "start": 1341198245+ },+ "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": 10000,+ "unit_amount_decimal": "10000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 1,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "10000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000010/lines"},"livemode": false,- "metadata": {- "remote_server_str": "demo.example.com 6cde5f7a-1f7",- "remote_server_uuid": "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"- },- "name": null,- "next_invoice_sequence": 1,- "object": "customer",- "phone": null,- "preferred_locales": [],- "shipping": null,- "tax_exempt": "none",- "test_clock": null+ "metadata": {},+ "next_payment_attempt": 1000000000,+ "number": "NORMALI-0008",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "paid_out_of_band": false,+ "payment_intent": "pi_NORMALIZED00000000000008",+ "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 Basic",+ "status": "open",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 10000,+ "subtotal_excluding_tax": 10000,+ "tax": null,+ "test_clock": null,+ "total": 10000,+ "total_discount_amounts": [],+ "total_excluding_tax": 10000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": null},"previous_attributes": {- "invoice_settings": {- "default_payment_method": null+ "effective_at": null,+ "ending_balance": null,+ "hosted_invoice_url": null,+ "invoice_pdf": null,+ "number": null,+ "payment_intent": null,+ "rendering": {+ "pdf": {+ "page_size": "auto"+ }+ },+ "status": "draft",+ "status_transitions": {+ "finalized_at": null}}},- "id": "evt_1P41keDEQaroqDjs9HqCaPjC",+ "id": "evt_1P67KwDEQaroqDjs8c6NAhix","livemode": false,"object": "event",- "pending_webhooks": 0,+ "pending_webhooks": 2,"request": {- "id": "req_NORMALIZED0034",- "idempotency_key": "05ed2baa-141d-4fec-9533-65933c87548f"+ "id": "req_NORMALIZED0037",+ "idempotency_key": "895605f5-9e4c-4352-abf1-fc80df33f3b3"},- "type": "customer.updated"+ "type": "invoice.updated"},{"api_version": "2020-08-27","created": 1000000000,"data": {"object": {- "amount": 10000,- "amount_capturable": 0,- "amount_details": {- "tip": {}- },- "amount_received": 0,"application": null,- "application_fee_amount": null,"automatic_payment_methods": null,- "canceled_at": null,"cancellation_reason": null,- "capture_method": "automatic",- "charges": {- "data": [],- "has_more": false,- "object": "list",- "total_count": 0,- "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000009"- },- "client_secret": "pi_NORMALIZED00000000000009_secret_0Vy0zO0u6bnSWJ0kdFPisKPq9",- "confirmation_method": "automatic",+ "client_secret": "seti_1P67KvDEQaroqDjspZ6TIuVA_secret_PvzJBK0aRpWZdNHYeWPMf7pKh27AXul","created": 1000000000,- "currency": "usd",- "customer": "cus_NORMALIZED0009",- "description": "Payment for Invoice",- "id": "pi_NORMALIZED00000000000009",- "invoice": "in_NORMALIZED00000000000008",- "last_payment_error": null,- "latest_charge": null,+ "customer": "cus_NORMALIZED0004",+ "description": null,+ "flow_directions": null,+ "id": "seti_1P67KvDEQaroqDjspZ6TIuVA",+ "last_setup_error": null,+ "latest_attempt": "setatt_1P67KvDEQaroqDjsiWxJ1wyP","livemode": false,+ "mandate": null,"metadata": {},"next_action": null,- "object": "payment_intent",+ "object": "setup_intent","on_behalf_of": null,- "payment_method": null,+ "payment_method": "pm_1P67KvDEQaroqDjs8nXGcRQQ","payment_method_configuration_details": null,"payment_method_options": {"card": {- "installments": null,"mandate_options": null,"network": null,"request_three_d_secure": "automatic"- },- "cashapp": {},- "wechat_pay": {- "app_id": null,- "client": null}},"payment_method_types": [- "ach_credit_transfer",- "card",- "cashapp",- "wechat_pay"+ "card"],- "processing": null,- "receipt_email": "[email protected]",- "review": null,- "setup_future_usage": null,- "shipping": null,- "source": null,- "statement_descriptor": "Zulip Cloud Standard",- "statement_descriptor_suffix": null,- "status": "requires_payment_method",- "transfer_data": null,- "transfer_group": null+ "single_use_mandate": null,+ "status": "succeeded",+ "usage": "off_session"}},- "id": "evt_3P41keDEQaroqDjs1MrR3b9Y",+ "id": "evt_1P67KwDEQaroqDjsSzlVAABQ","livemode": false,"object": "event",- "pending_webhooks": 1,+ "pending_webhooks": 2,"request": {- "id": "req_NORMALIZED0035",- "idempotency_key": "d62b6596-5e90-4a25-b60c-b09079ec7b5e"+ "id": "req_NORMALIZED0038",+ "idempotency_key": "b6f7c091-334d-4881-aadf-604e60338771"},- "type": "payment_intent.created"+ "type": "setup_intent.succeeded"},{"api_version": "2020-08-27","created": 1000000000,"data": {"object": {- "amount": 10000,- "currency": "usd",- "customer": "cus_NORMALIZED0003",- "date": 1000000000,- "description": "Zulip Basic - renewal",- "discountable": false,- "discounts": [],- "id": "ii_NORMALIZED00000000000011",- "invoice": null,+ "billing_details": {+ "address": {+ "city": "San Francisco",+ "country": "US",+ "line1": "123 Main St",+ "line2": null,+ "postal_code": "94105",+ "state": "CA"+ },+ "email": null,+ "name": "John Doe",+ "phone": null+ },+ "card": {+ "brand": "visa",+ "checks": {+ "address_line1_check": null,+ "address_postal_code_check": null,+ "cvc_check": "pass"+ },+ "country": "US",+ "display_brand": "visa",+ "exp_month": 4,+ "exp_year": 2025,+ "fingerprint": "NORMALIZED000001",+ "funding": "credit",+ "generated_from": null,+ "last4": "4242",+ "networks": {+ "available": [+ "visa"+ ],+ "preferred": null+ },+ "three_d_secure_usage": {+ "supported": true+ },+ "wallet": null+ },+ "created": 1000000000,+ "customer": "cus_NORMALIZED0004",+ "id": "pm_1P67KvDEQaroqDjs8nXGcRQQ","livemode": false,"metadata": {},- "object": "invoiceitem",- "period": {- "end": 1343876645,- "start": 1341198245- },- "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": 10000,- "unit_amount_decimal": "10000"- },- "proration": false,- "quantity": 1,- "subscription": null,- "tax_rates": [],- "test_clock": null,- "unit_amount": 10000,- "unit_amount_decimal": "10000"+ "object": "payment_method",+ "type": "card"}},- "id": "evt_1P41keDEQaroqDjsG5xQ6ssi",+ "id": "evt_1P67KwDEQaroqDjsSPff6YIp","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0036",- "idempotency_key": "2c37e99a-de3b-4900-9b63-9301e118b391"+ "id": "req_NORMALIZED0038",+ "idempotency_key": "b6f7c091-334d-4881-aadf-604e60338771"},- "type": "invoiceitem.created"+ "type": "payment_method.attached"},{"api_version": "2020-08-27",@@ -222,13 +331,13 @@},"billing_reason": "manual","charge": null,- "collection_method": "charge_automatically",+ "collection_method": "send_invoice","created": 1000000000,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0003",+ "customer": "cus_NORMALIZED0008","customer_address": null,- "customer_email": "[email protected]",+ "customer_email": "[email protected]","customer_name": null,"customer_phone": null,"customer_shipping": null,@@ -240,14 +349,14 @@"description": null,"discount": null,"discounts": [],- "due_date": null,+ "due_date": 1000000000,"effective_at": 1000000000,"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQdVlGems4ZUk4UFJkZlVoOGdCMEQ3eXo0T29LLDEwMzI5ODYyOA0200nDHJJhOV?s=ap",- "id": "in_NORMALIZED00000000000009",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQdVlGems4ZUk4UFJkZlVoOGdCMEQ3eXo0T29LLDEwMzI5ODYyOA0200nDHJJhOV/pdf?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKUDRLTXlMaUJWTGFndmowcEE2cDFDODNxWXpwLDEwMzc5Njc1NA0200yZqonJ1Z?s=ap",+ "id": "in_NORMALIZED00000000000011",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKUDRLTXlMaUJWTGFndmowcEE2cDFDODNxWXpwLDEwMzc5Njc1NA0200yZqonJ1Z/pdf?s=ap","issuer": {"type": "self"},@@ -259,19 +368,19 @@"amount": 10000,"amount_excluding_tax": 10000,"currency": "usd",- "description": "Zulip Basic - renewal",+ "description": "Zulip Cloud Standard","discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000010",- "invoice": "in_NORMALIZED00000000000009",- "invoice_item": "ii_NORMALIZED00000000000009",+ "id": "il_NORMALIZED00000000000012",+ "invoice": "in_NORMALIZED00000000000011",+ "invoice_item": "ii_NORMALIZED00000000000012","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1341198245,- "start": 1338606245+ "end": 1000000000,+ "start": 1000000000},"plan": null,"price": {@@ -310,17 +419,17 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000009/lines"+ "url": "/v1/invoices/in_NORMALIZED00000000000011/lines"},"livemode": false,"metadata": {},- "next_payment_attempt": 1000000000,+ "next_payment_attempt": null,"number": "NORMALI-0009","object": "invoice","on_behalf_of": null,"paid": false,"paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000008",+ "payment_intent": "pi_NORMALIZED00000000000009","payment_settings": {"default_mandate": null,"payment_method_options": null,@@ -342,7 +451,7 @@"shipping_cost": null,"shipping_details": null,"starting_balance": 0,- "statement_descriptor": "Zulip Basic",+ "statement_descriptor": "Zulip Cloud Standard","status": "open","status_transitions": {"finalized_at": 1000000000,@@ -366,13 +475,13 @@"webhooks_delivered_at": null}},- "id": "evt_1P41keDEQaroqDjsk4QC3jF6",+ "id": "evt_1P67KwDEQaroqDjson0bJifi","livemode": false,"object": "event",- "pending_webhooks": 0,+ "pending_webhooks": 2,"request": {- "id": "req_NORMALIZED0030",- "idempotency_key": "4c569b60-62c1-4f37-8eee-66b623af3682"+ "id": "req_NORMALIZED0039",+ "idempotency_key": "a99541a6-f12d-40e2-b0cb-dc068fe7efc2"},"type": "invoice.finalized"},@@ -400,13 +509,13 @@},"billing_reason": "manual","charge": null,- "collection_method": "charge_automatically",+ "collection_method": "send_invoice","created": 1000000000,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0003",+ "customer": "cus_NORMALIZED0008","customer_address": null,- "customer_email": "[email protected]",+ "customer_email": "[email protected]","customer_name": null,"customer_phone": null,"customer_shipping": null,@@ -418,14 +527,14 @@"description": null,"discount": null,"discounts": [],- "due_date": null,+ "due_date": 1000000000,"effective_at": 1000000000,"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQdVlGems4ZUk4UFJkZlVoOGdCMEQ3eXo0T29LLDEwMzI5ODYyOA0200nDHJJhOV?s=ap",- "id": "in_NORMALIZED00000000000009",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQdVlGems4ZUk4UFJkZlVoOGdCMEQ3eXo0T29LLDEwMzI5ODYyOA0200nDHJJhOV/pdf?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKUDRLTXlMaUJWTGFndmowcEE2cDFDODNxWXpwLDEwMzc5Njc1NA0200yZqonJ1Z?s=ap",+ "id": "in_NORMALIZED00000000000011",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKUDRLTXlMaUJWTGFndmowcEE2cDFDODNxWXpwLDEwMzc5Njc1NA0200yZqonJ1Z/pdf?s=ap","issuer": {"type": "self"},@@ -437,19 +546,19 @@"amount": 10000,"amount_excluding_tax": 10000,"currency": "usd",- "description": "Zulip Basic - renewal",+ "description": "Zulip Cloud Standard","discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000010",- "invoice": "in_NORMALIZED00000000000009",- "invoice_item": "ii_NORMALIZED00000000000009",+ "id": "il_NORMALIZED00000000000012",+ "invoice": "in_NORMALIZED00000000000011",+ "invoice_item": "ii_NORMALIZED00000000000012","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1341198245,- "start": 1338606245+ "end": 1000000000,+ "start": 1000000000},"plan": null,"price": {@@ -488,17 +597,17 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000009/lines"+ "url": "/v1/invoices/in_NORMALIZED00000000000011/lines"},"livemode": false,"metadata": {},- "next_payment_attempt": 1000000000,+ "next_payment_attempt": null,"number": "NORMALI-0009","object": "invoice","on_behalf_of": null,"paid": false,"paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000008",+ "payment_intent": "pi_NORMALIZED00000000000009","payment_settings": {"default_mandate": null,"payment_method_options": null,@@ -520,7 +629,7 @@"shipping_cost": null,"shipping_details": null,"starting_balance": 0,- "statement_descriptor": "Zulip Basic",+ "statement_descriptor": "Zulip Cloud Standard","status": "open","status_transitions": {"finalized_at": 1000000000,@@ -561,15 +670,224 @@}}},- "id": "evt_1P41keDEQaroqDjs3OnHGupT",+ "id": "evt_1P67KwDEQaroqDjsr8D9DJYJ","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0030",- "idempotency_key": "4c569b60-62c1-4f37-8eee-66b623af3682"+ "id": "req_NORMALIZED0039",+ "idempotency_key": "a99541a6-f12d-40e2-b0cb-dc068fe7efc2"},"type": "invoice.updated"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "amount": 10000,+ "amount_capturable": 0,+ "amount_details": {+ "tip": {}+ },+ "amount_received": 0,+ "application": null,+ "application_fee_amount": null,+ "automatic_payment_methods": null,+ "canceled_at": null,+ "cancellation_reason": null,+ "capture_method": "automatic",+ "charges": {+ "data": [],+ "has_more": false,+ "object": "list",+ "total_count": 0,+ "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000008"+ },+ "client_secret": "pi_NORMALIZED00000000000008_secret_rYIub2qANJoNV4xvBOz1oFF4H",+ "confirmation_method": "automatic",+ "created": 1000000000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0002",+ "description": "Payment for Invoice",+ "id": "pi_NORMALIZED00000000000008",+ "invoice": "in_NORMALIZED00000000000010",+ "last_payment_error": null,+ "latest_charge": null,+ "livemode": false,+ "metadata": {},+ "next_action": null,+ "object": "payment_intent",+ "on_behalf_of": null,+ "payment_method": null,+ "payment_method_configuration_details": null,+ "payment_method_options": {+ "card": {+ "installments": null,+ "mandate_options": null,+ "network": null,+ "request_three_d_secure": "automatic"+ },+ "cashapp": {}+ },+ "payment_method_types": [+ "card",+ "cashapp"+ ],+ "processing": null,+ "receipt_email": "[email protected]",+ "review": null,+ "setup_future_usage": null,+ "shipping": null,+ "source": null,+ "statement_descriptor": "Zulip Basic",+ "statement_descriptor_suffix": null,+ "status": "requires_payment_method",+ "transfer_data": null,+ "transfer_group": null+ }+ },+ "id": "evt_3P67KwDEQaroqDjs0vw4F4ho",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0037",+ "idempotency_key": "895605f5-9e4c-4352-abf1-fc80df33f3b3"+ },+ "type": "payment_intent.created"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "amount": 10000,+ "amount_capturable": 0,+ "amount_details": {+ "tip": {}+ },+ "amount_received": 0,+ "application": null,+ "application_fee_amount": null,+ "automatic_payment_methods": null,+ "canceled_at": null,+ "cancellation_reason": null,+ "capture_method": "automatic",+ "charges": {+ "data": [],+ "has_more": false,+ "object": "list",+ "total_count": 0,+ "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000009"+ },+ "client_secret": "pi_NORMALIZED00000000000009_secret_WwOjlvut1zWiQNPrB3su5fzBm",+ "confirmation_method": "automatic",+ "created": 1000000000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0008",+ "description": "Payment for Invoice",+ "id": "pi_NORMALIZED00000000000009",+ "invoice": "in_NORMALIZED00000000000011",+ "last_payment_error": null,+ "latest_charge": null,+ "livemode": false,+ "metadata": {},+ "next_action": null,+ "object": "payment_intent",+ "on_behalf_of": null,+ "payment_method": null,+ "payment_method_configuration_details": null,+ "payment_method_options": {+ "card": {+ "installments": null,+ "mandate_options": null,+ "network": null,+ "request_three_d_secure": "automatic"+ },+ "cashapp": {},+ "wechat_pay": {+ "app_id": null,+ "client": null+ }+ },+ "payment_method_types": [+ "ach_credit_transfer",+ "card",+ "cashapp",+ "wechat_pay"+ ],+ "processing": null,+ "receipt_email": "[email protected]",+ "review": null,+ "setup_future_usage": null,+ "shipping": null,+ "source": null,+ "statement_descriptor": "Zulip Cloud Standard",+ "statement_descriptor_suffix": null,+ "status": "requires_payment_method",+ "transfer_data": null,+ "transfer_group": null+ }+ },+ "id": "evt_3P67KvDEQaroqDjs1w3oaYYo",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0039",+ "idempotency_key": "a99541a6-f12d-40e2-b0cb-dc068fe7efc2"+ },+ "type": "payment_intent.created"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "application": null,+ "automatic_payment_methods": null,+ "cancellation_reason": null,+ "client_secret": "seti_1P67KvDEQaroqDjspZ6TIuVA_secret_PvzJBK0aRpWZdNHYeWPMf7pKh27AXul",+ "created": 1000000000,+ "customer": "cus_NORMALIZED0004",+ "description": null,+ "flow_directions": null,+ "id": "seti_1P67KvDEQaroqDjspZ6TIuVA",+ "last_setup_error": null,+ "latest_attempt": "setatt_1P67KvDEQaroqDjsiWxJ1wyP",+ "livemode": false,+ "mandate": null,+ "metadata": {},+ "next_action": null,+ "object": "setup_intent",+ "on_behalf_of": null,+ "payment_method": "pm_1P67KvDEQaroqDjs8nXGcRQQ",+ "payment_method_configuration_details": null,+ "payment_method_options": {+ "card": {+ "mandate_options": null,+ "network": null,+ "request_three_d_secure": "automatic"+ }+ },+ "payment_method_types": [+ "card"+ ],+ "single_use_mandate": null,+ "status": "succeeded",+ "usage": "off_session"+ }+ },+ "id": "evt_1P67KwDEQaroqDjstdts6kcd",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0038",+ "idempotency_key": "b6f7c091-334d-4881-aadf-604e60338771"+ },+ "type": "setup_intent.created"}],"has_more": false,diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.9.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.9.jsonindex 0b53f5c93f6..2193ca9f73e 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.9.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Event.list.9.json@@ -6,9 +6,9 @@"data": {"object": {"ach_credit_transfer": {- "account_number": "test_NORMALIZED04",+ "account_number": "test_NORMALIZED03","bank_name": "TEST BANK",- "fingerprint": "NORMALIZED000004",+ "fingerprint": "NORMALIZED000003","refund_account_holder_name": null,"refund_account_holder_type": null,"refund_routing_number": null,@@ -16,12 +16,12 @@"swift_code": "TSTEZ122"},"amount": null,- "client_secret": "src_client_secret_NORMALIZED00000000000003",+ "client_secret": "src_client_secret_NORMALIZED00000000000002","created": 1000000000,"currency": "usd",- "customer": "cus_NORMALIZED0009",+ "customer": "cus_NORMALIZED0008","flow": "receiver",- "id": "src_NORMALIZED00000000000003",+ "id": "src_NORMALIZED00000000000002","livemode": false,"metadata": {},"object": "source",@@ -36,7 +36,7 @@"verified_phone": null},"receiver": {- "address": "000000000-test_NORMALIZED03",+ "address": "000000000-test_NORMALIZED02","amount_charged": 0,"amount_received": 0,"amount_returned": 0,@@ -49,13 +49,13 @@"usage": "reusable"}},- "id": "evt_1P41kfDEQaroqDjsm35DchEL",+ "id": "evt_1P67KxDEQaroqDjsVSd1M1S6","livemode": false,"object": "event","pending_webhooks": 2,"request": {"id": null,- "idempotency_key": "3f91be47-7637-4afa-9616-192223010e3e"+ "idempotency_key": "dab877ef-a9d5-4653-8f0d-7f4f37deed59"},"type": "customer.source.created"},@@ -66,19 +66,19 @@"object": {"amount": 10000,"currency": "usd",- "customer": "cus_NORMALIZED0009",+ "customer": "cus_NORMALIZED0002","date": 1000000000,- "description": "Zulip Cloud Standard",+ "description": "Zulip Basic - renewal","discountable": false,"discounts": [],- "id": "ii_NORMALIZED00000000000012",+ "id": "ii_NORMALIZED00000000000002","invoice": null,"livemode": false,"metadata": {},"object": "invoiceitem","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1346555045,+ "start": 1343876645},"plan": null,"price": {@@ -87,7 +87,7 @@"created": 1000000000,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000003",+ "id": "price_NORMALIZED00000000000001","livemode": false,"lookup_key": null,"metadata": {},@@ -111,13 +111,13 @@"unit_amount_decimal": "10000"}},- "id": "evt_1P41kfDEQaroqDjsYN3J7Bwr",+ "id": "evt_1P67KwDEQaroqDjs67V1PbL9","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0037",- "idempotency_key": "ca625530-6037-47f5-8a75-035090725249"+ "id": "req_NORMALIZED0040",+ "idempotency_key": "63a88eaf-0bd3-48ca-a0a1-10109d7b6c77"},"type": "invoiceitem.created"},@@ -126,178 +126,48 @@"created": 1000000000,"data": {"object": {- "account_country": "US",- "account_name": "Kandra Labs, Inc.",- "account_tax_ids": null,- "amount_due": 10000,- "amount_paid": 0,- "amount_remaining": 10000,- "amount_shipping": 0,- "application": null,- "application_fee_amount": null,- "attempt_count": 0,- "attempted": false,- "auto_advance": true,- "automatic_tax": {- "enabled": false,- "liability": null,- "status": null- },- "billing_reason": "manual",- "charge": null,- "collection_method": "charge_automatically",+ "address": null,+ "balance": 0,"created": 1000000000,- "currency": "usd",- "custom_fields": null,- "customer": "cus_NORMALIZED0003",- "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,+ "currency": null,+ "default_currency": null,"default_source": null,- "default_tax_rates": [],- "description": null,+ "delinquent": false,+ "description": "test-realm-6 (test-realm-6)","discount": null,- "discounts": [],- "due_date": null,- "effective_at": null,- "ending_balance": null,- "footer": null,- "from_invoice": null,- "hosted_invoice_url": null,- "id": "in_NORMALIZED00000000000010",- "invoice_pdf": null,- "issuer": {- "type": "self"- },- "last_finalization_error": null,- "latest_revision": null,- "lines": {- "data": [- {- "amount": 10000,- "amount_excluding_tax": 10000,- "currency": "usd",- "description": "Zulip Basic - renewal",- "discount_amounts": [],- "discountable": false,- "discounts": [],- "id": "il_NORMALIZED00000000000011",- "invoice": "in_NORMALIZED00000000000010",- "invoice_item": "ii_NORMALIZED00000000000011",- "livemode": false,- "metadata": {},- "object": "line_item",- "period": {- "end": 1343876645,- "start": 1341198245- },- "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": 10000,- "unit_amount_decimal": "10000"- },- "proration": false,- "proration_details": {- "credited_items": null- },- "quantity": 1,- "subscription": null,- "tax_amounts": [],- "tax_rates": [],- "type": "invoiceitem",- "unit_amount_excluding_tax": "10000"- }- ],- "has_more": false,- "object": "list",- "total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000010/lines"+ "email": "[email protected]",+ "id": "cus_NORMALIZED0003",+ "invoice_prefix": "NORMA02",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": null,+ "footer": null,+ "rendering_options": null},"livemode": false,- "metadata": {},- "next_payment_attempt": 1000000000,- "number": null,- "object": "invoice",- "on_behalf_of": null,- "paid": false,- "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": "auto"- }+ "metadata": {+ "realm_id": "2",+ "realm_str": "test-realm-6"},- "rendering_options": null,- "shipping_cost": null,- "shipping_details": null,- "starting_balance": 0,- "statement_descriptor": "Zulip Basic",- "status": "draft",- "status_transitions": {- "finalized_at": null,- "marked_uncollectible_at": null,- "paid_at": null,- "voided_at": null- },- "subscription": null,- "subscription_details": {- "metadata": null- },- "subtotal": 10000,- "subtotal_excluding_tax": 10000,- "tax": null,- "test_clock": null,- "total": 10000,- "total_discount_amounts": [],- "total_excluding_tax": 10000,- "total_tax_amounts": [],- "transfer_data": null,- "webhooks_delivered_at": null+ "name": null,+ "next_invoice_sequence": 1,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null}},- "id": "evt_1P41kfDEQaroqDjsVDdzMdKb",+ "id": "evt_1P67KwDEQaroqDjseubeX06M","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0038",- "idempotency_key": "420f7f8e-d384-4f9e-ac9f-fae150698f24"+ "id": "req_NORMALIZED0041",+ "idempotency_key": "4456ace6-c847-4160-aaca-aad2b86705a1"},- "type": "invoice.created"+ "type": "customer.created"},{"api_version": "2020-08-27",@@ -323,13 +193,13 @@},"billing_reason": "manual","charge": null,- "collection_method": "send_invoice",+ "collection_method": "charge_automatically","created": 1000000000,"currency": "usd","custom_fields": null,- "customer": "cus_NORMALIZED0009",+ "customer": "cus_NORMALIZED0002","customer_address": null,- "customer_email": "[email protected]",+ "customer_email": "[email protected]","customer_name": null,"customer_phone": null,"customer_shipping": null,@@ -341,14 +211,14 @@"description": null,"discount": null,"discounts": [],- "due_date": 1000000000,+ "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQc0d3b2pYNGlTN2hLdndJN3Vib1M0Z1dKMW9BLDEwMzI5ODYyOQ0200CWE3hYK5?s=ap",- "id": "in_NORMALIZED00000000000008",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQc0d3b2pYNGlTN2hLdndJN3Vib1M0Z1dKMW9BLDEwMzI5ODYyOQ0200CWE3hYK5/pdf?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKNEhMZ05iTXVmSFpXT003R3BsWElpTFpBTmRYLDEwMzc5Njc1NA0200n453bZum?s=ap",+ "id": "in_NORMALIZED00000000000010",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdnpKNEhMZ05iTXVmSFpXT003R3BsWElpTFpBTmRYLDEwMzc5Njc1NA0200n453bZum/pdf?s=ap","issuer": {"type": "self"},@@ -360,19 +230,19 @@"amount": 10000,"amount_excluding_tax": 10000,"currency": "usd",- "description": "Zulip Cloud Standard",+ "description": "Zulip Basic - renewal","discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000009",- "invoice": "in_NORMALIZED00000000000008",- "invoice_item": "ii_NORMALIZED00000000000010",+ "id": "il_NORMALIZED00000000000011",+ "invoice": "in_NORMALIZED00000000000010",+ "invoice_item": "ii_NORMALIZED00000000000011","livemode": false,"metadata": {},"object": "line_item","period": {- "end": 1000000000,- "start": 1000000000+ "end": 1343876645,+ "start": 1341198245},"plan": null,"price": {@@ -381,7 +251,7 @@"created": 1000000000,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000003",+ "id": "price_NORMALIZED00000000000001","livemode": false,"lookup_key": null,"metadata": {},@@ -411,17 +281,17 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000008/lines"+ "url": "/v1/invoices/in_NORMALIZED00000000000010/lines"},"livemode": false,"metadata": {},- "next_payment_attempt": null,- "number": "NORMALI-0010",+ "next_payment_attempt": 1000000000,+ "number": "NORMALI-0008","object": "invoice","on_behalf_of": null,"paid": false,"paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000009",+ "payment_intent": "pi_NORMALIZED00000000000008","payment_settings": {"default_mandate": null,"payment_method_options": null,@@ -443,7 +313,7 @@"shipping_cost": null,"shipping_details": null,"starting_balance": 0,- "statement_descriptor": "Zulip Cloud Standard",+ "statement_descriptor": "Zulip Basic","status": "open","status_transitions": {"finalized_at": 1000000000,@@ -467,210 +337,15 @@"webhooks_delivered_at": null}},- "id": "evt_1P41kfDEQaroqDjsBl0hZUPK",+ "id": "evt_1P67KwDEQaroqDjsAfEorRiI","livemode": false,"object": "event","pending_webhooks": 0,"request": {- "id": "req_NORMALIZED0035",- "idempotency_key": "d62b6596-5e90-4a25-b60c-b09079ec7b5e"+ "id": "req_NORMALIZED0037",+ "idempotency_key": "895605f5-9e4c-4352-abf1-fc80df33f3b3"},"type": "invoice.finalized"- },- {- "api_version": "2020-08-27",- "created": 1000000000,- "data": {- "object": {- "account_country": "US",- "account_name": "Kandra Labs, Inc.",- "account_tax_ids": null,- "amount_due": 10000,- "amount_paid": 0,- "amount_remaining": 10000,- "amount_shipping": 0,- "application": null,- "application_fee_amount": null,- "attempt_count": 0,- "attempted": false,- "auto_advance": true,- "automatic_tax": {- "enabled": false,- "liability": null,- "status": null- },- "billing_reason": "manual",- "charge": null,- "collection_method": "send_invoice",- "created": 1000000000,- "currency": "usd",- "custom_fields": null,- "customer": "cus_NORMALIZED0009",- "customer_address": null,- "customer_email": "[email protected]",- "customer_name": null,- "customer_phone": null,- "customer_shipping": null,- "customer_tax_exempt": "none",- "customer_tax_ids": [],- "default_payment_method": null,- "default_source": null,- "default_tax_rates": [],- "description": null,- "discount": null,- "discounts": [],- "due_date": 1000000000,- "effective_at": 1000000000,- "ending_balance": 0,- "footer": null,- "from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQc0d3b2pYNGlTN2hLdndJN3Vib1M0Z1dKMW9BLDEwMzI5ODYyOQ0200CWE3hYK5?s=ap",- "id": "in_NORMALIZED00000000000008",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQc0d3b2pYNGlTN2hLdndJN3Vib1M0Z1dKMW9BLDEwMzI5ODYyOQ0200CWE3hYK5/pdf?s=ap",- "issuer": {- "type": "self"- },- "last_finalization_error": null,- "latest_revision": null,- "lines": {- "data": [- {- "amount": 10000,- "amount_excluding_tax": 10000,- "currency": "usd",- "description": "Zulip Cloud Standard",- "discount_amounts": [],- "discountable": false,- "discounts": [],- "id": "il_NORMALIZED00000000000009",- "invoice": "in_NORMALIZED00000000000008",- "invoice_item": "ii_NORMALIZED00000000000010",- "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_NORMALIZED00000000000003",- "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": 10000,- "unit_amount_decimal": "10000"- },- "proration": false,- "proration_details": {- "credited_items": null- },- "quantity": 1,- "subscription": null,- "tax_amounts": [],- "tax_rates": [],- "type": "invoiceitem",- "unit_amount_excluding_tax": "10000"- }- ],- "has_more": false,- "object": "list",- "total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000008/lines"- },- "livemode": false,- "metadata": {},- "next_payment_attempt": null,- "number": "NORMALI-0010",- "object": "invoice",- "on_behalf_of": null,- "paid": false,- "paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000009",- "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": "open",- "status_transitions": {- "finalized_at": 1000000000,- "marked_uncollectible_at": null,- "paid_at": null,- "voided_at": null- },- "subscription": null,- "subscription_details": {- "metadata": null- },- "subtotal": 10000,- "subtotal_excluding_tax": 10000,- "tax": null,- "test_clock": null,- "total": 10000,- "total_discount_amounts": [],- "total_excluding_tax": 10000,- "total_tax_amounts": [],- "transfer_data": null,- "webhooks_delivered_at": null- },- "previous_attributes": {- "effective_at": null,- "ending_balance": null,- "hosted_invoice_url": null,- "invoice_pdf": null,- "number": null,- "payment_intent": null,- "rendering": {- "pdf": {- "page_size": "auto"- }- },- "status": "draft",- "status_transitions": {- "finalized_at": null- }- }- },- "id": "evt_1P41kfDEQaroqDjsWlyxo9kT",- "livemode": false,- "object": "event",- "pending_webhooks": 0,- "request": {- "id": "req_NORMALIZED0035",- "idempotency_key": "d62b6596-5e90-4a25-b60c-b09079ec7b5e"- },- "type": "invoice.updated"}],"has_more": false,diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Invoice.create.1.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Invoice.create.1.jsonindex 9a255bec064..ffc426fd7ae 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Invoice.create.1.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Invoice.create.1.json@@ -42,7 +42,7 @@"footer": null,"from_invoice": null,"hosted_invoice_url": null,- "id": "in_NORMALIZED00000000000004",+ "id": "in_NORMALIZED00000000000001","invoice_pdf": null,"issuer": {"type": "self"@@ -59,8 +59,8 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000006",- "invoice": "in_NORMALIZED00000000000004",+ "id": "il_NORMALIZED00000000000001",+ "invoice": "in_NORMALIZED00000000000001","invoice_item": "ii_NORMALIZED00000000000001","livemode": false,"metadata": {},@@ -106,7 +106,7 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000004/lines"+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"},"livemode": false,"metadata": {diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Invoice.create.2.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Invoice.create.2.jsonindex dc6efcf877c..1077a2b42e9 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Invoice.create.2.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Invoice.create.2.json@@ -2,9 +2,9 @@"account_country": "US","account_name": "Kandra Labs, Inc.","account_tax_ids": null,- "amount_due": 93305,+ "amount_due": 69364,"amount_paid": 0,- "amount_remaining": 93305,+ "amount_remaining": 69364,"amount_shipping": 0,"application": null,"application_fee_amount": null,@@ -42,7 +42,7 @@"footer": null,"from_invoice": null,"hosted_invoice_url": null,- "id": "in_NORMALIZED00000000000011",+ "id": "in_NORMALIZED00000000000002","invoice_pdf": null,"issuer": {"type": "self"@@ -52,16 +52,16 @@"lines": {"data": [{- "amount": 96000,- "amount_excluding_tax": 96000,+ "amount": 72000,+ "amount_excluding_tax": 72000,"currency": "usd","description": "Zulip Cloud Plus - renewal","discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000012",- "invoice": "in_NORMALIZED00000000000011",- "invoice_item": "ii_NORMALIZED00000000000013",+ "id": "il_NORMALIZED00000000000002",+ "invoice": "in_NORMALIZED00000000000002",+ "invoice_item": "ii_NORMALIZED00000000000002","livemode": false,"metadata": {},"object": "line_item",@@ -76,20 +76,20 @@"created": 1000000000,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000006",+ "id": "price_NORMALIZED00000000000002","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0005",+ "product": "prod_NORMALIZED0002","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,"transform_quantity": null,"type": "one_time",- "unit_amount": 16000,- "unit_amount_decimal": "16000"+ "unit_amount": 12000,+ "unit_amount_decimal": "12000"},"proration": false,"proration_details": {@@ -100,13 +100,13 @@"tax_amounts": [],"tax_rates": [],"type": "invoiceitem",- "unit_amount_excluding_tax": "16000"+ "unit_amount_excluding_tax": "12000"}],"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000011/lines"+ "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"},"livemode": false,"metadata": {},@@ -137,7 +137,7 @@"rendering_options": null,"shipping_cost": null,"shipping_details": null,- "starting_balance": -2695,+ "starting_balance": -2636,"statement_descriptor": "Zulip Cloud Plus","status": "draft","status_transitions": {@@ -150,13 +150,13 @@"subscription_details": {"metadata": null},- "subtotal": 96000,- "subtotal_excluding_tax": 96000,+ "subtotal": 72000,+ "subtotal_excluding_tax": 72000,"tax": null,"test_clock": null,- "total": 96000,+ "total": 72000,"total_discount_amounts": [],- "total_excluding_tax": 96000,+ "total_excluding_tax": 72000,"total_tax_amounts": [],"transfer_data": null,"webhooks_delivered_at": nulldiff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Invoice.finalize_invoice.1.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Invoice.finalize_invoice.1.jsonindex 516ad2dbdf8..3fa87222347 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Invoice.finalize_invoice.1.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Invoice.finalize_invoice.1.json@@ -41,9 +41,9 @@"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQVFpoUHlFUUpQSkUwc3ZDekVwc2tnRXhaSFJSLDEwMzI5ODYyMw02004QaAPaaq?s=ap",- "id": "in_NORMALIZED00000000000004",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQVFpoUHlFUUpQSkUwc3ZDekVwc2tnRXhaSFJSLDEwMzI5ODYyMw02004QaAPaaq/pdf?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9Qdnl0QUh2SjFEVzY5UGl5elAzNFpwS0JJY1NEWFV4LDEwMzc5NTE4OQ0200Uy5W6a5Z?s=ap",+ "id": "in_NORMALIZED00000000000001",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9Qdnl0QUh2SjFEVzY5UGl5elAzNFpwS0JJY1NEWFV4LDEwMzc5NTE4OQ0200Uy5W6a5Z/pdf?s=ap","issuer": {"type": "self"},@@ -59,8 +59,8 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000006",- "invoice": "in_NORMALIZED00000000000004",+ "id": "il_NORMALIZED00000000000001",+ "invoice": "in_NORMALIZED00000000000001","invoice_item": "ii_NORMALIZED00000000000001","livemode": false,"metadata": {},@@ -106,7 +106,7 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000004/lines"+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"},"livemode": false,"metadata": {@@ -118,12 +118,12 @@"user_id": "10"},"next_payment_attempt": null,- "number": "NORMALI-0005",+ "number": "NORMALI-0002","object": "invoice","on_behalf_of": null,"paid": false,"paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000003",+ "payment_intent": "pi_NORMALIZED00000000000001","payment_settings": {"default_mandate": null,"payment_method_options": null,diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Invoice.finalize_invoice.2.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Invoice.finalize_invoice.2.jsonindex 78297c4198a..a4cae8e6948 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Invoice.finalize_invoice.2.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Invoice.finalize_invoice.2.json@@ -2,9 +2,9 @@"account_country": "US","account_name": "Kandra Labs, Inc.","account_tax_ids": null,- "amount_due": 93305,+ "amount_due": 69364,"amount_paid": 0,- "amount_remaining": 93305,+ "amount_remaining": 69364,"amount_shipping": 0,"application": null,"application_fee_amount": null,@@ -41,9 +41,9 @@"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQNHU1RTRranczam9JbkVEOFpmdHRPRkVWQUwwLDEwMzI5ODYzMg0200bGDmSQVf?s=ap",- "id": "in_NORMALIZED00000000000011",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQNHU1RTRranczam9JbkVEOFpmdHRPRkVWQUwwLDEwMzI5ODYzMg0200bGDmSQVf/pdf?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9Qdnl0UmVWYUxCZUs0dHVkeFRWRENIa1dPUVdQMTRKLDEwMzc5NTE5NQ0200sAcOXWDk?s=ap",+ "id": "in_NORMALIZED00000000000002",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9Qdnl0UmVWYUxCZUs0dHVkeFRWRENIa1dPUVdQMTRKLDEwMzc5NTE5NQ0200sAcOXWDk/pdf?s=ap","issuer": {"type": "self"},@@ -52,16 +52,16 @@"lines": {"data": [{- "amount": 96000,- "amount_excluding_tax": 96000,+ "amount": 72000,+ "amount_excluding_tax": 72000,"currency": "usd","description": "Zulip Cloud Plus - renewal","discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000012",- "invoice": "in_NORMALIZED00000000000011",- "invoice_item": "ii_NORMALIZED00000000000013",+ "id": "il_NORMALIZED00000000000002",+ "invoice": "in_NORMALIZED00000000000002",+ "invoice_item": "ii_NORMALIZED00000000000002","livemode": false,"metadata": {},"object": "line_item",@@ -76,20 +76,20 @@"created": 1000000000,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000006",+ "id": "price_NORMALIZED00000000000002","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0005",+ "product": "prod_NORMALIZED0002","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,"transform_quantity": null,"type": "one_time",- "unit_amount": 16000,- "unit_amount_decimal": "16000"+ "unit_amount": 12000,+ "unit_amount_decimal": "12000"},"proration": false,"proration_details": {@@ -100,23 +100,23 @@"tax_amounts": [],"tax_rates": [],"type": "invoiceitem",- "unit_amount_excluding_tax": "16000"+ "unit_amount_excluding_tax": "12000"}],"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000011/lines"+ "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"},"livemode": false,"metadata": {},"next_payment_attempt": 1000000000,- "number": "NORMALI-0011",+ "number": "NORMALI-0003","object": "invoice","on_behalf_of": null,"paid": false,"paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000010",+ "payment_intent": "pi_NORMALIZED00000000000002","payment_settings": {"default_mandate": null,"payment_method_options": null,@@ -137,7 +137,7 @@"rendering_options": null,"shipping_cost": null,"shipping_details": null,- "starting_balance": -2695,+ "starting_balance": -2636,"statement_descriptor": "Zulip Cloud Plus","status": "open","status_transitions": {@@ -150,13 +150,13 @@"subscription_details": {"metadata": null},- "subtotal": 96000,- "subtotal_excluding_tax": 96000,+ "subtotal": 72000,+ "subtotal_excluding_tax": 72000,"tax": null,"test_clock": null,- "total": 96000,+ "total": 72000,"total_discount_amounts": [],- "total_excluding_tax": 96000,+ "total_excluding_tax": 72000,"total_tax_amounts": [],"transfer_data": null,"webhooks_delivered_at": nulldiff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Invoice.pay.1.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Invoice.pay.1.jsonindex 4a1f7d66291..b73be82a37b 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Invoice.pay.1.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--Invoice.pay.1.json@@ -41,9 +41,9 @@"ending_balance": 0,"footer": null,"from_invoice": null,- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQVFpoUHlFUUpQSkUwc3ZDekVwc2tnRXhaSFJSLDEwMzI5ODYyNQ0200x4e8Nyem?s=ap",- "id": "in_NORMALIZED00000000000004",- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QdHBQVFpoUHlFUUpQSkUwc3ZDekVwc2tnRXhaSFJSLDEwMzI5ODYyNQ0200x4e8Nyem/pdf?s=ap",+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9Qdnl0QUh2SjFEVzY5UGl5elAzNFpwS0JJY1NEWFV4LDEwMzc5NTE5MQ0200mimXVCzy?s=ap",+ "id": "in_NORMALIZED00000000000001",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9Qdnl0QUh2SjFEVzY5UGl5elAzNFpwS0JJY1NEWFV4LDEwMzc5NTE5MQ0200mimXVCzy/pdf?s=ap","issuer": {"type": "self"},@@ -59,8 +59,8 @@"discount_amounts": [],"discountable": false,"discounts": [],- "id": "il_NORMALIZED00000000000006",- "invoice": "in_NORMALIZED00000000000004",+ "id": "il_NORMALIZED00000000000001",+ "invoice": "in_NORMALIZED00000000000001","invoice_item": "ii_NORMALIZED00000000000001","livemode": false,"metadata": {},@@ -106,7 +106,7 @@"has_more": false,"object": "list","total_count": 1,- "url": "/v1/invoices/in_NORMALIZED00000000000004/lines"+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"},"livemode": false,"metadata": {@@ -118,12 +118,12 @@"user_id": "10"},"next_payment_attempt": null,- "number": "NORMALI-0005",+ "number": "NORMALI-0002","object": "invoice","on_behalf_of": null,"paid": true,"paid_out_of_band": false,- "payment_intent": "pi_NORMALIZED00000000000003",+ "payment_intent": "pi_NORMALIZED00000000000001","payment_settings": {"default_mandate": null,"payment_method_options": null,@@ -166,5 +166,5 @@"total_excluding_tax": 48000,"total_tax_amounts": [],"transfer_data": null,- "webhooks_delivered_at": 1000000000+ "webhooks_delivered_at": null}diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--InvoiceItem.create.2.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--InvoiceItem.create.2.jsonindex fbf9b9e8cfd..6b1585bf4f7 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--InvoiceItem.create.2.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--InvoiceItem.create.2.json@@ -1,12 +1,12 @@{- "amount": 96000,+ "amount": 72000,"currency": "usd","customer": "cus_NORMALIZED0001","date": 1000000000,"description": "Zulip Cloud Plus - renewal","discountable": false,"discounts": [],- "id": "ii_NORMALIZED00000000000013",+ "id": "ii_NORMALIZED00000000000002","invoice": null,"livemode": false,"metadata": {},@@ -22,26 +22,26 @@"created": 1000000000,"currency": "usd","custom_unit_amount": null,- "id": "price_NORMALIZED00000000000006",+ "id": "price_NORMALIZED00000000000002","livemode": false,"lookup_key": null,"metadata": {},"nickname": null,"object": "price",- "product": "prod_NORMALIZED0005",+ "product": "prod_NORMALIZED0002","recurring": null,"tax_behavior": "unspecified","tiers_mode": null,"transform_quantity": null,"type": "one_time",- "unit_amount": 16000,- "unit_amount_decimal": "16000"+ "unit_amount": 12000,+ "unit_amount_decimal": "12000"},"proration": false,"quantity": 6,"subscription": null,"tax_rates": [],"test_clock": null,- "unit_amount": 16000,- "unit_amount_decimal": "16000"+ "unit_amount": 12000,+ "unit_amount_decimal": "12000"}diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--PaymentMethod.create.1.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--PaymentMethod.create.1.jsonindex 6133b0ac118..46b06aa4535 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--PaymentMethod.create.1.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--PaymentMethod.create.1.json@@ -40,7 +40,7 @@},"created": 1000000000,"customer": null,- "id": "pm_1P41kTDEQaroqDjsnRkdmbrR",+ "id": "pm_1P66vbDEQaroqDjsUrXkyfgm","livemode": false,"metadata": {},"object": "payment_method",diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--SetupIntent.create.1.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--SetupIntent.create.1.jsonindex 6b255b18eb7..9f3631d1b89 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--SetupIntent.create.1.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--SetupIntent.create.1.json@@ -2,21 +2,21 @@"application": null,"automatic_payment_methods": null,"cancellation_reason": null,- "client_secret": "seti_1P41kUDEQaroqDjsT1F8ftBx_secret_PtpPvr5hWWM3PlgwFMfahFStHzD0os7",+ "client_secret": "seti_1P66vcDEQaroqDjshVfn0STR_secret_Pvyt6PKN8OrO8OpEhNkcup1Hb8WjpKY","created": 1000000000,"customer": "cus_NORMALIZED0001","description": null,"flow_directions": null,- "id": "seti_1P41kUDEQaroqDjsT1F8ftBx",+ "id": "seti_1P66vcDEQaroqDjshVfn0STR","last_setup_error": null,- "latest_attempt": "setatt_1P41kUDEQaroqDjsRTaQDExl",+ "latest_attempt": "setatt_1P66vcDEQaroqDjs0me2iJkE","livemode": false,"mandate": null,"metadata": {},"next_action": null,"object": "setup_intent","on_behalf_of": null,- "payment_method": "pm_1P41kTDEQaroqDjsnRkdmbrR",+ "payment_method": "pm_1P66vbDEQaroqDjsUrXkyfgm","payment_method_configuration_details": null,"payment_method_options": {"card": {diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--SetupIntent.list.1.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--SetupIntent.list.1.jsonindex 880d60b5075..ae48707cfcb 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--SetupIntent.list.1.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--SetupIntent.list.1.json@@ -4,12 +4,12 @@"application": null,"automatic_payment_methods": null,"cancellation_reason": null,- "client_secret": "seti_1P41kTDEQaroqDjsKYAroKF1_secret_PtpPesyr6Ywie9vXDoN1QGNzVmTPmet",+ "client_secret": "seti_1P66vaDEQaroqDjs0iTeCEQY_secret_PvytsvRBF00k7e1G9P0oQ8iBO2qK19b","created": 1000000000,"customer": "cus_NORMALIZED0001","description": null,"flow_directions": null,- "id": "seti_1P41kTDEQaroqDjsKYAroKF1",+ "id": "seti_1P66vaDEQaroqDjs0iTeCEQY","last_setup_error": null,"latest_attempt": null,"livemode": false,diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--SetupIntent.retrieve.1.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--SetupIntent.retrieve.1.jsonindex 6b255b18eb7..9f3631d1b89 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--SetupIntent.retrieve.1.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--SetupIntent.retrieve.1.json@@ -2,21 +2,21 @@"application": null,"automatic_payment_methods": null,"cancellation_reason": null,- "client_secret": "seti_1P41kUDEQaroqDjsT1F8ftBx_secret_PtpPvr5hWWM3PlgwFMfahFStHzD0os7",+ "client_secret": "seti_1P66vcDEQaroqDjshVfn0STR_secret_Pvyt6PKN8OrO8OpEhNkcup1Hb8WjpKY","created": 1000000000,"customer": "cus_NORMALIZED0001","description": null,"flow_directions": null,- "id": "seti_1P41kUDEQaroqDjsT1F8ftBx",+ "id": "seti_1P66vcDEQaroqDjshVfn0STR","last_setup_error": null,- "latest_attempt": "setatt_1P41kUDEQaroqDjsRTaQDExl",+ "latest_attempt": "setatt_1P66vcDEQaroqDjs0me2iJkE","livemode": false,"mandate": null,"metadata": {},"next_action": null,"object": "setup_intent","on_behalf_of": null,- "payment_method": "pm_1P41kTDEQaroqDjsnRkdmbrR",+ "payment_method": "pm_1P66vbDEQaroqDjsUrXkyfgm","payment_method_configuration_details": null,"payment_method_options": {"card": {diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--checkout.Session.create.1.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--checkout.Session.create.1.jsonindex d1d49907ea8..3f9ddd08ffe 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--checkout.Session.create.1.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--checkout.Session.create.1.json@@ -36,7 +36,7 @@},"customer_email": null,"expires_at": 1000000000,- "id": "cs_test_NORMALIZED05GUY2GsAwaIsStrsMePmizoK1dgfbF6A3uon3BKpabNKUy4",+ "id": "cs_test_NORMALIZED02Y4OnHKuhZVScOWxSh9mWPraB0OMka1xKP8Gxj8shUBPWN8","invoice": null,"invoice_creation": null,"livemode": false,@@ -64,7 +64,7 @@"enabled": false},"recovered_from": null,- "setup_intent": "seti_1P41kTDEQaroqDjsKYAroKF1",+ "setup_intent": "seti_1P66vaDEQaroqDjs0iTeCEQY","shipping": null,"shipping_address_collection": null,"shipping_options": [],@@ -75,5 +75,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_NORMALIZED05GUY2GsAwaIsStrsMePmizoK1dgfbF6A3uon3BKpabNKUy4#fid1d2BpamRhQ2prcSc%2FJ1ZqcHdmYCVWZGt2JVV3aicpJ2R1bE5gfCc%2FJ3VuWnFgdnFaXVRmMU5zNkldQTY9SnNRY09XZml2UXNQJyknY3dqaFZgd3Ngdyc%2FcXdwYCknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpmamlwaGsnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl"+ "url": "https://checkout.stripe.com/c/pay/cs_test_NORMALIZED02Y4OnHKuhZVScOWxSh9mWPraB0OMka1xKP8Gxj8shUBPWN8#fid1d2BpamRhQ2prcSc%2FJ1ZqcHdmYCVWZGt2JVV3aicpJ2R1bE5gfCc%2FJ3VuWnFgdnFaXVRmMU5zNkldQTY9SnNRY09XZml2UXNQJyknY3dqaFZgd3Ngdyc%2FcXdwYCknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpmamlwaGsnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl"}diff --git a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--checkout.Session.list.1.json b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--checkout.Session.list.1.jsonindex 65ec0918873..f9a969d711a 100644--- a/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--checkout.Session.list.1.json+++ b/corporate/tests/stripe_fixtures/switch_realm_from_standard_to_plus_plan--checkout.Session.list.1.json@@ -38,7 +38,7 @@},"customer_email": null,"expires_at": 1000000000,- "id": "cs_test_NORMALIZED05GUY2GsAwaIsStrsMePmizoK1dgfbF6A3uon3BKpabNKUy4",+ "id": "cs_test_NORMALIZED02Y4OnHKuhZVScOWxSh9mWPraB0OMka1xKP8Gxj8shUBPWN8","invoice": null,"invoice_creation": null,"livemode": false,@@ -66,7 +66,7 @@"enabled": false},"recovered_from": null,- "setup_intent": "seti_1P41kTDEQaroqDjsKYAroKF1",+ "setup_intent": "seti_1P66vaDEQaroqDjs0iTeCEQY","shipping": null,"shipping_address_collection": null,"shipping_options": [],@@ -77,7 +77,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_NORMALIZED05GUY2GsAwaIsStrsMePmizoK1dgfbF6A3uon3BKpabNKUy4#fid1d2BpamRhQ2prcSc%2FJ1ZqcHdmYCVWZGt2JVV3aicpJ2R1bE5gfCc%2FJ3VuWnFgdnFaXVRmMU5zNkldQTY9SnNRY09XZml2UXNQJyknY3dqaFZgd3Ngdyc%2FcXdwYCknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpmamlwaGsnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl"+ "url": "https://checkout.stripe.com/c/pay/cs_test_NORMALIZED02Y4OnHKuhZVScOWxSh9mWPraB0OMka1xKP8Gxj8shUBPWN8#fid1d2BpamRhQ2prcSc%2FJ1ZqcHdmYCVWZGt2JVV3aicpJ2R1bE5gfCc%2FJ3VuWnFgdnFaXVRmMU5zNkldQTY9SnNRY09XZml2UXNQJyknY3dqaFZgd3Ngdyc%2FcXdwYCknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpmamlwaGsnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl"}],"has_more": false,diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card--Event.list.6.json b/corporate/tests/stripe_fixtures/upgrade_by_card--Event.list.6.jsonnew file mode 100644index 00000000000..6d922067afe--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card--Event.list.6.json@@ -0,0 +1,6 @@+{+ "data": [],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Charge.list.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Charge.list.1.jsonnew file mode 100644index 00000000000..9989acd0b8f--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Charge.list.1.json@@ -0,0 +1,120 @@+{+ "data": [+ {+ "amount": 72000,+ "amount_captured": 72000,+ "amount_refunded": 0,+ "application": null,+ "application_fee": null,+ "application_fee_amount": null,+ "balance_transaction": "txn_NORMALIZED00000000000001",+ "billing_details": {+ "address": {+ "city": "San Francisco",+ "country": "US",+ "line1": "123 Main St",+ "line2": null,+ "postal_code": "94105",+ "state": "CA"+ },+ "email": null,+ "name": "John Doe",+ "phone": null+ },+ "calculated_statement_descriptor": "ZULIP CLOUD PLUS",+ "captured": true,+ "created": 1000000000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0001",+ "description": "Payment for Invoice",+ "destination": null,+ "dispute": null,+ "disputed": false,+ "failure_balance_transaction": null,+ "failure_code": null,+ "failure_message": null,+ "fraud_details": {},+ "id": "ch_NORMALIZED00000000000001",+ "invoice": "in_NORMALIZED00000000000001",+ "livemode": false,+ "metadata": {},+ "object": "charge",+ "on_behalf_of": null,+ "order": null,+ "outcome": {+ "network_status": "approved_by_network",+ "reason": null,+ "risk_level": "normal",+ "risk_score": 0,+ "seller_message": "Payment complete.",+ "type": "authorized"+ },+ "paid": true,+ "payment_intent": "pi_NORMALIZED00000000000001",+ "payment_method": "pm_1P7BliDEQaroqDjs3Jap8TxD",+ "payment_method_details": {+ "card": {+ "amount_authorized": 72000,+ "brand": "visa",+ "checks": {+ "address_line1_check": null,+ "address_postal_code_check": null,+ "cvc_check": "pass"+ },+ "country": "US",+ "exp_month": 4,+ "exp_year": 2025,+ "extended_authorization": {+ "status": "disabled"+ },+ "fingerprint": "NORMALIZED000001",+ "funding": "credit",+ "incremental_authorization": {+ "status": "unavailable"+ },+ "installments": null,+ "last4": "4242",+ "mandate": null,+ "multicapture": {+ "status": "unavailable"+ },+ "network": "visa",+ "network_token": {+ "used": false+ },+ "overcapture": {+ "maximum_amount_capturable": 72000,+ "status": "unavailable"+ },+ "three_d_secure": null,+ "wallet": null+ },+ "type": "card"+ },+ "radar_options": {},+ "receipt_email": "[email protected]",+ "receipt_number": null,+ "receipt_url": "https://pay.stripe.com/receipts/invoices/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKKC3iLEGMgbxzK_OCxk6LBaiV5rpAy8j9Cz0tHGaxluZjp_NWJ8q3UcF_nUgxZK0frQ_iSmNPIDm9D-O?s=ap",+ "refunded": false,+ "refunds": {+ "data": [],+ "has_more": false,+ "object": "list",+ "total_count": 0,+ "url": "/v1/charges/ch_NORMALIZED00000000000001/refunds"+ },+ "review": null,+ "shipping": null,+ "source": null,+ "source_transfer": null,+ "statement_descriptor": "Zulip Cloud Plus",+ "statement_descriptor_suffix": null,+ "status": "succeeded",+ "transfer_data": null,+ "transfer_group": null+ }+ ],+ "has_more": false,+ "object": "list",+ "url": "/v1/charges"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.create.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.create.1.jsonnew file mode 100644index 00000000000..593a07ed0c8--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.create.1.json@@ -0,0 +1,33 @@+{+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": null,+ "default_currency": null,+ "default_source": null,+ "delinquent": false,+ "description": "zulip (Zulip Dev)",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0001",+ "invoice_prefix": "NORMA01",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": null,+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "realm_id": "1",+ "realm_str": "zulip"+ },+ "name": null,+ "next_invoice_sequence": 1,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.modify.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.modify.1.jsonnew file mode 100644index 00000000000..4e0c1c32819--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.modify.1.json@@ -0,0 +1,33 @@+{+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": null,+ "default_currency": null,+ "default_source": null,+ "delinquent": false,+ "description": "zulip (Zulip Dev)",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0001",+ "invoice_prefix": "NORMA01",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": "pm_1P7BliDEQaroqDjs3Jap8TxD",+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "realm_id": "1",+ "realm_str": "zulip"+ },+ "name": null,+ "next_invoice_sequence": 1,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.retrieve.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.retrieve.1.jsonnew file mode 100644index 00000000000..55d86e54d66--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.retrieve.1.json@@ -0,0 +1,81 @@+{+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": null,+ "default_currency": null,+ "default_source": null,+ "delinquent": false,+ "description": "zulip (Zulip Dev)",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0001",+ "invoice_prefix": "NORMA01",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": {+ "allow_redisplay": "unspecified",+ "billing_details": {+ "address": {+ "city": "San Francisco",+ "country": "US",+ "line1": "123 Main St",+ "line2": null,+ "postal_code": "94105",+ "state": "CA"+ },+ "email": null,+ "name": "John Doe",+ "phone": null+ },+ "card": {+ "brand": "visa",+ "checks": {+ "address_line1_check": null,+ "address_postal_code_check": null,+ "cvc_check": "pass"+ },+ "country": "US",+ "display_brand": "visa",+ "exp_month": 4,+ "exp_year": 2025,+ "fingerprint": "NORMALIZED000001",+ "funding": "credit",+ "generated_from": null,+ "last4": "4242",+ "networks": {+ "available": [+ "visa"+ ],+ "preferred": null+ },+ "three_d_secure_usage": {+ "supported": true+ },+ "wallet": null+ },+ "created": 1000000000,+ "customer": "cus_NORMALIZED0001",+ "id": "pm_1P7BliDEQaroqDjs3Jap8TxD",+ "livemode": false,+ "metadata": {},+ "object": "payment_method",+ "type": "card"+ },+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "realm_id": "1",+ "realm_str": "zulip"+ },+ "name": null,+ "next_invoice_sequence": 1,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.retrieve.2.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.retrieve.2.jsonnew file mode 100644index 00000000000..55d86e54d66--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.retrieve.2.json@@ -0,0 +1,81 @@+{+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": null,+ "default_currency": null,+ "default_source": null,+ "delinquent": false,+ "description": "zulip (Zulip Dev)",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0001",+ "invoice_prefix": "NORMA01",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": {+ "allow_redisplay": "unspecified",+ "billing_details": {+ "address": {+ "city": "San Francisco",+ "country": "US",+ "line1": "123 Main St",+ "line2": null,+ "postal_code": "94105",+ "state": "CA"+ },+ "email": null,+ "name": "John Doe",+ "phone": null+ },+ "card": {+ "brand": "visa",+ "checks": {+ "address_line1_check": null,+ "address_postal_code_check": null,+ "cvc_check": "pass"+ },+ "country": "US",+ "display_brand": "visa",+ "exp_month": 4,+ "exp_year": 2025,+ "fingerprint": "NORMALIZED000001",+ "funding": "credit",+ "generated_from": null,+ "last4": "4242",+ "networks": {+ "available": [+ "visa"+ ],+ "preferred": null+ },+ "three_d_secure_usage": {+ "supported": true+ },+ "wallet": null+ },+ "created": 1000000000,+ "customer": "cus_NORMALIZED0001",+ "id": "pm_1P7BliDEQaroqDjs3Jap8TxD",+ "livemode": false,+ "metadata": {},+ "object": "payment_method",+ "type": "card"+ },+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "realm_id": "1",+ "realm_str": "zulip"+ },+ "name": null,+ "next_invoice_sequence": 1,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.retrieve.3.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.retrieve.3.jsonnew file mode 100644index 00000000000..55d86e54d66--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.retrieve.3.json@@ -0,0 +1,81 @@+{+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": null,+ "default_currency": null,+ "default_source": null,+ "delinquent": false,+ "description": "zulip (Zulip Dev)",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0001",+ "invoice_prefix": "NORMA01",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": {+ "allow_redisplay": "unspecified",+ "billing_details": {+ "address": {+ "city": "San Francisco",+ "country": "US",+ "line1": "123 Main St",+ "line2": null,+ "postal_code": "94105",+ "state": "CA"+ },+ "email": null,+ "name": "John Doe",+ "phone": null+ },+ "card": {+ "brand": "visa",+ "checks": {+ "address_line1_check": null,+ "address_postal_code_check": null,+ "cvc_check": "pass"+ },+ "country": "US",+ "display_brand": "visa",+ "exp_month": 4,+ "exp_year": 2025,+ "fingerprint": "NORMALIZED000001",+ "funding": "credit",+ "generated_from": null,+ "last4": "4242",+ "networks": {+ "available": [+ "visa"+ ],+ "preferred": null+ },+ "three_d_secure_usage": {+ "supported": true+ },+ "wallet": null+ },+ "created": 1000000000,+ "customer": "cus_NORMALIZED0001",+ "id": "pm_1P7BliDEQaroqDjs3Jap8TxD",+ "livemode": false,+ "metadata": {},+ "object": "payment_method",+ "type": "card"+ },+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "realm_id": "1",+ "realm_str": "zulip"+ },+ "name": null,+ "next_invoice_sequence": 1,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.retrieve.4.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.retrieve.4.jsonnew file mode 100644index 00000000000..55d86e54d66--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.retrieve.4.json@@ -0,0 +1,81 @@+{+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": null,+ "default_currency": null,+ "default_source": null,+ "delinquent": false,+ "description": "zulip (Zulip Dev)",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0001",+ "invoice_prefix": "NORMA01",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": {+ "allow_redisplay": "unspecified",+ "billing_details": {+ "address": {+ "city": "San Francisco",+ "country": "US",+ "line1": "123 Main St",+ "line2": null,+ "postal_code": "94105",+ "state": "CA"+ },+ "email": null,+ "name": "John Doe",+ "phone": null+ },+ "card": {+ "brand": "visa",+ "checks": {+ "address_line1_check": null,+ "address_postal_code_check": null,+ "cvc_check": "pass"+ },+ "country": "US",+ "display_brand": "visa",+ "exp_month": 4,+ "exp_year": 2025,+ "fingerprint": "NORMALIZED000001",+ "funding": "credit",+ "generated_from": null,+ "last4": "4242",+ "networks": {+ "available": [+ "visa"+ ],+ "preferred": null+ },+ "three_d_secure_usage": {+ "supported": true+ },+ "wallet": null+ },+ "created": 1000000000,+ "customer": "cus_NORMALIZED0001",+ "id": "pm_1P7BliDEQaroqDjs3Jap8TxD",+ "livemode": false,+ "metadata": {},+ "object": "payment_method",+ "type": "card"+ },+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "realm_id": "1",+ "realm_str": "zulip"+ },+ "name": null,+ "next_invoice_sequence": 1,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.retrieve.5.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.retrieve.5.jsonnew file mode 100644index 00000000000..b6283e222c4--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Customer.retrieve.5.json@@ -0,0 +1,81 @@+{+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": "usd",+ "default_currency": "usd",+ "default_source": null,+ "delinquent": false,+ "description": "zulip (Zulip Dev)",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0001",+ "invoice_prefix": "NORMA01",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": {+ "allow_redisplay": "unspecified",+ "billing_details": {+ "address": {+ "city": "San Francisco",+ "country": "US",+ "line1": "123 Main St",+ "line2": null,+ "postal_code": "94105",+ "state": "CA"+ },+ "email": null,+ "name": "John Doe",+ "phone": null+ },+ "card": {+ "brand": "visa",+ "checks": {+ "address_line1_check": null,+ "address_postal_code_check": null,+ "cvc_check": "pass"+ },+ "country": "US",+ "display_brand": "visa",+ "exp_month": 4,+ "exp_year": 2025,+ "fingerprint": "NORMALIZED000001",+ "funding": "credit",+ "generated_from": null,+ "last4": "4242",+ "networks": {+ "available": [+ "visa"+ ],+ "preferred": null+ },+ "three_d_secure_usage": {+ "supported": true+ },+ "wallet": null+ },+ "created": 1000000000,+ "customer": "cus_NORMALIZED0001",+ "id": "pm_1P7BliDEQaroqDjs3Jap8TxD",+ "livemode": false,+ "metadata": {},+ "object": "payment_method",+ "type": "card"+ },+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "realm_id": "1",+ "realm_str": "zulip"+ },+ "name": null,+ "next_invoice_sequence": 2,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Event.list.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Event.list.1.jsonnew file mode 100644index 00000000000..73bc9489ea4--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Event.list.1.json@@ -0,0 +1,60 @@+{+ "data": [+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": null,+ "default_currency": null,+ "default_source": null,+ "delinquent": false,+ "description": "zulip (Zulip Dev)",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0001",+ "invoice_prefix": "NORMA01",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": "pm_1P7BliDEQaroqDjs3Jap8TxD",+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "realm_id": "1",+ "realm_str": "zulip"+ },+ "name": null,+ "next_invoice_sequence": 1,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+ },+ "previous_attributes": {+ "invoice_settings": {+ "default_payment_method": null+ }+ }+ },+ "id": "evt_1P7BlkDEQaroqDjsROlU2tAd",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0001",+ "idempotency_key": "aa534fb9-4879-4d3a-bbdf-bd5a933e4adf"+ },+ "type": "customer.updated"+ }+ ],+ "has_more": true,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Event.list.2.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Event.list.2.jsonnew file mode 100644index 00000000000..750185a9af2--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Event.list.2.json@@ -0,0 +1,1089 @@+{+ "data": [+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "amount": 72000,+ "amount_capturable": 0,+ "amount_details": {+ "tip": {}+ },+ "amount_received": 72000,+ "application": null,+ "application_fee_amount": null,+ "automatic_payment_methods": null,+ "canceled_at": null,+ "cancellation_reason": null,+ "capture_method": "automatic",+ "charges": {+ "data": [+ {+ "amount": 72000,+ "amount_captured": 72000,+ "amount_refunded": 0,+ "application": null,+ "application_fee": null,+ "application_fee_amount": null,+ "balance_transaction": "txn_NORMALIZED00000000000001",+ "billing_details": {+ "address": {+ "city": "San Francisco",+ "country": "US",+ "line1": "123 Main St",+ "line2": null,+ "postal_code": "94105",+ "state": "CA"+ },+ "email": null,+ "name": "John Doe",+ "phone": null+ },+ "calculated_statement_descriptor": "ZULIP CLOUD PLUS",+ "captured": true,+ "created": 1000000000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0001",+ "description": "Payment for Invoice",+ "destination": null,+ "dispute": null,+ "disputed": false,+ "failure_balance_transaction": null,+ "failure_code": null,+ "failure_message": null,+ "fraud_details": {},+ "id": "ch_NORMALIZED00000000000001",+ "invoice": "in_NORMALIZED00000000000001",+ "livemode": false,+ "metadata": {},+ "object": "charge",+ "on_behalf_of": null,+ "order": null,+ "outcome": {+ "network_status": "approved_by_network",+ "reason": null,+ "risk_level": "normal",+ "risk_score": 0,+ "seller_message": "Payment complete.",+ "type": "authorized"+ },+ "paid": true,+ "payment_intent": "pi_NORMALIZED00000000000001",+ "payment_method": "pm_1P7BliDEQaroqDjs3Jap8TxD",+ "payment_method_details": {+ "card": {+ "amount_authorized": 72000,+ "brand": "visa",+ "checks": {+ "address_line1_check": null,+ "address_postal_code_check": null,+ "cvc_check": "pass"+ },+ "country": "US",+ "exp_month": 4,+ "exp_year": 2025,+ "extended_authorization": {+ "status": "disabled"+ },+ "fingerprint": "NORMALIZED000001",+ "funding": "credit",+ "incremental_authorization": {+ "status": "unavailable"+ },+ "installments": null,+ "last4": "4242",+ "mandate": null,+ "multicapture": {+ "status": "unavailable"+ },+ "network": "visa",+ "network_token": {+ "used": false+ },+ "overcapture": {+ "maximum_amount_capturable": 72000,+ "status": "unavailable"+ },+ "three_d_secure": null,+ "wallet": null+ },+ "type": "card"+ },+ "radar_options": {},+ "receipt_email": "[email protected]",+ "receipt_number": null,+ "receipt_url": "https://pay.stripe.com/receipts/invoices/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKJ63iLEGMgY-namYLUw6LBYvDkCEEu3hGQbMniH6dONKumKwzmMow7AkRtpYtjoWgoAIgUIX7SLKPPpa?s=ap",+ "refunded": false,+ "refunds": {+ "data": [],+ "has_more": false,+ "object": "list",+ "total_count": 0,+ "url": "/v1/charges/ch_NORMALIZED00000000000001/refunds"+ },+ "review": null,+ "shipping": null,+ "source": null,+ "source_transfer": null,+ "statement_descriptor": "Zulip Cloud Plus",+ "statement_descriptor_suffix": null,+ "status": "succeeded",+ "transfer_data": null,+ "transfer_group": null+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000001"+ },+ "client_secret": "pi_NORMALIZED00000000000001_secret_czPfph8NwlZ799WD7QG6Mm4sB",+ "confirmation_method": "automatic",+ "created": 1000000000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0001",+ "description": "Payment for Invoice",+ "id": "pi_NORMALIZED00000000000001",+ "invoice": "in_NORMALIZED00000000000001",+ "last_payment_error": null,+ "latest_charge": "ch_NORMALIZED00000000000001",+ "livemode": false,+ "metadata": {},+ "next_action": null,+ "object": "payment_intent",+ "on_behalf_of": null,+ "payment_method": "pm_1P7BliDEQaroqDjs3Jap8TxD",+ "payment_method_configuration_details": null,+ "payment_method_options": {+ "card": {+ "installments": null,+ "mandate_options": null,+ "network": null,+ "request_three_d_secure": "automatic"+ },+ "cashapp": {}+ },+ "payment_method_types": [+ "card",+ "cashapp"+ ],+ "processing": null,+ "receipt_email": "[email protected]",+ "review": null,+ "setup_future_usage": null,+ "shipping": null,+ "source": null,+ "statement_descriptor": "Zulip Cloud Plus",+ "statement_descriptor_suffix": null,+ "status": "succeeded",+ "transfer_data": null,+ "transfer_group": null+ }+ },+ "id": "evt_3P7BloDEQaroqDjs1nNanuyf",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0002",+ "idempotency_key": "8e036411-0aa2-4899-ae98-19d65fa9c785"+ },+ "type": "payment_intent.succeeded"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "amount": 72000,+ "amount_captured": 72000,+ "amount_refunded": 0,+ "application": null,+ "application_fee": null,+ "application_fee_amount": null,+ "balance_transaction": "txn_NORMALIZED00000000000001",+ "billing_details": {+ "address": {+ "city": "San Francisco",+ "country": "US",+ "line1": "123 Main St",+ "line2": null,+ "postal_code": "94105",+ "state": "CA"+ },+ "email": null,+ "name": "John Doe",+ "phone": null+ },+ "calculated_statement_descriptor": "ZULIP CLOUD PLUS",+ "captured": true,+ "created": 1000000000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0001",+ "description": "Payment for Invoice",+ "destination": null,+ "dispute": null,+ "disputed": false,+ "failure_balance_transaction": null,+ "failure_code": null,+ "failure_message": null,+ "fraud_details": {},+ "id": "ch_NORMALIZED00000000000001",+ "invoice": "in_NORMALIZED00000000000001",+ "livemode": false,+ "metadata": {},+ "object": "charge",+ "on_behalf_of": null,+ "order": null,+ "outcome": {+ "network_status": "approved_by_network",+ "reason": null,+ "risk_level": "normal",+ "risk_score": 0,+ "seller_message": "Payment complete.",+ "type": "authorized"+ },+ "paid": true,+ "payment_intent": "pi_NORMALIZED00000000000001",+ "payment_method": "pm_1P7BliDEQaroqDjs3Jap8TxD",+ "payment_method_details": {+ "card": {+ "amount_authorized": 72000,+ "brand": "visa",+ "checks": {+ "address_line1_check": null,+ "address_postal_code_check": null,+ "cvc_check": "pass"+ },+ "country": "US",+ "exp_month": 4,+ "exp_year": 2025,+ "extended_authorization": {+ "status": "disabled"+ },+ "fingerprint": "NORMALIZED000001",+ "funding": "credit",+ "incremental_authorization": {+ "status": "unavailable"+ },+ "installments": null,+ "last4": "4242",+ "mandate": null,+ "multicapture": {+ "status": "unavailable"+ },+ "network": "visa",+ "network_token": {+ "used": false+ },+ "overcapture": {+ "maximum_amount_capturable": 72000,+ "status": "unavailable"+ },+ "three_d_secure": null,+ "wallet": null+ },+ "type": "card"+ },+ "radar_options": {},+ "receipt_email": "[email protected]",+ "receipt_number": null,+ "receipt_url": "https://pay.stripe.com/receipts/invoices/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKJ63iLEGMgb7B2aD2sI6LBakIZ8P8p8GdZ2pcqOBk4nXV_YPnZUIdC8VVDtYaReAUp7M9b8EQFT00IFK?s=ap",+ "refunded": false,+ "refunds": {+ "data": [],+ "has_more": false,+ "object": "list",+ "total_count": 0,+ "url": "/v1/charges/ch_NORMALIZED00000000000001/refunds"+ },+ "review": null,+ "shipping": null,+ "source": null,+ "source_transfer": null,+ "statement_descriptor": "Zulip Cloud Plus",+ "statement_descriptor_suffix": null,+ "status": "succeeded",+ "transfer_data": null,+ "transfer_group": null+ }+ },+ "id": "evt_3P7BloDEQaroqDjs1aWafZPT",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0002",+ "idempotency_key": "8e036411-0aa2-4899-ae98-19d65fa9c785"+ },+ "type": "charge.succeeded"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 72000,+ "amount_paid": 0,+ "amount_remaining": 72000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": false,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDV4ZzlZR2I5dXhCa3dweGhJYkMxbk5wcUxBUm16LDEwNDA1MjEyNQ02004QD3cwbG?s=ap",+ "id": "in_NORMALIZED00000000000001",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDV4ZzlZR2I5dXhCa3dweGhJYkMxbk5wcUxBUm16LDEwNDA1MjEyNQ02004QD3cwbG/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 72000,+ "amount_excluding_tax": 72000,+ "currency": "usd",+ "description": "Zulip Cloud Plus",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000001",+ "invoice": "in_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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 6,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "12000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "automatic",+ "licenses": "6",+ "on_free_trial": "False",+ "plan_tier": "2",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": "NORMALI-0001",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "paid_out_of_band": false,+ "payment_intent": "pi_NORMALIZED00000000000001",+ "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 Plus",+ "status": "open",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 72000,+ "subtotal_excluding_tax": 72000,+ "tax": null,+ "test_clock": null,+ "total": 72000,+ "total_discount_amounts": [],+ "total_excluding_tax": 72000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": 1000000000+ }+ },+ "id": "evt_1P7BlpDEQaroqDjsFi2nCkZg",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0003",+ "idempotency_key": "c6189fbe-8593-4901-b800-295242c3aefa"+ },+ "type": "invoice.finalized"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 72000,+ "amount_paid": 0,+ "amount_remaining": 72000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": false,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDV4ZzlZR2I5dXhCa3dweGhJYkMxbk5wcUxBUm16LDEwNDA1MjEyNQ02004QD3cwbG?s=ap",+ "id": "in_NORMALIZED00000000000001",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDV4ZzlZR2I5dXhCa3dweGhJYkMxbk5wcUxBUm16LDEwNDA1MjEyNQ02004QD3cwbG/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 72000,+ "amount_excluding_tax": 72000,+ "currency": "usd",+ "description": "Zulip Cloud Plus",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000001",+ "invoice": "in_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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 6,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "12000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "automatic",+ "licenses": "6",+ "on_free_trial": "False",+ "plan_tier": "2",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": "NORMALI-0001",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "paid_out_of_band": false,+ "payment_intent": "pi_NORMALIZED00000000000001",+ "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 Plus",+ "status": "open",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 72000,+ "subtotal_excluding_tax": 72000,+ "tax": null,+ "test_clock": null,+ "total": 72000,+ "total_discount_amounts": [],+ "total_excluding_tax": 72000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": 1000000000+ },+ "previous_attributes": {+ "effective_at": null,+ "ending_balance": null,+ "hosted_invoice_url": null,+ "invoice_pdf": null,+ "number": null,+ "payment_intent": null,+ "rendering": {+ "pdf": {+ "page_size": "auto"+ }+ },+ "status": "draft",+ "status_transitions": {+ "finalized_at": null+ }+ }+ },+ "id": "evt_1P7BlpDEQaroqDjsiAraQSwy",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0003",+ "idempotency_key": "c6189fbe-8593-4901-b800-295242c3aefa"+ },+ "type": "invoice.updated"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "amount": 72000,+ "amount_capturable": 0,+ "amount_details": {+ "tip": {}+ },+ "amount_received": 0,+ "application": null,+ "application_fee_amount": null,+ "automatic_payment_methods": null,+ "canceled_at": null,+ "cancellation_reason": null,+ "capture_method": "automatic",+ "charges": {+ "data": [],+ "has_more": false,+ "object": "list",+ "total_count": 0,+ "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000001"+ },+ "client_secret": "pi_NORMALIZED00000000000001_secret_czPfph8NwlZ799WD7QG6Mm4sB",+ "confirmation_method": "automatic",+ "created": 1000000000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0001",+ "description": "Payment for Invoice",+ "id": "pi_NORMALIZED00000000000001",+ "invoice": "in_NORMALIZED00000000000001",+ "last_payment_error": null,+ "latest_charge": null,+ "livemode": false,+ "metadata": {},+ "next_action": null,+ "object": "payment_intent",+ "on_behalf_of": null,+ "payment_method": null,+ "payment_method_configuration_details": null,+ "payment_method_options": {+ "card": {+ "installments": null,+ "mandate_options": null,+ "network": null,+ "request_three_d_secure": "automatic"+ },+ "cashapp": {}+ },+ "payment_method_types": [+ "card",+ "cashapp"+ ],+ "processing": null,+ "receipt_email": "[email protected]",+ "review": null,+ "setup_future_usage": null,+ "shipping": null,+ "source": null,+ "statement_descriptor": "Zulip Cloud Plus",+ "statement_descriptor_suffix": null,+ "status": "requires_payment_method",+ "transfer_data": null,+ "transfer_group": null+ }+ },+ "id": "evt_3P7BloDEQaroqDjs1YY6aXxN",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0003",+ "idempotency_key": "c6189fbe-8593-4901-b800-295242c3aefa"+ },+ "type": "payment_intent.created"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 72000,+ "amount_paid": 0,+ "amount_remaining": 72000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": false,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "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": null,+ "ending_balance": null,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": null,+ "id": "in_NORMALIZED00000000000001",+ "invoice_pdf": null,+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 72000,+ "amount_excluding_tax": 72000,+ "currency": "usd",+ "description": "Zulip Cloud Plus",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000001",+ "invoice": "in_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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 6,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "12000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "automatic",+ "licenses": "6",+ "on_free_trial": "False",+ "plan_tier": "2",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": null,+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "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": "auto"+ }+ },+ "rendering_options": null,+ "shipping_cost": null,+ "shipping_details": null,+ "starting_balance": 0,+ "statement_descriptor": "Zulip Cloud Plus",+ "status": "draft",+ "status_transitions": {+ "finalized_at": null,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 72000,+ "subtotal_excluding_tax": 72000,+ "tax": null,+ "test_clock": null,+ "total": 72000,+ "total_discount_amounts": [],+ "total_excluding_tax": 72000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": 1000000000+ }+ },+ "id": "evt_1P7BloDEQaroqDjsIYdrbzv1",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0004",+ "idempotency_key": "eb85c8c4-7de5-4ab4-9dcb-1dd84c947ca0"+ },+ "type": "invoice.created"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "amount": 72000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0001",+ "date": 1000000000,+ "description": "Zulip Cloud Plus",+ "discountable": false,+ "discounts": [],+ "id": "ii_NORMALIZED00000000000001",+ "invoice": null,+ "livemode": false,+ "metadata": {},+ "object": "invoiceitem",+ "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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "quantity": 6,+ "subscription": null,+ "tax_rates": [],+ "test_clock": null,+ "unit_amount": 12000,+ "unit_amount_decimal": "12000"+ }+ },+ "id": "evt_1P7BlnDEQaroqDjsvqu6BXh4",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0005",+ "idempotency_key": "ac5330eb-7303-4be4-a565-598e61b1214e"+ },+ "type": "invoiceitem.created"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": "usd",+ "default_currency": "usd",+ "default_source": null,+ "delinquent": false,+ "description": "zulip (Zulip Dev)",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0001",+ "invoice_prefix": "NORMA01",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": "pm_1P7BliDEQaroqDjs3Jap8TxD",+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "realm_id": "1",+ "realm_str": "zulip"+ },+ "name": null,+ "next_invoice_sequence": 1,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+ },+ "previous_attributes": {+ "currency": null,+ "default_currency": null+ }+ },+ "id": "evt_1P7BlnDEQaroqDjsLWGcAeyk",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0005",+ "idempotency_key": "ac5330eb-7303-4be4-a565-598e61b1214e"+ },+ "type": "customer.updated"+ }+ ],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Event.list.3.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Event.list.3.jsonnew file mode 100644index 00000000000..b7fb66d0035--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Event.list.3.json@@ -0,0 +1,574 @@+{+ "data": [+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 72000,+ "amount_paid": 72000,+ "amount_remaining": 0,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 1,+ "attempted": true,+ "auto_advance": false,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": "ch_NORMALIZED00000000000001",+ "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDV4ZzlZR2I5dXhCa3dweGhJYkMxbk5wcUxBUm16LDEwNDA1MjEyNw0200eXk4D8OL?s=ap",+ "id": "in_NORMALIZED00000000000001",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDV4ZzlZR2I5dXhCa3dweGhJYkMxbk5wcUxBUm16LDEwNDA1MjEyNw0200eXk4D8OL/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 72000,+ "amount_excluding_tax": 72000,+ "currency": "usd",+ "description": "Zulip Cloud Plus",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000001",+ "invoice": "in_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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 6,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "12000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "automatic",+ "licenses": "6",+ "on_free_trial": "False",+ "plan_tier": "2",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": "NORMALI-0002",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": true,+ "paid_out_of_band": false,+ "payment_intent": "pi_NORMALIZED00000000000001",+ "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 Plus",+ "status": "paid",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": 1000000000,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 72000,+ "subtotal_excluding_tax": 72000,+ "tax": null,+ "test_clock": null,+ "total": 72000,+ "total_discount_amounts": [],+ "total_excluding_tax": 72000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": 1000000000+ }+ },+ "id": "evt_1P7BlrDEQaroqDjsQcxZUlL4",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0002",+ "idempotency_key": "8e036411-0aa2-4899-ae98-19d65fa9c785"+ },+ "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": 72000,+ "amount_paid": 72000,+ "amount_remaining": 0,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 1,+ "attempted": true,+ "auto_advance": false,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": "ch_NORMALIZED00000000000001",+ "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDV4ZzlZR2I5dXhCa3dweGhJYkMxbk5wcUxBUm16LDEwNDA1MjEyNw0200eXk4D8OL?s=ap",+ "id": "in_NORMALIZED00000000000001",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDV4ZzlZR2I5dXhCa3dweGhJYkMxbk5wcUxBUm16LDEwNDA1MjEyNw0200eXk4D8OL/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 72000,+ "amount_excluding_tax": 72000,+ "currency": "usd",+ "description": "Zulip Cloud Plus",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000001",+ "invoice": "in_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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 6,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "12000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "automatic",+ "licenses": "6",+ "on_free_trial": "False",+ "plan_tier": "2",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": "NORMALI-0002",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": true,+ "paid_out_of_band": false,+ "payment_intent": "pi_NORMALIZED00000000000001",+ "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 Plus",+ "status": "paid",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": 1000000000,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 72000,+ "subtotal_excluding_tax": 72000,+ "tax": null,+ "test_clock": null,+ "total": 72000,+ "total_discount_amounts": [],+ "total_excluding_tax": 72000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": 1000000000+ }+ },+ "id": "evt_1P7BlrDEQaroqDjsoaCaph4O",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0002",+ "idempotency_key": "8e036411-0aa2-4899-ae98-19d65fa9c785"+ },+ "type": "invoice.paid"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 72000,+ "amount_paid": 72000,+ "amount_remaining": 0,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 1,+ "attempted": true,+ "auto_advance": false,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": "ch_NORMALIZED00000000000001",+ "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDV4ZzlZR2I5dXhCa3dweGhJYkMxbk5wcUxBUm16LDEwNDA1MjEyNw0200eXk4D8OL?s=ap",+ "id": "in_NORMALIZED00000000000001",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDV4ZzlZR2I5dXhCa3dweGhJYkMxbk5wcUxBUm16LDEwNDA1MjEyNw0200eXk4D8OL/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 72000,+ "amount_excluding_tax": 72000,+ "currency": "usd",+ "description": "Zulip Cloud Plus",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000001",+ "invoice": "in_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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 6,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "12000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "automatic",+ "licenses": "6",+ "on_free_trial": "False",+ "plan_tier": "2",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": "NORMALI-0002",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": true,+ "paid_out_of_band": false,+ "payment_intent": "pi_NORMALIZED00000000000001",+ "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 Plus",+ "status": "paid",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": 1000000000,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 72000,+ "subtotal_excluding_tax": 72000,+ "tax": null,+ "test_clock": null,+ "total": 72000,+ "total_discount_amounts": [],+ "total_excluding_tax": 72000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": 1000000000+ },+ "previous_attributes": {+ "amount_paid": 0,+ "amount_remaining": 72000,+ "attempt_count": 0,+ "attempted": false,+ "charge": null,+ "paid": false,+ "status": "open",+ "status_transitions": {+ "paid_at": null+ }+ }+ },+ "id": "evt_1P7BlrDEQaroqDjsMXKHrAKO",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0002",+ "idempotency_key": "8e036411-0aa2-4899-ae98-19d65fa9c785"+ },+ "type": "invoice.updated"+ }+ ],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Event.list.4.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Event.list.4.jsonnew file mode 100644index 00000000000..6d922067afe--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Event.list.4.json@@ -0,0 +1,6 @@+{+ "data": [],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Invoice.create.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Invoice.create.1.jsonnew file mode 100644index 00000000000..fb8f6772000--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Invoice.create.1.json@@ -0,0 +1,170 @@+{+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 72000,+ "amount_paid": 0,+ "amount_remaining": 72000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": false,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "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": null,+ "ending_balance": null,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": null,+ "id": "in_NORMALIZED00000000000001",+ "invoice_pdf": null,+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 72000,+ "amount_excluding_tax": 72000,+ "currency": "usd",+ "description": "Zulip Cloud Plus",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000001",+ "invoice": "in_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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 6,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "12000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "automatic",+ "licenses": "6",+ "on_free_trial": "False",+ "plan_tier": "2",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": null,+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "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": "auto"+ }+ },+ "rendering_options": null,+ "shipping_cost": null,+ "shipping_details": null,+ "starting_balance": 0,+ "statement_descriptor": "Zulip Cloud Plus",+ "status": "draft",+ "status_transitions": {+ "finalized_at": null,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 72000,+ "subtotal_excluding_tax": 72000,+ "tax": null,+ "test_clock": null,+ "total": 72000,+ "total_discount_amounts": [],+ "total_excluding_tax": 72000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": 1000000000+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Invoice.finalize_invoice.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Invoice.finalize_invoice.1.jsonnew file mode 100644index 00000000000..1cf10271d84--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Invoice.finalize_invoice.1.json@@ -0,0 +1,170 @@+{+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 72000,+ "amount_paid": 0,+ "amount_remaining": 72000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": false,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDV4ZzlZR2I5dXhCa3dweGhJYkMxbk5wcUxBUm16LDEwNDA1MjEyNQ02004QD3cwbG?s=ap",+ "id": "in_NORMALIZED00000000000001",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDV4ZzlZR2I5dXhCa3dweGhJYkMxbk5wcUxBUm16LDEwNDA1MjEyNQ02004QD3cwbG/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 72000,+ "amount_excluding_tax": 72000,+ "currency": "usd",+ "description": "Zulip Cloud Plus",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000001",+ "invoice": "in_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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 6,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "12000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "automatic",+ "licenses": "6",+ "on_free_trial": "False",+ "plan_tier": "2",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": "NORMALI-0002",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "paid_out_of_band": false,+ "payment_intent": "pi_NORMALIZED00000000000001",+ "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 Plus",+ "status": "open",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 72000,+ "subtotal_excluding_tax": 72000,+ "tax": null,+ "test_clock": null,+ "total": 72000,+ "total_discount_amounts": [],+ "total_excluding_tax": 72000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": 1000000000+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Invoice.list.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Invoice.list.1.jsonnew file mode 100644index 00000000000..e39960ab725--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Invoice.list.1.json@@ -0,0 +1,6 @@+{+ "data": [],+ "has_more": false,+ "object": "list",+ "url": "/v1/invoices"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Invoice.list.2.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Invoice.list.2.jsonnew file mode 100644index 00000000000..82fe6554449--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Invoice.list.2.json@@ -0,0 +1,177 @@+{+ "data": [+ {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 72000,+ "amount_paid": 72000,+ "amount_remaining": 0,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 1,+ "attempted": true,+ "auto_advance": false,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": "ch_NORMALIZED00000000000001",+ "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDV4ZzlZR2I5dXhCa3dweGhJYkMxbk5wcUxBUm16LDEwNDA1MjEyOA0200lIK2Zfp2?s=ap",+ "id": "in_NORMALIZED00000000000001",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDV4ZzlZR2I5dXhCa3dweGhJYkMxbk5wcUxBUm16LDEwNDA1MjEyOA0200lIK2Zfp2/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 72000,+ "amount_excluding_tax": 72000,+ "currency": "usd",+ "description": "Zulip Cloud Plus",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000001",+ "invoice": "in_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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 6,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "12000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "automatic",+ "licenses": "6",+ "on_free_trial": "False",+ "plan_tier": "2",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": "NORMALI-0002",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": true,+ "paid_out_of_band": false,+ "payment_intent": "pi_NORMALIZED00000000000001",+ "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 Plus",+ "status": "paid",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": 1000000000,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 72000,+ "subtotal_excluding_tax": 72000,+ "tax": null,+ "test_clock": null,+ "total": 72000,+ "total_discount_amounts": [],+ "total_excluding_tax": 72000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": 1000000000+ }+ ],+ "has_more": false,+ "object": "list",+ "url": "/v1/invoices"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Invoice.pay.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Invoice.pay.1.jsonnew file mode 100644index 00000000000..e17d2d158a4--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--Invoice.pay.1.json@@ -0,0 +1,170 @@+{+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 72000,+ "amount_paid": 72000,+ "amount_remaining": 0,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 1,+ "attempted": true,+ "auto_advance": false,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": "ch_NORMALIZED00000000000001",+ "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDV4ZzlZR2I5dXhCa3dweGhJYkMxbk5wcUxBUm16LDEwNDA1MjEyNg0200zZD8uKVp?s=ap",+ "id": "in_NORMALIZED00000000000001",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDV4ZzlZR2I5dXhCa3dweGhJYkMxbk5wcUxBUm16LDEwNDA1MjEyNg0200zZD8uKVp/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 72000,+ "amount_excluding_tax": 72000,+ "currency": "usd",+ "description": "Zulip Cloud Plus",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000001",+ "invoice": "in_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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 6,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "12000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "automatic",+ "licenses": "6",+ "on_free_trial": "False",+ "plan_tier": "2",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": "NORMALI-0002",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": true,+ "paid_out_of_band": false,+ "payment_intent": "pi_NORMALIZED00000000000001",+ "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 Plus",+ "status": "paid",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": 1000000000,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 72000,+ "subtotal_excluding_tax": 72000,+ "tax": null,+ "test_clock": null,+ "total": 72000,+ "total_discount_amounts": [],+ "total_excluding_tax": 72000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": 1000000000+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--InvoiceItem.create.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--InvoiceItem.create.1.jsonnew file mode 100644index 00000000000..4c560c3a9e1--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--InvoiceItem.create.1.json@@ -0,0 +1,47 @@+{+ "amount": 72000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0001",+ "date": 1000000000,+ "description": "Zulip Cloud Plus",+ "discountable": false,+ "discounts": [],+ "id": "ii_NORMALIZED00000000000001",+ "invoice": null,+ "livemode": false,+ "metadata": {},+ "object": "invoiceitem",+ "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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "quantity": 6,+ "subscription": null,+ "tax_rates": [],+ "test_clock": null,+ "unit_amount": 12000,+ "unit_amount_decimal": "12000"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--PaymentMethod.create.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--PaymentMethod.create.1.jsonnew file mode 100644index 00000000000..c732cd1eb0c--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--PaymentMethod.create.1.json@@ -0,0 +1,49 @@+{+ "allow_redisplay": "unspecified",+ "billing_details": {+ "address": {+ "city": "San Francisco",+ "country": "US",+ "line1": "123 Main St",+ "line2": null,+ "postal_code": "94105",+ "state": "CA"+ },+ "email": null,+ "name": "John Doe",+ "phone": null+ },+ "card": {+ "brand": "visa",+ "checks": {+ "address_line1_check": null,+ "address_postal_code_check": null,+ "cvc_check": "unchecked"+ },+ "country": "US",+ "display_brand": "visa",+ "exp_month": 4,+ "exp_year": 2025,+ "fingerprint": "NORMALIZED000001",+ "funding": "credit",+ "generated_from": null,+ "last4": "4242",+ "networks": {+ "available": [+ "visa"+ ],+ "preferred": null+ },+ "three_d_secure_usage": {+ "supported": true+ },+ "wallet": null+ },+ "created": 1000000000,+ "customer": null,+ "id": "pm_1P7BliDEQaroqDjs3Jap8TxD",+ "livemode": false,+ "metadata": {},+ "object": "payment_method",+ "type": "card"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--SetupIntent.create.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--SetupIntent.create.1.jsonnew file mode 100644index 00000000000..725ef54d8cc--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--SetupIntent.create.1.json@@ -0,0 +1,34 @@+{+ "application": null,+ "automatic_payment_methods": null,+ "cancellation_reason": null,+ "client_secret": "seti_1P7BliDEQaroqDjs2N6zMwd8_secret_Px5xyz9SmQ09NrvOchRmKiMebU5O2tS",+ "created": 1000000000,+ "customer": "cus_NORMALIZED0001",+ "description": null,+ "flow_directions": null,+ "id": "seti_1P7BliDEQaroqDjs2N6zMwd8",+ "last_setup_error": null,+ "latest_attempt": "setatt_1P7BljDEQaroqDjsweLBDSRy",+ "livemode": false,+ "mandate": null,+ "metadata": {},+ "next_action": null,+ "object": "setup_intent",+ "on_behalf_of": null,+ "payment_method": "pm_1P7BliDEQaroqDjs3Jap8TxD",+ "payment_method_configuration_details": null,+ "payment_method_options": {+ "card": {+ "mandate_options": null,+ "network": null,+ "request_three_d_secure": "automatic"+ }+ },+ "payment_method_types": [+ "card"+ ],+ "single_use_mandate": null,+ "status": "succeeded",+ "usage": "off_session"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--SetupIntent.list.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--SetupIntent.list.1.jsonnew file mode 100644index 00000000000..b1d64cca1b6--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--SetupIntent.list.1.json@@ -0,0 +1,41 @@+{+ "data": [+ {+ "application": null,+ "automatic_payment_methods": null,+ "cancellation_reason": null,+ "client_secret": "seti_1P7BlgDEQaroqDjs5mhePlSk_secret_Px5xcRFuQrNPJtdJIMTiTCUl9GVXjcM",+ "created": 1000000000,+ "customer": "cus_NORMALIZED0001",+ "description": null,+ "flow_directions": null,+ "id": "seti_1P7BlgDEQaroqDjs5mhePlSk",+ "last_setup_error": null,+ "latest_attempt": null,+ "livemode": false,+ "mandate": null,+ "metadata": {},+ "next_action": null,+ "object": "setup_intent",+ "on_behalf_of": null,+ "payment_method": null,+ "payment_method_configuration_details": null,+ "payment_method_options": {+ "card": {+ "mandate_options": null,+ "network": null,+ "request_three_d_secure": "automatic"+ }+ },+ "payment_method_types": [+ "card"+ ],+ "single_use_mandate": null,+ "status": "requires_payment_method",+ "usage": "off_session"+ }+ ],+ "has_more": false,+ "object": "list",+ "url": "/v1/setup_intents"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--SetupIntent.retrieve.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--SetupIntent.retrieve.1.jsonnew file mode 100644index 00000000000..725ef54d8cc--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--SetupIntent.retrieve.1.json@@ -0,0 +1,34 @@+{+ "application": null,+ "automatic_payment_methods": null,+ "cancellation_reason": null,+ "client_secret": "seti_1P7BliDEQaroqDjs2N6zMwd8_secret_Px5xyz9SmQ09NrvOchRmKiMebU5O2tS",+ "created": 1000000000,+ "customer": "cus_NORMALIZED0001",+ "description": null,+ "flow_directions": null,+ "id": "seti_1P7BliDEQaroqDjs2N6zMwd8",+ "last_setup_error": null,+ "latest_attempt": "setatt_1P7BljDEQaroqDjsweLBDSRy",+ "livemode": false,+ "mandate": null,+ "metadata": {},+ "next_action": null,+ "object": "setup_intent",+ "on_behalf_of": null,+ "payment_method": "pm_1P7BliDEQaroqDjs3Jap8TxD",+ "payment_method_configuration_details": null,+ "payment_method_options": {+ "card": {+ "mandate_options": null,+ "network": null,+ "request_three_d_secure": "automatic"+ }+ },+ "payment_method_types": [+ "card"+ ],+ "single_use_mandate": null,+ "status": "succeeded",+ "usage": "off_session"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--checkout.Session.create.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--checkout.Session.create.1.jsonnew file mode 100644index 00000000000..d6ba570eaec--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--checkout.Session.create.1.json@@ -0,0 +1,80 @@+{+ "after_expiration": null,+ "allow_promotion_codes": null,+ "amount_subtotal": null,+ "amount_total": null,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_address_collection": "required",+ "cancel_url": "http://zulip.testserver/upgrade/?manual_license_management=false&tier=1",+ "client_reference_id": null,+ "client_secret": null,+ "consent": null,+ "consent_collection": null,+ "created": 1000000000,+ "currency": null,+ "currency_conversion": null,+ "custom_fields": [],+ "custom_text": {+ "after_submit": null,+ "shipping_address": null,+ "submit": null,+ "terms_of_service_acceptance": null+ },+ "customer": "cus_NORMALIZED0001",+ "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": 1000000000,+ "id": "cs_test_NORMALIZED020QRKEMRRAuLcgGB3HSWV29zQqAF7jn0mC54eWNEZILKqPO",+ "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": {+ "card": {+ "request_three_d_secure": "automatic"+ }+ },+ "payment_method_types": [+ "card"+ ],+ "payment_status": "no_payment_required",+ "phone_number_collection": {+ "enabled": false+ },+ "recovered_from": null,+ "saved_payment_method_options": null,+ "setup_intent": "seti_1P7BlgDEQaroqDjs5mhePlSk",+ "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_NORMALIZED020QRKEMRRAuLcgGB3HSWV29zQqAF7jn0mC54eWNEZILKqPO#fid1d2BpamRhQ2prcSc%2FJ1ZqcHdmYCVWZGt2JVV3aicpJ2R1bE5gfCc%2FJ3VuWnFgdnFaXVRmMU5zNkldQTY9SnNRY09XZml2UXNQJyknY3dqaFZgd3Ngdyc%2FcXdwYCknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpmamlwaGsnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--checkout.Session.list.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--checkout.Session.list.1.jsonnew file mode 100644index 00000000000..3c59c5cea1e--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_to_plus_plan--checkout.Session.list.1.json@@ -0,0 +1,87 @@+{+ "data": [+ {+ "after_expiration": null,+ "allow_promotion_codes": null,+ "amount_subtotal": null,+ "amount_total": null,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_address_collection": "required",+ "cancel_url": "http://zulip.testserver/upgrade/?manual_license_management=false&tier=1",+ "client_reference_id": null,+ "client_secret": null,+ "consent": null,+ "consent_collection": null,+ "created": 1000000000,+ "currency": null,+ "currency_conversion": null,+ "custom_fields": [],+ "custom_text": {+ "after_submit": null,+ "shipping_address": null,+ "submit": null,+ "terms_of_service_acceptance": null+ },+ "customer": "cus_NORMALIZED0001",+ "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": 1000000000,+ "id": "cs_test_NORMALIZED020QRKEMRRAuLcgGB3HSWV29zQqAF7jn0mC54eWNEZILKqPO",+ "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": {+ "card": {+ "request_three_d_secure": "automatic"+ }+ },+ "payment_method_types": [+ "card"+ ],+ "payment_status": "no_payment_required",+ "phone_number_collection": {+ "enabled": false+ },+ "recovered_from": null,+ "saved_payment_method_options": null,+ "setup_intent": "seti_1P7BlgDEQaroqDjs5mhePlSk",+ "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_NORMALIZED020QRKEMRRAuLcgGB3HSWV29zQqAF7jn0mC54eWNEZILKqPO#fid1d2BpamRhQ2prcSc%2FJ1ZqcHdmYCVWZGt2JVV3aicpJ2R1bE5gfCc%2FJ3VuWnFgdnFaXVRmMU5zNkldQTY9SnNRY09XZml2UXNQJyknY3dqaFZgd3Ngdyc%2FcXdwYCknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpmamlwaGsnKSdga2RnaWBVaWRmYG1qaWFgd3YnP3F3cGB4JSUl"+ }+ ],+ "has_more": false,+ "object": "list",+ "url": "/v1/checkout/sessions"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Event.list.7.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Event.list.7.jsonnew file mode 100644index 00000000000..6d922067afe--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Event.list.7.json@@ -0,0 +1,6 @@+{+ "data": [],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Charge.list.1.json b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Charge.list.1.jsonnew file mode 100644index 00000000000..75910611cf3--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Charge.list.1.json@@ -0,0 +1,6 @@+{+ "data": [],+ "has_more": false,+ "object": "list",+ "url": "/v1/charges"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Customer.create.1.json b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Customer.create.1.jsonnew file mode 100644index 00000000000..593a07ed0c8--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Customer.create.1.json@@ -0,0 +1,33 @@+{+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": null,+ "default_currency": null,+ "default_source": null,+ "delinquent": false,+ "description": "zulip (Zulip Dev)",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0001",+ "invoice_prefix": "NORMA01",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": null,+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "realm_id": "1",+ "realm_str": "zulip"+ },+ "name": null,+ "next_invoice_sequence": 1,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Customer.retrieve.1.json b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Customer.retrieve.1.jsonnew file mode 100644index 00000000000..593a07ed0c8--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Customer.retrieve.1.json@@ -0,0 +1,33 @@+{+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": null,+ "default_currency": null,+ "default_source": null,+ "delinquent": false,+ "description": "zulip (Zulip Dev)",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0001",+ "invoice_prefix": "NORMA01",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": null,+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "realm_id": "1",+ "realm_str": "zulip"+ },+ "name": null,+ "next_invoice_sequence": 1,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Customer.retrieve.2.json b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Customer.retrieve.2.jsonnew file mode 100644index 00000000000..f7874afc7c8--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Customer.retrieve.2.json@@ -0,0 +1,33 @@+{+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": "usd",+ "default_currency": "usd",+ "default_source": "src_NORMALIZED00000000000001",+ "delinquent": false,+ "description": "zulip (Zulip Dev)",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0001",+ "invoice_prefix": "NORMA01",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": null,+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "realm_id": "1",+ "realm_str": "zulip"+ },+ "name": null,+ "next_invoice_sequence": 2,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Customer.retrieve.3.json b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Customer.retrieve.3.jsonnew file mode 100644index 00000000000..f7874afc7c8--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Customer.retrieve.3.json@@ -0,0 +1,33 @@+{+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": "usd",+ "default_currency": "usd",+ "default_source": "src_NORMALIZED00000000000001",+ "delinquent": false,+ "description": "zulip (Zulip Dev)",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0001",+ "invoice_prefix": "NORMA01",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": null,+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "realm_id": "1",+ "realm_str": "zulip"+ },+ "name": null,+ "next_invoice_sequence": 2,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Event.list.1.json b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Event.list.1.jsonnew file mode 100644index 00000000000..0dbc5a72167--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Event.list.1.json@@ -0,0 +1,192 @@+{+ "data": [+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 1476000,+ "amount_paid": 0,+ "amount_remaining": 1476000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": false,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "send_invoice",+ "created": 1000000000,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0002",+ "customer_address": null,+ "customer_email": "[email protected]",+ "customer_name": null,+ "customer_phone": null,+ "customer_shipping": null,+ "customer_tax_exempt": "none",+ "customer_tax_ids": [],+ "default_payment_method": null,+ "default_source": null,+ "default_tax_rates": [],+ "description": null,+ "discount": null,+ "discounts": [],+ "due_date": 1000000000,+ "effective_at": 1000000000,+ "ending_balance": 0,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDYweFZORWNwYnE5UmJEcllKTTlYczlJM0EwOVBMLDEwNDA1MjI5OA0200DF9dxD3s?s=ap",+ "id": "in_NORMALIZED00000000000001",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDYweFZORWNwYnE5UmJEcllKTTlYczlJM0EwOVBMLDEwNDA1MjI5OA0200DF9dxD3s/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 1476000,+ "amount_excluding_tax": 1476000,+ "currency": "usd",+ "description": "Zulip Cloud Plus",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000001",+ "invoice": "in_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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 123,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "12000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "manual",+ "licenses": "123",+ "on_free_trial": "False",+ "plan_tier": "2",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": "NORMALI-0001",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": true,+ "paid_out_of_band": true,+ "payment_intent": null,+ "payment_settings": {+ "default_mandate": null,+ "payment_method_options": null,+ "payment_method_types": null+ },+ "period_end": 1000000000,+ "period_start": 1000000000,+ "post_payment_credit_notes_amount": 0,+ "pre_payment_credit_notes_amount": 0,+ "quote": null,+ "receipt_number": null,+ "rendering": {+ "amount_tax_display": null,+ "pdf": {+ "page_size": "letter"+ }+ },+ "rendering_options": null,+ "shipping_cost": null,+ "shipping_details": null,+ "starting_balance": 0,+ "statement_descriptor": "Zulip Cloud Plus",+ "status": "paid",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": 1000000000,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 1476000,+ "subtotal_excluding_tax": 1476000,+ "tax": null,+ "test_clock": null,+ "total": 1476000,+ "total_discount_amounts": [],+ "total_excluding_tax": 1476000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": 1000000000+ }+ },+ "id": "evt_1P7BocDEQaroqDjsO46512U5",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0001",+ "idempotency_key": "d3f3e045-28a6-4a87-a20e-bc0a0a22570f"+ },+ "type": "invoice.paid"+ }+ ],+ "has_more": true,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Event.list.2.json b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Event.list.2.jsonnew file mode 100644index 00000000000..c615c66c17c--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Event.list.2.json@@ -0,0 +1,1017 @@+{+ "data": [+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "amount": 1476000,+ "amount_capturable": 0,+ "amount_details": {+ "tip": {}+ },+ "amount_received": 0,+ "application": null,+ "application_fee_amount": null,+ "automatic_payment_methods": null,+ "canceled_at": 1000000000,+ "cancellation_reason": "requested_by_customer",+ "capture_method": "automatic",+ "charges": {+ "data": [],+ "has_more": false,+ "object": "list",+ "total_count": 0,+ "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000001"+ },+ "client_secret": "pi_NORMALIZED00000000000001_secret_XSpNn2YpCOqFN0wmev6Lkwu3A",+ "confirmation_method": "automatic",+ "created": 1000000000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0001",+ "description": "Payment for Invoice",+ "id": "pi_NORMALIZED00000000000001",+ "invoice": "in_NORMALIZED00000000000002",+ "last_payment_error": null,+ "latest_charge": null,+ "livemode": false,+ "metadata": {},+ "next_action": null,+ "object": "payment_intent",+ "on_behalf_of": null,+ "payment_method": null,+ "payment_method_configuration_details": null,+ "payment_method_options": {+ "card": {+ "installments": null,+ "mandate_options": null,+ "network": null,+ "request_three_d_secure": "automatic"+ },+ "cashapp": {},+ "wechat_pay": {+ "app_id": null,+ "client": null+ }+ },+ "payment_method_types": [+ "ach_credit_transfer",+ "card",+ "cashapp",+ "wechat_pay"+ ],+ "processing": null,+ "receipt_email": "[email protected]",+ "review": null,+ "setup_future_usage": null,+ "shipping": null,+ "source": null,+ "statement_descriptor": "Zulip Cloud Plus",+ "statement_descriptor_suffix": null,+ "status": "canceled",+ "transfer_data": null,+ "transfer_group": null+ }+ },+ "id": "evt_3P7BozDEQaroqDjs0mKJ7AGw",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0002",+ "idempotency_key": "8dae7bd5-c87f-4c66-a60c-fb56657e363b"+ },+ "type": "payment_intent.canceled"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "ach_credit_transfer": {+ "account_number": "test_NORMALIZED02",+ "bank_name": "TEST BANK",+ "fingerprint": "NORMALIZED000001",+ "refund_account_holder_name": null,+ "refund_account_holder_type": null,+ "refund_routing_number": null,+ "routing_number": "110000000",+ "swift_code": "TSTEZ122"+ },+ "amount": null,+ "client_secret": "src_client_secret_NORMALIZED00000000000001",+ "created": 1000000000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0001",+ "flow": "receiver",+ "id": "src_NORMALIZED00000000000001",+ "livemode": false,+ "metadata": {},+ "object": "source",+ "owner": {+ "address": null,+ "email": "[email protected]",+ "name": null,+ "phone": null,+ "verified_address": null,+ "verified_email": null,+ "verified_name": null,+ "verified_phone": null+ },+ "receiver": {+ "address": "000000000-test_NORMALIZED01",+ "amount_charged": 0,+ "amount_received": 0,+ "amount_returned": 0,+ "refund_attributes_method": "email",+ "refund_attributes_status": "missing"+ },+ "statement_descriptor": null,+ "status": "pending",+ "type": "ach_credit_transfer",+ "usage": "reusable"+ }+ },+ "id": "evt_1P7Bp1DEQaroqDjsGA3v9sfI",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": null,+ "idempotency_key": "3c26970e-4510-49db-b3a7-dbff8a9e1297"+ },+ "type": "customer.source.created"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": "usd",+ "default_currency": "usd",+ "default_source": "src_NORMALIZED00000000000001",+ "delinquent": false,+ "description": "zulip (Zulip Dev)",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0001",+ "invoice_prefix": "NORMA01",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": null,+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "realm_id": "1",+ "realm_str": "zulip"+ },+ "name": null,+ "next_invoice_sequence": 2,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+ },+ "previous_attributes": {+ "default_source": null+ }+ },+ "id": "evt_1P7Bp1DEQaroqDjsWFtVk1ar",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": null,+ "idempotency_key": "3c26970e-4510-49db-b3a7-dbff8a9e1297"+ },+ "type": "customer.updated"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 1476000,+ "amount_paid": 0,+ "amount_remaining": 1476000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": true,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "send_invoice",+ "created": 1000000000,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0001",+ "customer_address": null,+ "customer_email": "[email protected]",+ "customer_name": null,+ "customer_phone": null,+ "customer_shipping": null,+ "customer_tax_exempt": "none",+ "customer_tax_ids": [],+ "default_payment_method": null,+ "default_source": null,+ "default_tax_rates": [],+ "description": null,+ "discount": null,+ "discounts": [],+ "due_date": 1000000000,+ "effective_at": 1000000000,+ "ending_balance": 0,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDYxTjVhRWVFR0Z1ckFhTDNkWEZlRUVWRk0xckR0LDEwNDA1MjMyMg02001lku8xTt?s=ap",+ "id": "in_NORMALIZED00000000000002",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDYxTjVhRWVFR0Z1ckFhTDNkWEZlRUVWRk0xckR0LDEwNDA1MjMyMg02001lku8xTt/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 1476000,+ "amount_excluding_tax": 1476000,+ "currency": "usd",+ "description": "Zulip Cloud Plus",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000002",+ "invoice": "in_NORMALIZED00000000000002",+ "invoice_item": "ii_NORMALIZED00000000000002",+ "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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 123,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "12000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "manual",+ "licenses": "123",+ "on_free_trial": "False",+ "plan_tier": "2",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": "NORMALI-0002",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "paid_out_of_band": false,+ "payment_intent": "pi_NORMALIZED00000000000001",+ "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 Plus",+ "status": "open",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 1476000,+ "subtotal_excluding_tax": 1476000,+ "tax": null,+ "test_clock": null,+ "total": 1476000,+ "total_discount_amounts": [],+ "total_excluding_tax": 1476000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": 1000000000+ }+ },+ "id": "evt_1P7Bp0DEQaroqDjsoh4ONxZG",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0003",+ "idempotency_key": "2ea07c84-3d5e-48fa-9468-199ef1ec7499"+ },+ "type": "invoice.finalized"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 1476000,+ "amount_paid": 0,+ "amount_remaining": 1476000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": true,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "send_invoice",+ "created": 1000000000,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0001",+ "customer_address": null,+ "customer_email": "[email protected]",+ "customer_name": null,+ "customer_phone": null,+ "customer_shipping": null,+ "customer_tax_exempt": "none",+ "customer_tax_ids": [],+ "default_payment_method": null,+ "default_source": null,+ "default_tax_rates": [],+ "description": null,+ "discount": null,+ "discounts": [],+ "due_date": 1000000000,+ "effective_at": 1000000000,+ "ending_balance": 0,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDYxTjVhRWVFR0Z1ckFhTDNkWEZlRUVWRk0xckR0LDEwNDA1MjMyMg02001lku8xTt?s=ap",+ "id": "in_NORMALIZED00000000000002",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDYxTjVhRWVFR0Z1ckFhTDNkWEZlRUVWRk0xckR0LDEwNDA1MjMyMg02001lku8xTt/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 1476000,+ "amount_excluding_tax": 1476000,+ "currency": "usd",+ "description": "Zulip Cloud Plus",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000002",+ "invoice": "in_NORMALIZED00000000000002",+ "invoice_item": "ii_NORMALIZED00000000000002",+ "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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 123,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "12000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "manual",+ "licenses": "123",+ "on_free_trial": "False",+ "plan_tier": "2",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": "NORMALI-0002",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "paid_out_of_band": false,+ "payment_intent": "pi_NORMALIZED00000000000001",+ "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 Plus",+ "status": "open",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 1476000,+ "subtotal_excluding_tax": 1476000,+ "tax": null,+ "test_clock": null,+ "total": 1476000,+ "total_discount_amounts": [],+ "total_excluding_tax": 1476000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": 1000000000+ },+ "previous_attributes": {+ "effective_at": null,+ "ending_balance": null,+ "hosted_invoice_url": null,+ "invoice_pdf": null,+ "number": null,+ "payment_intent": null,+ "rendering": {+ "pdf": {+ "page_size": "auto"+ }+ },+ "status": "draft",+ "status_transitions": {+ "finalized_at": null+ }+ }+ },+ "id": "evt_1P7Bp0DEQaroqDjsg9PKeE6w",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0003",+ "idempotency_key": "2ea07c84-3d5e-48fa-9468-199ef1ec7499"+ },+ "type": "invoice.updated"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "amount": 1476000,+ "amount_capturable": 0,+ "amount_details": {+ "tip": {}+ },+ "amount_received": 0,+ "application": null,+ "application_fee_amount": null,+ "automatic_payment_methods": null,+ "canceled_at": null,+ "cancellation_reason": null,+ "capture_method": "automatic",+ "charges": {+ "data": [],+ "has_more": false,+ "object": "list",+ "total_count": 0,+ "url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000001"+ },+ "client_secret": "pi_NORMALIZED00000000000001_secret_XSpNn2YpCOqFN0wmev6Lkwu3A",+ "confirmation_method": "automatic",+ "created": 1000000000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0001",+ "description": "Payment for Invoice",+ "id": "pi_NORMALIZED00000000000001",+ "invoice": "in_NORMALIZED00000000000002",+ "last_payment_error": null,+ "latest_charge": null,+ "livemode": false,+ "metadata": {},+ "next_action": null,+ "object": "payment_intent",+ "on_behalf_of": null,+ "payment_method": null,+ "payment_method_configuration_details": null,+ "payment_method_options": {+ "card": {+ "installments": null,+ "mandate_options": null,+ "network": null,+ "request_three_d_secure": "automatic"+ },+ "cashapp": {},+ "wechat_pay": {+ "app_id": null,+ "client": null+ }+ },+ "payment_method_types": [+ "ach_credit_transfer",+ "card",+ "cashapp",+ "wechat_pay"+ ],+ "processing": null,+ "receipt_email": "[email protected]",+ "review": null,+ "setup_future_usage": null,+ "shipping": null,+ "source": null,+ "statement_descriptor": "Zulip Cloud Plus",+ "statement_descriptor_suffix": null,+ "status": "requires_payment_method",+ "transfer_data": null,+ "transfer_group": null+ }+ },+ "id": "evt_3P7BozDEQaroqDjs0uKU2UaW",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0003",+ "idempotency_key": "2ea07c84-3d5e-48fa-9468-199ef1ec7499"+ },+ "type": "payment_intent.created"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 1476000,+ "amount_paid": 0,+ "amount_remaining": 1476000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": true,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "send_invoice",+ "created": 1000000000,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0001",+ "customer_address": null,+ "customer_email": "[email protected]",+ "customer_name": null,+ "customer_phone": null,+ "customer_shipping": null,+ "customer_tax_exempt": "none",+ "customer_tax_ids": [],+ "default_payment_method": null,+ "default_source": null,+ "default_tax_rates": [],+ "description": null,+ "discount": null,+ "discounts": [],+ "due_date": 1000000000,+ "effective_at": null,+ "ending_balance": null,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": null,+ "id": "in_NORMALIZED00000000000002",+ "invoice_pdf": null,+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 1476000,+ "amount_excluding_tax": 1476000,+ "currency": "usd",+ "description": "Zulip Cloud Plus",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000002",+ "invoice": "in_NORMALIZED00000000000002",+ "invoice_item": "ii_NORMALIZED00000000000002",+ "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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 123,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "12000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "manual",+ "licenses": "123",+ "on_free_trial": "False",+ "plan_tier": "2",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": null,+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "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": "auto"+ }+ },+ "rendering_options": null,+ "shipping_cost": null,+ "shipping_details": null,+ "starting_balance": 0,+ "statement_descriptor": "Zulip Cloud Plus",+ "status": "draft",+ "status_transitions": {+ "finalized_at": null,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 1476000,+ "subtotal_excluding_tax": 1476000,+ "tax": null,+ "test_clock": null,+ "total": 1476000,+ "total_discount_amounts": [],+ "total_excluding_tax": 1476000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": 1000000000+ }+ },+ "id": "evt_1P7BozDEQaroqDjsG3eUjT9T",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0004",+ "idempotency_key": "6bf8f804-9d47-442c-a5b3-6fbd11228712"+ },+ "type": "invoice.created"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "amount": 1476000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0001",+ "date": 1000000000,+ "description": "Zulip Cloud Plus",+ "discountable": false,+ "discounts": [],+ "id": "ii_NORMALIZED00000000000002",+ "invoice": null,+ "livemode": false,+ "metadata": {},+ "object": "invoiceitem",+ "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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "quantity": 123,+ "subscription": null,+ "tax_rates": [],+ "test_clock": null,+ "unit_amount": 12000,+ "unit_amount_decimal": "12000"+ }+ },+ "id": "evt_1P7BoyDEQaroqDjsu3Pu1tIW",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0005",+ "idempotency_key": "e781034f-3187-4f89-bd6e-825c4a38662e"+ },+ "type": "invoiceitem.created"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": "usd",+ "default_currency": "usd",+ "default_source": null,+ "delinquent": false,+ "description": "zulip (Zulip Dev)",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0001",+ "invoice_prefix": "NORMA01",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": null,+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "realm_id": "1",+ "realm_str": "zulip"+ },+ "name": null,+ "next_invoice_sequence": 1,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+ },+ "previous_attributes": {+ "currency": null,+ "default_currency": null+ }+ },+ "id": "evt_1P7BoyDEQaroqDjsTd2ZXfm5",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0005",+ "idempotency_key": "e781034f-3187-4f89-bd6e-825c4a38662e"+ },+ "type": "customer.updated"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "address": null,+ "balance": 0,+ "created": 1000000000,+ "currency": null,+ "default_currency": null,+ "default_source": null,+ "delinquent": false,+ "description": "zulip (Zulip Dev)",+ "discount": null,+ "email": "[email protected]",+ "id": "cus_NORMALIZED0001",+ "invoice_prefix": "NORMA01",+ "invoice_settings": {+ "custom_fields": null,+ "default_payment_method": null,+ "footer": null,+ "rendering_options": null+ },+ "livemode": false,+ "metadata": {+ "realm_id": "1",+ "realm_str": "zulip"+ },+ "name": null,+ "next_invoice_sequence": 1,+ "object": "customer",+ "phone": null,+ "preferred_locales": [],+ "shipping": null,+ "tax_exempt": "none",+ "test_clock": null+ }+ },+ "id": "evt_1P7BoxDEQaroqDjsyPRJD2xd",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0006",+ "idempotency_key": "01f86e45-e346-4067-a1aa-bec18316d353"+ },+ "type": "customer.created"+ }+ ],+ "has_more": true,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Event.list.3.json b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Event.list.3.jsonnew file mode 100644index 00000000000..baa06e825b5--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Event.list.3.json@@ -0,0 +1,387 @@+{+ "data": [+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 1476000,+ "amount_paid": 0,+ "amount_remaining": 1476000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": false,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "send_invoice",+ "created": 1000000000,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0001",+ "customer_address": null,+ "customer_email": "[email protected]",+ "customer_name": null,+ "customer_phone": null,+ "customer_shipping": null,+ "customer_tax_exempt": "none",+ "customer_tax_ids": [],+ "default_payment_method": null,+ "default_source": null,+ "default_tax_rates": [],+ "description": null,+ "discount": null,+ "discounts": [],+ "due_date": 1000000000,+ "effective_at": 1000000000,+ "ending_balance": 0,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDYxTjVhRWVFR0Z1ckFhTDNkWEZlRUVWRk0xckR0LDEwNDA1MjMyNA0200HsPIWfHN?s=ap",+ "id": "in_NORMALIZED00000000000002",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDYxTjVhRWVFR0Z1ckFhTDNkWEZlRUVWRk0xckR0LDEwNDA1MjMyNA0200HsPIWfHN/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 1476000,+ "amount_excluding_tax": 1476000,+ "currency": "usd",+ "description": "Zulip Cloud Plus",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000002",+ "invoice": "in_NORMALIZED00000000000002",+ "invoice_item": "ii_NORMALIZED00000000000002",+ "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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 123,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "12000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "manual",+ "licenses": "123",+ "on_free_trial": "False",+ "plan_tier": "2",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": "NORMALI-0003",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": true,+ "paid_out_of_band": true,+ "payment_intent": null,+ "payment_settings": {+ "default_mandate": null,+ "payment_method_options": null,+ "payment_method_types": null+ },+ "period_end": 1000000000,+ "period_start": 1000000000,+ "post_payment_credit_notes_amount": 0,+ "pre_payment_credit_notes_amount": 0,+ "quote": null,+ "receipt_number": null,+ "rendering": {+ "amount_tax_display": null,+ "pdf": {+ "page_size": "letter"+ }+ },+ "rendering_options": null,+ "shipping_cost": null,+ "shipping_details": null,+ "starting_balance": 0,+ "statement_descriptor": "Zulip Cloud Plus",+ "status": "paid",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": 1000000000,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 1476000,+ "subtotal_excluding_tax": 1476000,+ "tax": null,+ "test_clock": null,+ "total": 1476000,+ "total_discount_amounts": [],+ "total_excluding_tax": 1476000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": 1000000000+ }+ },+ "id": "evt_1P7Bp2DEQaroqDjsu6PaTvgn",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0002",+ "idempotency_key": "8dae7bd5-c87f-4c66-a60c-fb56657e363b"+ },+ "type": "invoice.paid"+ },+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 1476000,+ "amount_paid": 0,+ "amount_remaining": 1476000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": false,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "send_invoice",+ "created": 1000000000,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0001",+ "customer_address": null,+ "customer_email": "[email protected]",+ "customer_name": null,+ "customer_phone": null,+ "customer_shipping": null,+ "customer_tax_exempt": "none",+ "customer_tax_ids": [],+ "default_payment_method": null,+ "default_source": null,+ "default_tax_rates": [],+ "description": null,+ "discount": null,+ "discounts": [],+ "due_date": 1000000000,+ "effective_at": 1000000000,+ "ending_balance": 0,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDYxTjVhRWVFR0Z1ckFhTDNkWEZlRUVWRk0xckR0LDEwNDA1MjMyNA0200HsPIWfHN?s=ap",+ "id": "in_NORMALIZED00000000000002",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDYxTjVhRWVFR0Z1ckFhTDNkWEZlRUVWRk0xckR0LDEwNDA1MjMyNA0200HsPIWfHN/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 1476000,+ "amount_excluding_tax": 1476000,+ "currency": "usd",+ "description": "Zulip Cloud Plus",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000002",+ "invoice": "in_NORMALIZED00000000000002",+ "invoice_item": "ii_NORMALIZED00000000000002",+ "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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 123,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "12000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "manual",+ "licenses": "123",+ "on_free_trial": "False",+ "plan_tier": "2",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": "NORMALI-0003",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": true,+ "paid_out_of_band": true,+ "payment_intent": null,+ "payment_settings": {+ "default_mandate": null,+ "payment_method_options": null,+ "payment_method_types": null+ },+ "period_end": 1000000000,+ "period_start": 1000000000,+ "post_payment_credit_notes_amount": 0,+ "pre_payment_credit_notes_amount": 0,+ "quote": null,+ "receipt_number": null,+ "rendering": {+ "amount_tax_display": null,+ "pdf": {+ "page_size": "letter"+ }+ },+ "rendering_options": null,+ "shipping_cost": null,+ "shipping_details": null,+ "starting_balance": 0,+ "statement_descriptor": "Zulip Cloud Plus",+ "status": "paid",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": 1000000000,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 1476000,+ "subtotal_excluding_tax": 1476000,+ "tax": null,+ "test_clock": null,+ "total": 1476000,+ "total_discount_amounts": [],+ "total_excluding_tax": 1476000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": 1000000000+ },+ "previous_attributes": {+ "auto_advance": true,+ "paid": false,+ "paid_out_of_band": false,+ "payment_intent": "pi_NORMALIZED00000000000001",+ "status": "open",+ "status_transitions": {+ "paid_at": null+ }+ }+ },+ "id": "evt_1P7Bp2DEQaroqDjsarjCNyjJ",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0002",+ "idempotency_key": "8dae7bd5-c87f-4c66-a60c-fb56657e363b"+ },+ "type": "invoice.updated"+ }+ ],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Event.list.4.json b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Event.list.4.jsonnew file mode 100644index 00000000000..6d922067afe--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Event.list.4.json@@ -0,0 +1,6 @@+{+ "data": [],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Invoice.create.1.json b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Invoice.create.1.jsonnew file mode 100644index 00000000000..dc1da1da209--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Invoice.create.1.json@@ -0,0 +1,170 @@+{+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 1476000,+ "amount_paid": 0,+ "amount_remaining": 1476000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": true,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "send_invoice",+ "created": 1000000000,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0001",+ "customer_address": null,+ "customer_email": "[email protected]",+ "customer_name": null,+ "customer_phone": null,+ "customer_shipping": null,+ "customer_tax_exempt": "none",+ "customer_tax_ids": [],+ "default_payment_method": null,+ "default_source": null,+ "default_tax_rates": [],+ "description": null,+ "discount": null,+ "discounts": [],+ "due_date": 1000000000,+ "effective_at": null,+ "ending_balance": null,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": null,+ "id": "in_NORMALIZED00000000000002",+ "invoice_pdf": null,+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 1476000,+ "amount_excluding_tax": 1476000,+ "currency": "usd",+ "description": "Zulip Cloud Plus",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000002",+ "invoice": "in_NORMALIZED00000000000002",+ "invoice_item": "ii_NORMALIZED00000000000002",+ "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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 123,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "12000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "manual",+ "licenses": "123",+ "on_free_trial": "False",+ "plan_tier": "2",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": null,+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "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": "auto"+ }+ },+ "rendering_options": null,+ "shipping_cost": null,+ "shipping_details": null,+ "starting_balance": 0,+ "statement_descriptor": "Zulip Cloud Plus",+ "status": "draft",+ "status_transitions": {+ "finalized_at": null,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 1476000,+ "subtotal_excluding_tax": 1476000,+ "tax": null,+ "test_clock": null,+ "total": 1476000,+ "total_discount_amounts": [],+ "total_excluding_tax": 1476000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": 1000000000+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Invoice.finalize_invoice.1.json b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Invoice.finalize_invoice.1.jsonnew file mode 100644index 00000000000..b339edace4c--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Invoice.finalize_invoice.1.json@@ -0,0 +1,170 @@+{+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 1476000,+ "amount_paid": 0,+ "amount_remaining": 1476000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": true,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "send_invoice",+ "created": 1000000000,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0001",+ "customer_address": null,+ "customer_email": "[email protected]",+ "customer_name": null,+ "customer_phone": null,+ "customer_shipping": null,+ "customer_tax_exempt": "none",+ "customer_tax_ids": [],+ "default_payment_method": null,+ "default_source": null,+ "default_tax_rates": [],+ "description": null,+ "discount": null,+ "discounts": [],+ "due_date": 1000000000,+ "effective_at": 1000000000,+ "ending_balance": 0,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDYxTjVhRWVFR0Z1ckFhTDNkWEZlRUVWRk0xckR0LDEwNDA1MjMyMg02001lku8xTt?s=ap",+ "id": "in_NORMALIZED00000000000002",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDYxTjVhRWVFR0Z1ckFhTDNkWEZlRUVWRk0xckR0LDEwNDA1MjMyMg02001lku8xTt/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 1476000,+ "amount_excluding_tax": 1476000,+ "currency": "usd",+ "description": "Zulip Cloud Plus",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000002",+ "invoice": "in_NORMALIZED00000000000002",+ "invoice_item": "ii_NORMALIZED00000000000002",+ "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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 123,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "12000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "manual",+ "licenses": "123",+ "on_free_trial": "False",+ "plan_tier": "2",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": "NORMALI-0003",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": false,+ "paid_out_of_band": false,+ "payment_intent": "pi_NORMALIZED00000000000001",+ "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 Plus",+ "status": "open",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": null,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 1476000,+ "subtotal_excluding_tax": 1476000,+ "tax": null,+ "test_clock": null,+ "total": 1476000,+ "total_discount_amounts": [],+ "total_excluding_tax": 1476000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": 1000000000+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Invoice.list.1.json b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Invoice.list.1.jsonnew file mode 100644index 00000000000..b4193648daf--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Invoice.list.1.json@@ -0,0 +1,177 @@+{+ "data": [+ {+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 1476000,+ "amount_paid": 0,+ "amount_remaining": 1476000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": false,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "send_invoice",+ "created": 1000000000,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0001",+ "customer_address": null,+ "customer_email": "[email protected]",+ "customer_name": null,+ "customer_phone": null,+ "customer_shipping": null,+ "customer_tax_exempt": "none",+ "customer_tax_ids": [],+ "default_payment_method": null,+ "default_source": null,+ "default_tax_rates": [],+ "description": null,+ "discount": null,+ "discounts": [],+ "due_date": 1000000000,+ "effective_at": 1000000000,+ "ending_balance": 0,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDYxTjVhRWVFR0Z1ckFhTDNkWEZlRUVWRk0xckR0LDEwNDA1MjMyNg0200RnOBVG5b?s=ap",+ "id": "in_NORMALIZED00000000000002",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDYxTjVhRWVFR0Z1ckFhTDNkWEZlRUVWRk0xckR0LDEwNDA1MjMyNg0200RnOBVG5b/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 1476000,+ "amount_excluding_tax": 1476000,+ "currency": "usd",+ "description": "Zulip Cloud Plus",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000002",+ "invoice": "in_NORMALIZED00000000000002",+ "invoice_item": "ii_NORMALIZED00000000000002",+ "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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 123,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "12000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "manual",+ "licenses": "123",+ "on_free_trial": "False",+ "plan_tier": "2",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": "NORMALI-0003",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": true,+ "paid_out_of_band": true,+ "payment_intent": null,+ "payment_settings": {+ "default_mandate": null,+ "payment_method_options": null,+ "payment_method_types": null+ },+ "period_end": 1000000000,+ "period_start": 1000000000,+ "post_payment_credit_notes_amount": 0,+ "pre_payment_credit_notes_amount": 0,+ "quote": null,+ "receipt_number": null,+ "rendering": {+ "amount_tax_display": null,+ "pdf": {+ "page_size": "letter"+ }+ },+ "rendering_options": null,+ "shipping_cost": null,+ "shipping_details": null,+ "starting_balance": 0,+ "statement_descriptor": "Zulip Cloud Plus",+ "status": "paid",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": 1000000000,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 1476000,+ "subtotal_excluding_tax": 1476000,+ "tax": null,+ "test_clock": null,+ "total": 1476000,+ "total_discount_amounts": [],+ "total_excluding_tax": 1476000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": 1000000000+ }+ ],+ "has_more": false,+ "object": "list",+ "url": "/v1/invoices"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Invoice.pay.1.json b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Invoice.pay.1.jsonnew file mode 100644index 00000000000..5456a81b2c1--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--Invoice.pay.1.json@@ -0,0 +1,170 @@+{+ "account_country": "US",+ "account_name": "Kandra Labs, Inc.",+ "account_tax_ids": null,+ "amount_due": 1476000,+ "amount_paid": 0,+ "amount_remaining": 1476000,+ "amount_shipping": 0,+ "application": null,+ "application_fee_amount": null,+ "attempt_count": 0,+ "attempted": false,+ "auto_advance": false,+ "automatic_tax": {+ "enabled": false,+ "liability": null,+ "status": null+ },+ "billing_reason": "manual",+ "charge": null,+ "collection_method": "send_invoice",+ "created": 1000000000,+ "currency": "usd",+ "custom_fields": null,+ "customer": "cus_NORMALIZED0001",+ "customer_address": null,+ "customer_email": "[email protected]",+ "customer_name": null,+ "customer_phone": null,+ "customer_shipping": null,+ "customer_tax_exempt": "none",+ "customer_tax_ids": [],+ "default_payment_method": null,+ "default_source": null,+ "default_tax_rates": [],+ "description": null,+ "discount": null,+ "discounts": [],+ "due_date": 1000000000,+ "effective_at": 1000000000,+ "ending_balance": 0,+ "footer": null,+ "from_invoice": null,+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDYxTjVhRWVFR0Z1ckFhTDNkWEZlRUVWRk0xckR0LDEwNDA1MjMyNA0200HsPIWfHN?s=ap",+ "id": "in_NORMALIZED00000000000002",+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QeDYxTjVhRWVFR0Z1ckFhTDNkWEZlRUVWRk0xckR0LDEwNDA1MjMyNA0200HsPIWfHN/pdf?s=ap",+ "issuer": {+ "type": "self"+ },+ "last_finalization_error": null,+ "latest_revision": null,+ "lines": {+ "data": [+ {+ "amount": 1476000,+ "amount_excluding_tax": 1476000,+ "currency": "usd",+ "description": "Zulip Cloud Plus",+ "discount_amounts": [],+ "discountable": false,+ "discounts": [],+ "id": "il_NORMALIZED00000000000002",+ "invoice": "in_NORMALIZED00000000000002",+ "invoice_item": "ii_NORMALIZED00000000000002",+ "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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "proration_details": {+ "credited_items": null+ },+ "quantity": 123,+ "subscription": null,+ "tax_amounts": [],+ "tax_rates": [],+ "type": "invoiceitem",+ "unit_amount_excluding_tax": "12000"+ }+ ],+ "has_more": false,+ "object": "list",+ "total_count": 1,+ "url": "/v1/invoices/in_NORMALIZED00000000000002/lines"+ },+ "livemode": false,+ "metadata": {+ "billing_schedule": "1",+ "license_management": "manual",+ "licenses": "123",+ "on_free_trial": "False",+ "plan_tier": "2",+ "user_id": "10"+ },+ "next_payment_attempt": null,+ "number": "NORMALI-0003",+ "object": "invoice",+ "on_behalf_of": null,+ "paid": true,+ "paid_out_of_band": true,+ "payment_intent": null,+ "payment_settings": {+ "default_mandate": null,+ "payment_method_options": null,+ "payment_method_types": null+ },+ "period_end": 1000000000,+ "period_start": 1000000000,+ "post_payment_credit_notes_amount": 0,+ "pre_payment_credit_notes_amount": 0,+ "quote": null,+ "receipt_number": null,+ "rendering": {+ "amount_tax_display": null,+ "pdf": {+ "page_size": "letter"+ }+ },+ "rendering_options": null,+ "shipping_cost": null,+ "shipping_details": null,+ "starting_balance": 0,+ "statement_descriptor": "Zulip Cloud Plus",+ "status": "paid",+ "status_transitions": {+ "finalized_at": 1000000000,+ "marked_uncollectible_at": null,+ "paid_at": 1000000000,+ "voided_at": null+ },+ "subscription": null,+ "subscription_details": {+ "metadata": null+ },+ "subtotal": 1476000,+ "subtotal_excluding_tax": 1476000,+ "tax": null,+ "test_clock": null,+ "total": 1476000,+ "total_discount_amounts": [],+ "total_excluding_tax": 1476000,+ "total_tax_amounts": [],+ "transfer_data": null,+ "webhooks_delivered_at": 1000000000+}diff --git a/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--InvoiceItem.create.1.json b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--InvoiceItem.create.1.jsonnew file mode 100644index 00000000000..23572f831de--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_by_invoice_to_plus_plan--InvoiceItem.create.1.json@@ -0,0 +1,47 @@+{+ "amount": 1476000,+ "currency": "usd",+ "customer": "cus_NORMALIZED0001",+ "date": 1000000000,+ "description": "Zulip Cloud Plus",+ "discountable": false,+ "discounts": [],+ "id": "ii_NORMALIZED00000000000002",+ "invoice": null,+ "livemode": false,+ "metadata": {},+ "object": "invoiceitem",+ "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": 12000,+ "unit_amount_decimal": "12000"+ },+ "proration": false,+ "quantity": 123,+ "subscription": null,+ "tax_rates": [],+ "test_clock": null,+ "unit_amount": 12000,+ "unit_amount_decimal": "12000"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_server_user_to_monthly_basic_plan--Event.list.6.json b/corporate/tests/stripe_fixtures/upgrade_server_user_to_monthly_basic_plan--Event.list.6.jsonnew file mode 100644index 00000000000..60869f373b2--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_server_user_to_monthly_basic_plan--Event.list.6.json@@ -0,0 +1,56 @@+{+ "data": [+ {+ "api_version": "2020-08-27",+ "created": 1000000000,+ "data": {+ "object": {+ "application": null,+ "automatic_payment_methods": null,+ "cancellation_reason": null,+ "client_secret": "seti_1P67MTDEQaroqDjsJdmzYnDs_secret_PvzLpZfzqiLn7xj6G75sV6LBntU2LxZ",+ "created": 1000000000,+ "customer": "cus_NORMALIZED0003",+ "description": null,+ "flow_directions": null,+ "id": "seti_1P67MTDEQaroqDjsJdmzYnDs",+ "last_setup_error": null,+ "latest_attempt": "setatt_1P67MTDEQaroqDjsi8twUvHa",+ "livemode": false,+ "mandate": null,+ "metadata": {},+ "next_action": null,+ "object": "setup_intent",+ "on_behalf_of": null,+ "payment_method": "pm_1P67MSDEQaroqDjsrn1GLZXr",+ "payment_method_configuration_details": null,+ "payment_method_options": {+ "card": {+ "mandate_options": null,+ "network": null,+ "request_three_d_secure": "automatic"+ }+ },+ "payment_method_types": [+ "card"+ ],+ "single_use_mandate": null,+ "status": "succeeded",+ "usage": "off_session"+ }+ },+ "id": "evt_1P67MUDEQaroqDjs53LwEvLG",+ "livemode": false,+ "object": "event",+ "pending_webhooks": 0,+ "request": {+ "id": "req_NORMALIZED0013",+ "idempotency_key": "cff71048-410a-4f8a-9fde-c0b7e2e4d763"+ },+ "type": "setup_intent.succeeded"+ }+ ],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/stripe_fixtures/upgrade_server_user_to_monthly_basic_plan--Event.list.7.json b/corporate/tests/stripe_fixtures/upgrade_server_user_to_monthly_basic_plan--Event.list.7.jsonnew file mode 100644index 00000000000..6d922067afe--- /dev/null+++ b/corporate/tests/stripe_fixtures/upgrade_server_user_to_monthly_basic_plan--Event.list.7.json@@ -0,0 +1,6 @@+{+ "data": [],+ "has_more": false,+ "object": "list",+ "url": "/v1/events"+}diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.pyindex f4e8bdc5331..14b101eeea1 100644--- a/corporate/tests/test_stripe.py+++ b/corporate/tests/test_stripe.py@@ -856,6 +856,272 @@ class StripeTest(StripeTestCase):self.assertEqual(response.status_code, 302)self.assertTrue(response["Location"].startswith("https://billing.stripe.com"))+ @mock_stripe()+ def test_upgrade_by_card_to_plus_plan(self, *mocks: Mock) -> None:+ user = self.example_user("hamlet")+ self.login_user(user)+ response = self.client_get("/upgrade/?tier=2")+ self.assert_in_success_response(+ ["Your subscription will renew automatically", "Zulip Cloud Plus"], response+ )+ self.assertEqual(user.realm.plan_type, Realm.PLAN_TYPE_SELF_HOSTED)+ # This also means there is no card set as default payment method set for the user.+ self.assertFalse(Customer.objects.filter(realm=user.realm).exists())+ stripe_customer = self.add_card_and_upgrade(user, tier=CustomerPlan.TIER_CLOUD_PLUS)++ self.assertEqual(stripe_customer.description, "zulip (Zulip Dev)")+ self.assertEqual(stripe_customer.discount, None)+ self.assertEqual(stripe_customer.email, user.delivery_email)+ assert stripe_customer.metadata is not None+ metadata_dict = dict(stripe_customer.metadata)+ self.assertEqual(metadata_dict["realm_str"], "zulip")+ try:+ int(metadata_dict["realm_id"])+ except ValueError: # nocoverage+ raise AssertionError("realm_id is not a number")++ # Check Charges in Stripe+ [charge] = iter(stripe.Charge.list(customer=stripe_customer.id))+ self.assertEqual(charge.amount, 12000 * self.seat_count)+ self.assertEqual(charge.description, "Payment for Invoice")+ self.assertEqual(charge.receipt_email, user.delivery_email)+ self.assertEqual(charge.statement_descriptor, "Zulip Cloud Plus")+ # Check Invoices in Stripe+ [invoice] = iter(stripe.Invoice.list(customer=stripe_customer.id))+ self.assertIsNotNone(invoice.status_transitions.finalized_at)+ invoice_params = {+ # auto_advance is False because the invoice has been paid+ "amount_due": 72000,+ "amount_paid": 72000,+ "auto_advance": False,+ "collection_method": "charge_automatically",+ "status": "paid",+ "total": 72000,+ }+ self.assertIsNotNone(invoice.charge)+ for key, value in invoice_params.items():+ self.assertEqual(invoice.get(key), value)+ # Check Line Items on Stripe Invoice+ [item0] = iter(invoice.lines)+ line_item_params = {+ "amount": 12000 * self.seat_count,+ "description": "Zulip Cloud Plus",+ "discountable": False,+ # There's no unit_amount on Line Items, probably because it doesn't show up on the+ # user-facing invoice. We could pull the Invoice Item instead and test unit_amount there,+ # but testing the amount and quantity seems sufficient.+ "plan": None,+ "proration": False,+ "quantity": self.seat_count,+ "period": {+ "start": datetime_to_timestamp(self.now),+ "end": datetime_to_timestamp(add_months(self.now, 12)),+ },+ }+ for key, value in line_item_params.items():+ self.assertEqual(item0.get(key), value)++ # Check that we correctly populated Customer, CustomerPlan, and LicenseLedger in Zulip+ customer = Customer.objects.get(stripe_customer_id=stripe_customer.id, realm=user.realm)+ plan = CustomerPlan.objects.get(+ customer=customer,+ automanage_licenses=True,+ price_per_license=12000,+ fixed_price=None,+ discount=None,+ billing_cycle_anchor=self.now,+ billing_schedule=CustomerPlan.BILLING_SCHEDULE_ANNUAL,+ invoiced_through=LicenseLedger.objects.first(),+ next_invoice_date=self.next_month,+ tier=CustomerPlan.TIER_CLOUD_PLUS,+ status=CustomerPlan.ACTIVE,+ )+ LicenseLedger.objects.get(+ plan=plan,+ is_renewal=True,+ event_time=self.now,+ licenses=self.seat_count,+ licenses_at_next_renewal=self.seat_count,+ )+ # Check RealmAuditLog+ audit_log_entries = list(+ RealmAuditLog.objects.filter(acting_user=user)+ .values_list("event_type", "event_time")+ .order_by("id")+ )+ self.assertEqual(+ audit_log_entries[:3],+ [+ (+ RealmAuditLog.STRIPE_CUSTOMER_CREATED,+ timestamp_to_datetime(stripe_customer.created),+ ),+ (RealmAuditLog.STRIPE_CARD_CHANGED, self.now),+ (RealmAuditLog.CUSTOMER_PLAN_CREATED, self.now),+ ],+ )+ self.assertEqual(audit_log_entries[3][0], RealmAuditLog.REALM_PLAN_TYPE_CHANGED)+ first_audit_log_entry = (+ RealmAuditLog.objects.filter(event_type=RealmAuditLog.CUSTOMER_PLAN_CREATED)+ .values_list("extra_data", flat=True)+ .first()+ )+ assert first_audit_log_entry is not None+ self.assertTrue(first_audit_log_entry["automanage_licenses"])+ # Check that we correctly updated Realm+ realm = get_realm("zulip")+ self.assertEqual(realm.plan_type, Realm.PLAN_TYPE_PLUS)+ self.assertEqual(realm.max_invites, Realm.INVITES_STANDARD_REALM_DAILY_MAX)+ # Check that we can no longer access /upgrade+ response = self.client_get("/upgrade/")+ self.assertEqual(response.status_code, 302)+ self.assertEqual("http://zulip.testserver/billing", response["Location"])++ # Check /billing/ has the correct information+ with time_machine.travel(self.now, tick=False):+ response = self.client_get("/billing/")+ self.assert_not_in_success_response(["Pay annually"], response)+ for substring in [+ "Zulip Cloud Plus",+ str(self.seat_count),+ "Number of licenses",+ f"{ self.seat_count } (managed automatically)",+ "Your plan will automatically renew on",+ "January 2, 2013",+ f"${120 * self.seat_count}.00",+ "Visa ending in 4242",+ "Update card",+ ]:+ self.assert_in_response(substring, response)++ self.assert_not_in_success_response(+ [+ "Number of licenses for current billing period",+ "You will receive an invoice for",+ ],+ response,+ )++ @mock_stripe()+ def test_upgrade_by_invoice_to_plus_plan(self, *mocks: Mock) -> None:+ user = self.example_user("hamlet")+ self.login_user(user)+ # Click "Make payment" in Stripe Checkout+ with time_machine.travel(self.now, tick=False):+ self.upgrade(invoice=True, tier=CustomerPlan.TIER_CLOUD_PLUS)+ # Check that we correctly created a Customer in Stripe+ stripe_customer = stripe_get_customer(+ assert_is_not_none(Customer.objects.get(realm=user.realm).stripe_customer_id)+ )+ self.assertFalse(stripe_customer_has_credit_card_as_default_payment_method(stripe_customer))++ # Check Charges in Stripe+ self.assertFalse(stripe.Charge.list(customer=stripe_customer.id))+ # Check Invoices in Stripe+ [invoice] = iter(stripe.Invoice.list(customer=stripe_customer.id))+ self.assertIsNotNone(invoice.due_date)+ self.assertIsNotNone(invoice.status_transitions.finalized_at)+ invoice_params = {+ "amount_due": 12000 * 123,+ "amount_paid": 0,+ "attempt_count": 0,+ "auto_advance": False,+ "collection_method": "send_invoice",+ "statement_descriptor": "Zulip Cloud Plus",+ "status": "paid",+ "total": 12000 * 123,+ }+ for key, value in invoice_params.items():+ self.assertEqual(invoice.get(key), value)+ # Check Line Items on Stripe Invoice+ [item] = iter(invoice.lines)+ line_item_params = {+ "amount": 12000 * 123,+ "description": "Zulip Cloud Plus",+ "discountable": False,+ "plan": None,+ "proration": False,+ "quantity": 123,+ "period": {+ "start": datetime_to_timestamp(self.now),+ "end": datetime_to_timestamp(add_months(self.now, 12)),+ },+ }+ for key, value in line_item_params.items():+ self.assertEqual(item.get(key), value)++ # Check that we correctly populated Customer, CustomerPlan and LicenseLedger in Zulip+ customer = Customer.objects.get(stripe_customer_id=stripe_customer.id, realm=user.realm)+ plan = CustomerPlan.objects.get(+ customer=customer,+ automanage_licenses=False,+ charge_automatically=False,+ price_per_license=12000,+ fixed_price=None,+ discount=None,+ billing_cycle_anchor=self.now,+ billing_schedule=CustomerPlan.BILLING_SCHEDULE_ANNUAL,+ invoiced_through=LicenseLedger.objects.first(),+ next_invoice_date=self.next_month,+ tier=CustomerPlan.TIER_CLOUD_PLUS,+ status=CustomerPlan.ACTIVE,+ )+ LicenseLedger.objects.get(+ plan=plan,+ is_renewal=True,+ event_time=self.now,+ licenses=123,+ licenses_at_next_renewal=123,+ )+ # Check RealmAuditLog+ audit_log_entries = list(+ RealmAuditLog.objects.filter(acting_user=user)+ .values_list("event_type", "event_time")+ .order_by("id")+ )+ self.assertEqual(+ audit_log_entries[:3],+ [+ (+ RealmAuditLog.STRIPE_CUSTOMER_CREATED,+ timestamp_to_datetime(stripe_customer.created),+ ),+ (RealmAuditLog.CUSTOMER_PLAN_CREATED, self.now),+ (RealmAuditLog.REALM_PLAN_TYPE_CHANGED, self.now),+ ],+ )+ self.assertEqual(audit_log_entries[2][0], RealmAuditLog.REALM_PLAN_TYPE_CHANGED)+ first_audit_log_entry = (+ RealmAuditLog.objects.filter(event_type=RealmAuditLog.CUSTOMER_PLAN_CREATED)+ .values_list("extra_data", flat=True)+ .first()+ )+ assert first_audit_log_entry is not None+ self.assertFalse(first_audit_log_entry["automanage_licenses"])+ # Check that we correctly updated Realm+ realm = get_realm("zulip")+ self.assertEqual(realm.plan_type, Realm.PLAN_TYPE_PLUS)+ self.assertEqual(realm.max_invites, Realm.INVITES_STANDARD_REALM_DAILY_MAX)+ # Check that we can no longer access /upgrade+ response = self.client_get("/upgrade/")+ self.assertEqual(response.status_code, 302)+ self.assertEqual("http://zulip.testserver/billing", response["Location"])++ # Check /billing/ has the correct information+ with time_machine.travel(self.now, tick=False):+ response = self.client_get("/billing/")+ self.assert_not_in_success_response(["Pay annually", "Update card"], response)+ for substring in [+ "Zulip Cloud Plus",+ str(123),+ "Number of licenses for current billing period",+ f"licenses ({self.seat_count} in use)",+ "You will receive an invoice for",+ "January 2, 2013",+ "$14,760.00", # 14760 = 120 * 123+ ]:+ self.assert_in_response(substring, response)+@mock_stripe(tested_timestamp_fields=["created"])def test_upgrade_by_card(self, *mocks: Mock) -> None:user = self.example_user("hamlet")@@ -4416,7 +4682,7 @@ class StripeTest(StripeTestCase):# There are 9 licenses and the realm is on the Standard monthly plan.# Therefore, the customer has already paid 800 * 9 = 7200 = $72 for# the month. Once they upgrade to Plus, the new price for their 9- # licenses will be 1600 * 9 = 14400 = $144. Since the customer has+ # licenses will be 1200 * 9 = 10800 = $108. Since the customer has# already paid $72 for a month, -7200 = -$72 will be credited to the# customer's balance.stripe_customer_id = customer.stripe_customer_id@@ -4429,10 +4695,10 @@ class StripeTest(StripeTestCase):)self.assertEqual(cb_txn.type, "adjustment")- # The customer now only pays the difference 14400 - 7200 = 7200 = $72,+ # The customer now only pays the difference 10800 - 7200 = 3600 = $36,# since the unused proration is for the whole month.(invoice,) = iter(stripe.Invoice.list(customer=stripe_customer_id))- self.assertEqual(invoice.amount_due, 7200)+ self.assertEqual(invoice.amount_due, 3600)@mock_stripe()def test_customer_has_credit_card_as_default_payment_method(self, *mocks: Mock) -> None:@@ -4922,13 +5188,13 @@ class BillingHelpersTest(ZulipTestCase):get_price_per_license(CustomerPlan.TIER_CLOUD_PLUS, CustomerPlan.BILLING_SCHEDULE_ANNUAL),- 16000,+ 12000,)self.assertEqual(get_price_per_license(CustomerPlan.TIER_CLOUD_PLUS, CustomerPlan.BILLING_SCHEDULE_MONTHLY),- 1600,+ 1200,)self.assertEqual(get_price_per_license(@@ -4936,7 +5202,7 @@ class BillingHelpersTest(ZulipTestCase):CustomerPlan.BILLING_SCHEDULE_MONTHLY,discount=Decimal(50),),- 800,+ 600,)with self.assertRaisesRegex(InvalidBillingScheduleError, "Unknown billing_schedule: 1000"):diff --git a/corporate/views/portico.py b/corporate/views/portico.pyindex 6aee07c141a..96ad79760f3 100644--- a/corporate/views/portico.py+++ b/corporate/views/portico.py@@ -91,6 +91,7 @@ class PlansPageContext:tier_self_hosted_basic: int = CustomerPlan.TIER_SELF_HOSTED_BASICtier_self_hosted_business: int = CustomerPlan.TIER_SELF_HOSTED_BUSINESStier_cloud_standard: int = CustomerPlan.TIER_CLOUD_STANDARD+ tier_cloud_plus: int = CustomerPlan.TIER_CLOUD_PLUS@add_google_analytics@@ -293,7 +294,14 @@ def team_view(request: HttpRequest) -> HttpResponse:@add_google_analyticsdef landing_view(request: HttpRequest, template_name: str) -> HttpResponse:context = latest_info_context()- context["billing_base_url"] = ""+ context.update(+ {+ "billing_base_url": "",+ "tier_cloud_standard": str(CustomerPlan.TIER_CLOUD_STANDARD),+ "tier_cloud_plus": str(CustomerPlan.TIER_CLOUD_PLUS),+ }+ )+return TemplateResponse(request, template_name, context)diff --git a/templates/corporate/pricing_model.html b/templates/corporate/pricing_model.htmlindex 68be58a8940..e2b6a357b7a 100644--- a/templates/corporate/pricing_model.html+++ b/templates/corporate/pricing_model.html@@ -108,7 +108,7 @@Sponsorship requested</a>{% else %}- <a href="/upgrade/" class="button upgrade-button">+ <a href="/upgrade/?tier={{ tier_cloud_standard }}" class="button upgrade-button">{% if free_trial_days %}Start {{ free_trial_days }}-day free trial{% else %}@@ -134,17 +134,25 @@<div class="bottom"><div class="text-content"><div class="standard-price-box">- <div class="price"><span class="currency-symbol">$</span>13.34</div>+ <div class="price"><span class="currency-symbol">$</span>10</div><div class="details"><p>/user/month billed annually- or <b>$16</b> billed monthly+ <br />+ or <b>$12</b> billed monthly</p></div></div>- <a href="mailto:[email protected]" target="_blank" rel="noopener noreferrer" class="button upgrade-button">- Contact sales+ {% if customer_plan and customer_plan.tier == customer_plan.TIER_CLOUD_PLUS %}+ <a href='/billing' class="button current-plan-button" type="button">+ <i class="icon current-plan-icon"></i>+ Current plan+ </a>+ {% else %}+ <a href="/upgrade/?tier={{ tier_cloud_plus }}" class="button upgrade-button">+ Upgrade to Plus</a>+ {% endif %}</div></div></div>