Skip to content

armgit / zulip

Public Imported from GitHub
0

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

test_stripe: Keep same context after seat_count change during upgrade.

Aman Agrawal785444b2b803
diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Charge.list.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Charge.list.1.json
index 76f49882f1c..c86c0db624b 100644
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Charge.list.1.json
+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Charge.list.1.json
@@ -63,7 +63,7 @@
},
"paid": true,
"payment_intent": "pi_NORMALIZED00000000000001",
- "payment_method": "pm_1ODZbCDEQaroqDjsGY2lvS6F",
+ "payment_method": "pm_1OIlUmDEQaroqDjs0AAGeLzU",
"payment_method_details": {
"card": {
"amount_authorized": 48000,
@@ -74,7 +74,7 @@
"cvc_check": "pass"
},
"country": "US",
- "exp_month": 11,
+ "exp_month": 12,
"exp_year": 2024,
"extended_authorization": {
"status": "disabled"
@@ -103,9 +103,10 @@
},
"type": "card"
},
+ "radar_options": {},
"receipt_email": "[email protected]",
"receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKLK236oGMgb3J2Vbbk46LBY0N16T1r3oIvZRLKPGYSRuYrU6ZvWbwjYhumebVjZRBUAGdglJg3WPVW_X",
+ "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKKz5qqsGMgb8-UHvIgE6LBajVdfWr3DYOczQ_jsO35xRctFF-6jUPMEDknz3AYQSR06bUDx0i_dOwtFJ",
"refunded": false,
"refunds": {
"data": [],
diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Customer.modify.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Customer.modify.1.json
index eeb2281e0df..666a80341f3 100644
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Customer.modify.1.json
+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Customer.modify.1.json
@@ -13,7 +13,7 @@
"invoice_prefix": "NORMA01",
"invoice_settings": {
"custom_fields": null,
- "default_payment_method": "pm_1ODZbCDEQaroqDjsGY2lvS6F",
+ "default_payment_method": "pm_1OIlUmDEQaroqDjs0AAGeLzU",
"footer": null,
"rendering_options": null
},
diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Customer.retrieve.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Customer.retrieve.1.json
index 7c9c3c5cf3b..7d7fa15689d 100644
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Customer.retrieve.1.json
+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Customer.retrieve.1.json
@@ -35,7 +35,7 @@
"cvc_check": "pass"
},
"country": "US",
- "exp_month": 11,
+ "exp_month": 12,
"exp_year": 2024,
"fingerprint": "NORMALIZED000001",
"funding": "credit",
@@ -54,7 +54,7 @@
},
"created": 1010000003,
"customer": "cus_NORMALIZED0001",
- "id": "pm_1ODZbCDEQaroqDjsGY2lvS6F",
+ "id": "pm_1OIlUmDEQaroqDjs0AAGeLzU",
"livemode": false,
"metadata": {},
"object": "payment_method",
diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Customer.retrieve.2.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Customer.retrieve.2.json
index 7c9c3c5cf3b..7d7fa15689d 100644
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Customer.retrieve.2.json
+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Customer.retrieve.2.json
@@ -35,7 +35,7 @@
"cvc_check": "pass"
},
"country": "US",
- "exp_month": 11,
+ "exp_month": 12,
"exp_year": 2024,
"fingerprint": "NORMALIZED000001",
"funding": "credit",
@@ -54,7 +54,7 @@
},
"created": 1010000003,
"customer": "cus_NORMALIZED0001",
- "id": "pm_1ODZbCDEQaroqDjsGY2lvS6F",
+ "id": "pm_1OIlUmDEQaroqDjs0AAGeLzU",
"livemode": false,
"metadata": {},
"object": "payment_method",
diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Customer.retrieve.3.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Customer.retrieve.3.json
deleted file mode 100644
index 7c9c3c5cf3b..00000000000
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Customer.retrieve.3.json
+++ /dev/null
@@ -1,79 +0,0 @@
-{
- "address": null,
- "balance": 0,
- "created": 1010000002,
- "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": {
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 11,
- "exp_year": 2024,
- "fingerprint": "NORMALIZED000001",
- "funding": "credit",
- "generated_from": null,
- "last4": "4242",
- "networks": {
- "available": [
- "visa"
- ],
- "preferred": null
- },
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1010000003,
- "customer": "cus_NORMALIZED0001",
- "id": "pm_1ODZbCDEQaroqDjsGY2lvS6F",
- "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_with_outdated_seat_count--Customer.retrieve.4.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Customer.retrieve.4.json
deleted file mode 100644
index 7c9c3c5cf3b..00000000000
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Customer.retrieve.4.json
+++ /dev/null
@@ -1,79 +0,0 @@
-{
- "address": null,
- "balance": 0,
- "created": 1010000002,
- "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": {
- "billing_details": {
- "address": {
- "city": null,
- "country": null,
- "line1": null,
- "line2": null,
- "postal_code": null,
- "state": null
- },
- "email": null,
- "name": null,
- "phone": null
- },
- "card": {
- "brand": "visa",
- "checks": {
- "address_line1_check": null,
- "address_postal_code_check": null,
- "cvc_check": "pass"
- },
- "country": "US",
- "exp_month": 11,
- "exp_year": 2024,
- "fingerprint": "NORMALIZED000001",
- "funding": "credit",
- "generated_from": null,
- "last4": "4242",
- "networks": {
- "available": [
- "visa"
- ],
- "preferred": null
- },
- "three_d_secure_usage": {
- "supported": true
- },
- "wallet": null
- },
- "created": 1010000003,
- "customer": "cus_NORMALIZED0001",
- "id": "pm_1ODZbCDEQaroqDjsGY2lvS6F",
- "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_with_outdated_seat_count--Event.list.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Event.list.1.json
index b713bfcc1e4..fa0a0ccca83 100644
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Event.list.1.json
+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Event.list.1.json
@@ -19,7 +19,7 @@
"invoice_prefix": "NORMA01",
"invoice_settings": {
"custom_fields": null,
- "default_payment_method": "pm_1ODZbCDEQaroqDjsGY2lvS6F",
+ "default_payment_method": "pm_1OIlUmDEQaroqDjs0AAGeLzU",
"footer": null,
"rendering_options": null
},
@@ -43,13 +43,13 @@
}
}
},
- "id": "evt_1ODZbEDEQaroqDjsG2ZWXSNn",
+ "id": "evt_1OIlUoDEQaroqDjsqB7cTzR1",
"livemode": false,
"object": "event",
"pending_webhooks": 0,
"request": {
"id": "req_NORMALIZED0001",
- "idempotency_key": "4076266f-f7ce-492c-8f26-e2bc51dbe79d"
+ "idempotency_key": "52083a9a-7541-4e8e-87ab-b7a110f8632c"
},
"type": "customer.updated"
}
diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Event.list.2.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Event.list.2.json
index 74f6e5e8b94..edddeb4a74e 100644
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Event.list.2.json
+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Event.list.2.json
@@ -2,7 +2,7 @@
"data": [
{
"api_version": "2020-08-27",
- "created": 1010000005,
+ "created": 1010000001,
"data": {
"object": {
"amount": 48000,
@@ -82,7 +82,7 @@
},
"paid": true,
"payment_intent": "pi_NORMALIZED00000000000001",
- "payment_method": "pm_1ODZbCDEQaroqDjsGY2lvS6F",
+ "payment_method": "pm_1OIlUmDEQaroqDjs0AAGeLzU",
"payment_method_details": {
"card": {
"amount_authorized": 48000,
@@ -93,7 +93,7 @@
"cvc_check": "pass"
},
"country": "US",
- "exp_month": 11,
+ "exp_month": 12,
"exp_year": 2024,
"extended_authorization": {
"status": "disabled"
@@ -122,9 +122,10 @@
},
"type": "card"
},
+ "radar_options": {},
"receipt_email": "[email protected]",
"receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKK-236oGMgYUOLyzJMg6LBb-66rvHv6q-8tIC0T8m4OahAt2i5W0b1aF-9sqaq8bjA-0OsU3Eo-HPpT-",
+ "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKKn5qqsGMgbtG76MuyU6LBbWG2Cil-ttJD9I0VwXsUF2mWfgpbbDgudsVQczK9avX1NvF5oowAc-WMjv",
"refunded": false,
"refunds": {
"data": [],
@@ -149,7 +150,7 @@
"total_count": 1,
"url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000001"
},
- "client_secret": "pi_NORMALIZED00000000000001_secret_GhNIQ1qIF31zO8VOgP3Au41k0",
+ "client_secret": "pi_NORMALIZED00000000000001_secret_PINrM33YM9KIsKSnhNma2VvhN",
"confirmation_method": "automatic",
"created": 1010000001,
"currency": "usd",
@@ -176,7 +177,7 @@
"next_action": null,
"object": "payment_intent",
"on_behalf_of": null,
- "payment_method": "pm_1ODZbCDEQaroqDjsGY2lvS6F",
+ "payment_method": "pm_1OIlUmDEQaroqDjs0AAGeLzU",
"payment_method_configuration_details": null,
"payment_method_options": {
"card": {
@@ -202,19 +203,19 @@
"transfer_group": null
}
},
- "id": "evt_3ODZbGDEQaroqDjs1pIcV6qz",
+ "id": "evt_3OIlUqDEQaroqDjs0upmJyM1",
"livemode": false,
"object": "event",
"pending_webhooks": 2,
"request": {
"id": "req_NORMALIZED0002",
- "idempotency_key": "6583fd8a-d424-45e2-abba-df18edd580bb"
+ "idempotency_key": "bfb77588-e054-4ed6-ac5f-69baec76cc21"
},
"type": "payment_intent.succeeded"
},
{
"api_version": "2020-08-27",
- "created": 1010000005,
+ "created": 1010000001,
"data": {
"object": {
"amount": 48000,
@@ -279,7 +280,7 @@
},
"paid": true,
"payment_intent": "pi_NORMALIZED00000000000001",
- "payment_method": "pm_1ODZbCDEQaroqDjsGY2lvS6F",
+ "payment_method": "pm_1OIlUmDEQaroqDjs0AAGeLzU",
"payment_method_details": {
"card": {
"amount_authorized": 48000,
@@ -290,7 +291,7 @@
"cvc_check": "pass"
},
"country": "US",
- "exp_month": 11,
+ "exp_month": 12,
"exp_year": 2024,
"extended_authorization": {
"status": "disabled"
@@ -319,9 +320,10 @@
},
"type": "card"
},
+ "radar_options": {},
"receipt_email": "[email protected]",
"receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKK-236oGMgbj7n5hrMk6LBYCyZ-XEO3uuxGJv9jcZtkezwOe27kp2l_jhD_8Bp2OWgzcyntEdwyTSi6b",
+ "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKKn5qqsGMgYVvbCJZL06LBZiR-oBknR-ehsjyI8jTZN2_fCUnNA-GTu7dACzoJFZRbtX_clDdkh7wESK",
"refunded": false,
"refunds": {
"data": [],
@@ -341,13 +343,13 @@
"transfer_group": null
}
},
- "id": "evt_3ODZbGDEQaroqDjs1B0UnbeU",
+ "id": "evt_3OIlUqDEQaroqDjs0XXmcx64",
"livemode": false,
"object": "event",
"pending_webhooks": 0,
"request": {
"id": "req_NORMALIZED0002",
- "idempotency_key": "6583fd8a-d424-45e2-abba-df18edd580bb"
+ "idempotency_key": "bfb77588-e054-4ed6-ac5f-69baec76cc21"
},
"type": "charge.succeeded"
}
diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Event.list.3.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Event.list.3.json
index f362e9a0578..c9f96b0eb43 100644
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Event.list.3.json
+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Event.list.3.json
@@ -2,7 +2,247 @@
"data": [
{
"api_version": "2020-08-27",
- "created": 1010000006,
+ "created": 1010000005,
+ "data": {
+ "object": {
+ "account_country": "US",
+ "account_name": "Kandra Labs, Inc.",
+ "account_tax_ids": null,
+ "amount_due": 136000,
+ "amount_paid": 0,
+ "amount_remaining": 136000,
+ "amount_shipping": 0,
+ "application": null,
+ "application_fee_amount": null,
+ "attempt_count": 0,
+ "attempted": false,
+ "auto_advance": true,
+ "automatic_tax": {
+ "enabled": false,
+ "status": null
+ },
+ "billing_reason": "manual",
+ "charge": null,
+ "collection_method": "charge_automatically",
+ "created": 1010000006,
+ "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QNnpUM3F0VG1SREFmNEVJRnVBN3RoeDNvQ1F0TW10LDkyMDM0NzMx02000tnpwyOP?s=ap",
+ "id": "in_NORMALIZED00000000000001",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QNnpUM3F0VG1SREFmNEVJRnVBN3RoeDNvQ1F0TW10LDkyMDM0NzMx02000tnpwyOP/pdf?s=ap",
+ "last_finalization_error": null,
+ "latest_revision": null,
+ "lines": {
+ "data": [
+ {
+ "amount": 184000,
+ "amount_excluding_tax": 184000,
+ "currency": "usd",
+ "description": "Zulip Cloud Standard",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000001",
+ "invoice_item": "ii_NORMALIZED00000000000001",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1357095845,
+ "start": 1325473445
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1010000007,
+ "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": 23,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "8000"
+ },
+ {
+ "amount": -48000,
+ "amount_excluding_tax": -48000,
+ "currency": "usd",
+ "description": "Payment (Card ending in 4242)",
+ "discount_amounts": [],
+ "discountable": false,
+ "discounts": [],
+ "id": "il_NORMALIZED00000000000002",
+ "invoice_item": "ii_NORMALIZED00000000000002",
+ "livemode": false,
+ "metadata": {},
+ "object": "line_item",
+ "period": {
+ "end": 1000000000,
+ "start": 1000000000
+ },
+ "plan": null,
+ "price": {
+ "active": false,
+ "billing_scheme": "per_unit",
+ "created": 1010000008,
+ "currency": "usd",
+ "custom_unit_amount": null,
+ "id": "price_NORMALIZED00000000000002",
+ "livemode": false,
+ "lookup_key": null,
+ "metadata": {},
+ "nickname": null,
+ "object": "price",
+ "product": "prod_NORMALIZED0002",
+ "recurring": null,
+ "tax_behavior": "unspecified",
+ "tiers_mode": null,
+ "transform_quantity": null,
+ "type": "one_time",
+ "unit_amount": -48000,
+ "unit_amount_decimal": "-48000"
+ },
+ "proration": false,
+ "proration_details": {
+ "credited_items": null
+ },
+ "quantity": 1,
+ "subscription": null,
+ "tax_amounts": [],
+ "tax_rates": [],
+ "type": "invoiceitem",
+ "unit_amount_excluding_tax": "-48000"
+ }
+ ],
+ "has_more": false,
+ "object": "list",
+ "total_count": 2,
+ "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
+ },
+ "livemode": false,
+ "metadata": {},
+ "next_payment_attempt": 1000000000,
+ "number": "NORMALI-0001",
+ "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": 136000,
+ "subtotal_excluding_tax": 136000,
+ "tax": null,
+ "test_clock": null,
+ "total": 136000,
+ "total_discount_amounts": [],
+ "total_excluding_tax": 136000,
+ "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_1OIlUtDEQaroqDjsGR7ETgDB",
+ "livemode": false,
+ "object": "event",
+ "pending_webhooks": 2,
+ "request": {
+ "id": "req_NORMALIZED0003",
+ "idempotency_key": "56577100-e860-46d1-8ac7-89a10ddcb98d"
+ },
+ "type": "invoice.updated"
+ },
+ {
+ "api_version": "2020-08-27",
+ "created": 1010000005,
"data": {
"object": {
"amount": 136000,
@@ -24,9 +264,9 @@
"total_count": 0,
"url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000002"
},
- "client_secret": "pi_NORMALIZED00000000000002_secret_pLVLHyg9nOnVT1rhVYn4z8F1b",
+ "client_secret": "pi_NORMALIZED00000000000002_secret_nJoduLGo5ELqAIE2PLizc7sGp",
"confirmation_method": "automatic",
- "created": 1010000006,
+ "created": 1010000005,
"currency": "usd",
"customer": "cus_NORMALIZED0001",
"description": "Payment for Invoice",
@@ -67,19 +307,19 @@
"transfer_group": null
}
},
- "id": "evt_3ODZbJDEQaroqDjs1K80VT7X",
+ "id": "evt_3OIlUtDEQaroqDjs1zytLIyz",
"livemode": false,
"object": "event",
"pending_webhooks": 0,
"request": {
"id": "req_NORMALIZED0003",
- "idempotency_key": "8221c3a6-7b68-430b-aae7-ece9442b415b"
+ "idempotency_key": "56577100-e860-46d1-8ac7-89a10ddcb98d"
},
"type": "payment_intent.created"
},
{
"api_version": "2020-08-27",
- "created": 1010000007,
+ "created": 1010000006,
"data": {
"object": {
"account_country": "US",
@@ -101,7 +341,7 @@
"billing_reason": "manual",
"charge": null,
"collection_method": "charge_automatically",
- "created": 1010000007,
+ "created": 1010000006,
"currency": "usd",
"custom_fields": null,
"customer": "cus_NORMALIZED0001",
@@ -151,7 +391,7 @@
"price": {
"active": false,
"billing_scheme": "per_unit",
- "created": 1010000008,
+ "created": 1010000007,
"currency": "usd",
"custom_unit_amount": null,
"id": "price_NORMALIZED00000000000001",
@@ -201,7 +441,7 @@
"price": {
"active": false,
"billing_scheme": "per_unit",
- "created": 1010000009,
+ "created": 1010000008,
"currency": "usd",
"custom_unit_amount": null,
"id": "price_NORMALIZED00000000000002",
@@ -290,19 +530,19 @@
"webhooks_delivered_at": null
}
},
- "id": "evt_1ODZbIDEQaroqDjs1thblaHv",
+ "id": "evt_1OIlUsDEQaroqDjs4z1UvVAJ",
"livemode": false,
"object": "event",
"pending_webhooks": 0,
"request": {
"id": "req_NORMALIZED0004",
- "idempotency_key": "6213c32f-ce5d-455e-800b-6819fd8e95ae"
+ "idempotency_key": "7c28c59b-c67d-4541-916a-27fe3138baf7"
},
"type": "invoice.created"
},
{
"api_version": "2020-08-27",
- "created": 1010000007,
+ "created": 1010000006,
"data": {
"object": {
"amount": 184000,
@@ -325,7 +565,7 @@
"price": {
"active": false,
"billing_scheme": "per_unit",
- "created": 1010000008,
+ "created": 1010000007,
"currency": "usd",
"custom_unit_amount": null,
"id": "price_NORMALIZED00000000000001",
@@ -352,19 +592,19 @@
"unit_amount_decimal": "8000"
}
},
- "id": "evt_1ODZbIDEQaroqDjsfn4yKn56",
+ "id": "evt_1OIlUsDEQaroqDjsAje5tJTQ",
"livemode": false,
"object": "event",
"pending_webhooks": 0,
"request": {
"id": "req_NORMALIZED0005",
- "idempotency_key": "f82efb6b-cfe0-469c-ab8e-12276c2c2df3"
+ "idempotency_key": "4dde50be-d41e-4864-8ff3-3c7c3351f83a"
},
"type": "invoiceitem.created"
},
{
"api_version": "2020-08-27",
- "created": 1010000005,
+ "created": 1010000009,
"data": {
"object": {
"amount": -48000,
@@ -387,7 +627,7 @@
"price": {
"active": false,
"billing_scheme": "per_unit",
- "created": 1010000009,
+ "created": 1010000008,
"currency": "usd",
"custom_unit_amount": null,
"id": "price_NORMALIZED00000000000002",
@@ -414,19 +654,19 @@
"unit_amount_decimal": "-48000"
}
},
- "id": "evt_1ODZbIDEQaroqDjsASrSzHLU",
+ "id": "evt_1OIlUrDEQaroqDjsJ2WxhrYV",
"livemode": false,
"object": "event",
"pending_webhooks": 0,
"request": {
"id": "req_NORMALIZED0006",
- "idempotency_key": "8b52c1fd-bc88-4c0c-8f24-64839642c15f"
+ "idempotency_key": "89fc76f4-cb36-4b18-8eab-7b6b25389fca"
},
"type": "invoiceitem.created"
},
{
"api_version": "2020-08-27",
- "created": 1010000005,
+ "created": 1010000009,
"data": {
"object": {
"address": null,
@@ -443,7 +683,7 @@
"invoice_prefix": "NORMA01",
"invoice_settings": {
"custom_fields": null,
- "default_payment_method": "pm_1ODZbCDEQaroqDjsGY2lvS6F",
+ "default_payment_method": "pm_1OIlUmDEQaroqDjs0AAGeLzU",
"footer": null,
"rendering_options": null
},
@@ -466,13 +706,13 @@
"default_currency": null
}
},
- "id": "evt_1ODZbIDEQaroqDjsqxmCltVb",
+ "id": "evt_1OIlUrDEQaroqDjsKx8mYFdN",
"livemode": false,
"object": "event",
"pending_webhooks": 0,
"request": {
"id": "req_NORMALIZED0006",
- "idempotency_key": "8b52c1fd-bc88-4c0c-8f24-64839642c15f"
+ "idempotency_key": "89fc76f4-cb36-4b18-8eab-7b6b25389fca"
},
"type": "customer.updated"
}
diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Event.list.4.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Event.list.4.json
index 7b79117ff10..a8d0f05f074 100644
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Event.list.4.json
+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Event.list.4.json
@@ -2,7 +2,7 @@
"data": [
{
"api_version": "2020-08-27",
- "created": 1010000006,
+ "created": 1010000005,
"data": {
"object": {
"account_country": "US",
@@ -24,7 +24,7 @@
"billing_reason": "manual",
"charge": null,
"collection_method": "charge_automatically",
- "created": 1010000007,
+ "created": 1010000006,
"currency": "usd",
"custom_fields": null,
"customer": "cus_NORMALIZED0001",
@@ -46,9 +46,9 @@
"ending_balance": 0,
"footer": null,
"from_invoice": null,
- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNyU1RJOXNJdEJ4cjVwYVlwa1B5R1NCbnQwSnU4LDkwNzk3MzYx0200c4RVEEUg?s=ap",
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QNnpUM3F0VG1SREFmNEVJRnVBN3RoeDNvQ1F0TW10LDkyMDM0NzMx02000tnpwyOP?s=ap",
"id": "in_NORMALIZED00000000000001",
- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNyU1RJOXNJdEJ4cjVwYVlwa1B5R1NCbnQwSnU4LDkwNzk3MzYx0200c4RVEEUg/pdf?s=ap",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QNnpUM3F0VG1SREFmNEVJRnVBN3RoeDNvQ1F0TW10LDkyMDM0NzMx02000tnpwyOP/pdf?s=ap",
"last_finalization_error": null,
"latest_revision": null,
"lines": {
@@ -74,7 +74,7 @@
"price": {
"active": false,
"billing_scheme": "per_unit",
- "created": 1010000008,
+ "created": 1010000007,
"currency": "usd",
"custom_unit_amount": null,
"id": "price_NORMALIZED00000000000001",
@@ -121,235 +121,12 @@
"start": 1000000000
},
"plan": null,
- "price": {
- "active": false,
- "billing_scheme": "per_unit",
- "created": 1010000009,
- "currency": "usd",
- "custom_unit_amount": null,
- "id": "price_NORMALIZED00000000000002",
- "livemode": false,
- "lookup_key": null,
- "metadata": {},
- "nickname": null,
- "object": "price",
- "product": "prod_NORMALIZED0002",
- "recurring": null,
- "tax_behavior": "unspecified",
- "tiers_mode": null,
- "transform_quantity": null,
- "type": "one_time",
- "unit_amount": -48000,
- "unit_amount_decimal": "-48000"
- },
- "proration": false,
- "proration_details": {
- "credited_items": null
- },
- "quantity": 1,
- "subscription": null,
- "tax_amounts": [],
- "tax_rates": [],
- "type": "invoiceitem",
- "unit_amount_excluding_tax": "-48000"
- }
- ],
- "has_more": false,
- "object": "list",
- "total_count": 2,
- "url": "/v1/invoices/in_NORMALIZED00000000000001/lines"
- },
- "livemode": false,
- "metadata": {},
- "next_payment_attempt": 1000000000,
- "number": "NORMALI-0001",
- "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": 136000,
- "subtotal_excluding_tax": 136000,
- "tax": null,
- "test_clock": null,
- "total": 136000,
- "total_discount_amounts": [],
- "total_excluding_tax": 136000,
- "total_tax_amounts": [],
- "transfer_data": null,
- "webhooks_delivered_at": null
- }
- },
- "id": "evt_1ODZbKDEQaroqDjsbfz78a0D",
- "livemode": false,
- "object": "event",
- "pending_webhooks": 0,
- "request": {
- "id": "req_NORMALIZED0003",
- "idempotency_key": "8221c3a6-7b68-430b-aae7-ece9442b415b"
- },
- "type": "invoice.finalized"
- },
- {
- "api_version": "2020-08-27",
- "created": 1010000006,
- "data": {
- "object": {
- "account_country": "US",
- "account_name": "Kandra Labs, Inc.",
- "account_tax_ids": null,
- "amount_due": 136000,
- "amount_paid": 0,
- "amount_remaining": 136000,
- "amount_shipping": 0,
- "application": null,
- "application_fee_amount": null,
- "attempt_count": 0,
- "attempted": false,
- "auto_advance": true,
- "automatic_tax": {
- "enabled": false,
- "status": null
- },
- "billing_reason": "manual",
- "charge": null,
- "collection_method": "charge_automatically",
- "created": 1010000007,
- "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_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNyU1RJOXNJdEJ4cjVwYVlwa1B5R1NCbnQwSnU4LDkwNzk3MzYx0200c4RVEEUg?s=ap",
- "id": "in_NORMALIZED00000000000001",
- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNyU1RJOXNJdEJ4cjVwYVlwa1B5R1NCbnQwSnU4LDkwNzk3MzYx0200c4RVEEUg/pdf?s=ap",
- "last_finalization_error": null,
- "latest_revision": null,
- "lines": {
- "data": [
- {
- "amount": 184000,
- "amount_excluding_tax": 184000,
- "currency": "usd",
- "description": "Zulip Cloud Standard",
- "discount_amounts": [],
- "discountable": false,
- "discounts": [],
- "id": "il_NORMALIZED00000000000001",
- "invoice_item": "ii_NORMALIZED00000000000001",
- "livemode": false,
- "metadata": {},
- "object": "line_item",
- "period": {
- "end": 1357095845,
- "start": 1325473445
- },
- "plan": null,
"price": {
"active": false,
"billing_scheme": "per_unit",
"created": 1010000008,
"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": 23,
- "subscription": null,
- "tax_amounts": [],
- "tax_rates": [],
- "type": "invoiceitem",
- "unit_amount_excluding_tax": "8000"
- },
- {
- "amount": -48000,
- "amount_excluding_tax": -48000,
- "currency": "usd",
- "description": "Payment (Card ending in 4242)",
- "discount_amounts": [],
- "discountable": false,
- "discounts": [],
- "id": "il_NORMALIZED00000000000002",
- "invoice_item": "ii_NORMALIZED00000000000002",
- "livemode": false,
- "metadata": {},
- "object": "line_item",
- "period": {
- "end": 1000000000,
- "start": 1000000000
- },
- "plan": null,
- "price": {
- "active": false,
- "billing_scheme": "per_unit",
- "created": 1010000009,
- "currency": "usd",
- "custom_unit_amount": null,
"id": "price_NORMALIZED00000000000002",
"livemode": false,
"lookup_key": null,
@@ -385,7 +162,7 @@
"livemode": false,
"metadata": {},
"next_payment_attempt": 1000000000,
- "number": "NORMALI-0001",
+ "number": "NORMALI-0002",
"object": "invoice",
"on_behalf_of": null,
"paid": false,
@@ -434,34 +211,17 @@
"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_1ODZbJDEQaroqDjs8kLCLXtA",
+ "id": "evt_1OIlUtDEQaroqDjsF2qVgEos",
"livemode": false,
"object": "event",
"pending_webhooks": 0,
"request": {
"id": "req_NORMALIZED0003",
- "idempotency_key": "8221c3a6-7b68-430b-aae7-ece9442b415b"
+ "idempotency_key": "56577100-e860-46d1-8ac7-89a10ddcb98d"
},
- "type": "invoice.updated"
+ "type": "invoice.finalized"
}
],
"has_more": false,
diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Invoice.create.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Invoice.create.1.json
index 7c81472b6ae..8cc023a4963 100644
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Invoice.create.1.json
+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Invoice.create.1.json
@@ -18,7 +18,7 @@
"billing_reason": "manual",
"charge": null,
"collection_method": "charge_automatically",
- "created": 1010000007,
+ "created": 1010000006,
"currency": "usd",
"custom_fields": null,
"customer": "cus_NORMALIZED0001",
@@ -68,7 +68,7 @@
"price": {
"active": false,
"billing_scheme": "per_unit",
- "created": 1010000008,
+ "created": 1010000007,
"currency": "usd",
"custom_unit_amount": null,
"id": "price_NORMALIZED00000000000001",
@@ -118,7 +118,7 @@
"price": {
"active": false,
"billing_scheme": "per_unit",
- "created": 1010000009,
+ "created": 1010000008,
"currency": "usd",
"custom_unit_amount": null,
"id": "price_NORMALIZED00000000000002",
diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Invoice.finalize_invoice.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Invoice.finalize_invoice.1.json
index 3fbd08c0ecb..29fd551e4b4 100644
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Invoice.finalize_invoice.1.json
+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Invoice.finalize_invoice.1.json
@@ -18,7 +18,7 @@
"billing_reason": "manual",
"charge": null,
"collection_method": "charge_automatically",
- "created": 1010000007,
+ "created": 1010000006,
"currency": "usd",
"custom_fields": null,
"customer": "cus_NORMALIZED0001",
@@ -40,9 +40,9 @@
"ending_balance": 0,
"footer": null,
"from_invoice": null,
- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNyU1RJOXNJdEJ4cjVwYVlwa1B5R1NCbnQwSnU4LDkwNzk3MzYx0200c4RVEEUg?s=ap",
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QNnpUM3F0VG1SREFmNEVJRnVBN3RoeDNvQ1F0TW10LDkyMDM0NzMx02000tnpwyOP?s=ap",
"id": "in_NORMALIZED00000000000001",
- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNyU1RJOXNJdEJ4cjVwYVlwa1B5R1NCbnQwSnU4LDkwNzk3MzYx0200c4RVEEUg/pdf?s=ap",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QNnpUM3F0VG1SREFmNEVJRnVBN3RoeDNvQ1F0TW10LDkyMDM0NzMx02000tnpwyOP/pdf?s=ap",
"last_finalization_error": null,
"latest_revision": null,
"lines": {
@@ -68,7 +68,7 @@
"price": {
"active": false,
"billing_scheme": "per_unit",
- "created": 1010000008,
+ "created": 1010000007,
"currency": "usd",
"custom_unit_amount": null,
"id": "price_NORMALIZED00000000000001",
@@ -118,7 +118,7 @@
"price": {
"active": false,
"billing_scheme": "per_unit",
- "created": 1010000009,
+ "created": 1010000008,
"currency": "usd",
"custom_unit_amount": null,
"id": "price_NORMALIZED00000000000002",
@@ -156,7 +156,7 @@
"livemode": false,
"metadata": {},
"next_payment_attempt": 1000000000,
- "number": "NORMALI-0001",
+ "number": "NORMALI-0002",
"object": "invoice",
"on_behalf_of": null,
"paid": false,
diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Invoice.list.2.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Invoice.list.2.json
index 12bf02738f6..19608f311fc 100644
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Invoice.list.2.json
+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--Invoice.list.2.json
@@ -20,7 +20,7 @@
"billing_reason": "manual",
"charge": null,
"collection_method": "charge_automatically",
- "created": 1010000007,
+ "created": 1010000006,
"currency": "usd",
"custom_fields": null,
"customer": "cus_NORMALIZED0001",
@@ -42,9 +42,9 @@
"ending_balance": 0,
"footer": null,
"from_invoice": null,
- "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNyU1RJOXNJdEJ4cjVwYVlwa1B5R1NCbnQwSnU4LDkwNzk3MzYz0200k2drkX3t?s=ap",
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QNnpUM3F0VG1SREFmNEVJRnVBN3RoeDNvQ1F0TW10LDkyMDM0NzMz02004FnCxFrq?s=ap",
"id": "in_NORMALIZED00000000000001",
- "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QMWNyU1RJOXNJdEJ4cjVwYVlwa1B5R1NCbnQwSnU4LDkwNzk3MzYz0200k2drkX3t/pdf?s=ap",
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_NORMALIZED000001/test_NORMALIZED01a3dERVFhcm9xRGpzLF9QNnpUM3F0VG1SREFmNEVJRnVBN3RoeDNvQ1F0TW10LDkyMDM0NzMz02004FnCxFrq/pdf?s=ap",
"last_finalization_error": null,
"latest_revision": null,
"lines": {
@@ -70,7 +70,7 @@
"price": {
"active": false,
"billing_scheme": "per_unit",
- "created": 1010000008,
+ "created": 1010000007,
"currency": "usd",
"custom_unit_amount": null,
"id": "price_NORMALIZED00000000000001",
@@ -120,7 +120,7 @@
"price": {
"active": false,
"billing_scheme": "per_unit",
- "created": 1010000009,
+ "created": 1010000008,
"currency": "usd",
"custom_unit_amount": null,
"id": "price_NORMALIZED00000000000002",
@@ -158,7 +158,7 @@
"livemode": false,
"metadata": {},
"next_payment_attempt": 1000000000,
- "number": "NORMALI-0001",
+ "number": "NORMALI-0002",
"object": "invoice",
"on_behalf_of": null,
"paid": false,
diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--InvoiceItem.create.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--InvoiceItem.create.1.json
index 5bcd160b6e1..ce279a5b2e6 100644
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--InvoiceItem.create.1.json
+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--InvoiceItem.create.1.json
@@ -19,7 +19,7 @@
"price": {
"active": false,
"billing_scheme": "per_unit",
- "created": 1010000009,
+ "created": 1010000008,
"currency": "usd",
"custom_unit_amount": null,
"id": "price_NORMALIZED00000000000002",
diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--InvoiceItem.create.2.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--InvoiceItem.create.2.json
index 1cc7e357e24..a35ac2e3687 100644
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--InvoiceItem.create.2.json
+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--InvoiceItem.create.2.json
@@ -19,7 +19,7 @@
"price": {
"active": false,
"billing_scheme": "per_unit",
- "created": 1010000008,
+ "created": 1010000007,
"currency": "usd",
"custom_unit_amount": null,
"id": "price_NORMALIZED00000000000001",
diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--PaymentIntent.create.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--PaymentIntent.create.1.json
index 9dc303bd5c8..385c6c0596d 100644
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--PaymentIntent.create.1.json
+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--PaymentIntent.create.1.json
@@ -76,7 +76,7 @@
},
"paid": true,
"payment_intent": "pi_NORMALIZED00000000000001",
- "payment_method": "pm_1ODZbCDEQaroqDjsGY2lvS6F",
+ "payment_method": "pm_1OIlUmDEQaroqDjs0AAGeLzU",
"payment_method_details": {
"card": {
"amount_authorized": 48000,
@@ -87,7 +87,7 @@
"cvc_check": "pass"
},
"country": "US",
- "exp_month": 11,
+ "exp_month": 12,
"exp_year": 2024,
"extended_authorization": {
"status": "disabled"
@@ -116,9 +116,10 @@
},
"type": "card"
},
+ "radar_options": {},
"receipt_email": "[email protected]",
"receipt_number": null,
- "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKK-236oGMgbWN2nUDmA6LBah4Z3Bgkq_Qz9wbuLNU_ZsAGIfmiipR-Ub-1CsDS0xXPp58vSA5hjm4z1e",
+ "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xN3ZUa3dERVFhcm9xRGpzKKj5qqsGMgabYrMy7qY6LBbxILhQWV5O1SayjyKwv--4CWfCdYX-glFcOh9y-Y5PeEAvfpEOpsmMtmwm",
"refunded": false,
"refunds": {
"data": [],
@@ -143,7 +144,7 @@
"total_count": 1,
"url": "/v1/charges?payment_intent=pi_NORMALIZED00000000000001"
},
- "client_secret": "pi_NORMALIZED00000000000001_secret_GhNIQ1qIF31zO8VOgP3Au41k0",
+ "client_secret": "pi_NORMALIZED00000000000001_secret_PINrM33YM9KIsKSnhNma2VvhN",
"confirmation_method": "automatic",
"created": 1010000001,
"currency": "usd",
@@ -170,7 +171,7 @@
"next_action": null,
"object": "payment_intent",
"on_behalf_of": null,
- "payment_method": "pm_1ODZbCDEQaroqDjsGY2lvS6F",
+ "payment_method": "pm_1OIlUmDEQaroqDjs0AAGeLzU",
"payment_method_configuration_details": null,
"payment_method_options": {
"card": {
diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--SetupIntent.create.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--SetupIntent.create.1.json
index 3acfec23e9f..9b429269d1c 100644
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--SetupIntent.create.1.json
+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--SetupIntent.create.1.json
@@ -2,21 +2,21 @@
"application": null,
"automatic_payment_methods": null,
"cancellation_reason": null,
- "client_secret": "seti_1ODZbCDEQaroqDjs5e7qZTsU_secret_P1cqQFyRzDI21LCG2tNQzAgNPyX69h3",
+ "client_secret": "seti_1OIlUmDEQaroqDjsdQg0j4LE_secret_P6zTb2zrPz8uA31ZJgmfP6aaqmy5BsU",
"created": 1010000003,
"customer": "cus_NORMALIZED0001",
"description": null,
"flow_directions": null,
- "id": "seti_1ODZbCDEQaroqDjs5e7qZTsU",
+ "id": "seti_1OIlUmDEQaroqDjsdQg0j4LE",
"last_setup_error": null,
- "latest_attempt": "setatt_1ODZbCDEQaroqDjsgBtwTg4F",
+ "latest_attempt": "setatt_1OIlUmDEQaroqDjsfKkUtoC5",
"livemode": false,
"mandate": null,
"metadata": {},
"next_action": null,
"object": "setup_intent",
"on_behalf_of": null,
- "payment_method": "pm_1ODZbCDEQaroqDjsGY2lvS6F",
+ "payment_method": "pm_1OIlUmDEQaroqDjs0AAGeLzU",
"payment_method_configuration_details": null,
"payment_method_options": {
"card": {
diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--SetupIntent.list.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--SetupIntent.list.1.json
index b68925eb8e3..1d36f30c6d3 100644
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--SetupIntent.list.1.json
+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--SetupIntent.list.1.json
@@ -4,12 +4,12 @@
"application": null,
"automatic_payment_methods": null,
"cancellation_reason": null,
- "client_secret": "seti_1ODZbBDEQaroqDjsBIzEWYNw_secret_P1cqttyLH17cMH0Ev7A0pd5xtYMJyl9",
- "created": 1010000002,
+ "client_secret": "seti_1OIlUkDEQaroqDjsV01nm9wQ_secret_P6zTBRnyll9DNh6H4t3U6x7gYPD7eiV",
+ "created": 1010000010,
"customer": "cus_NORMALIZED0001",
"description": null,
"flow_directions": null,
- "id": "seti_1ODZbBDEQaroqDjsBIzEWYNw",
+ "id": "seti_1OIlUkDEQaroqDjsV01nm9wQ",
"last_setup_error": null,
"latest_attempt": null,
"livemode": false,
diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--SetupIntent.retrieve.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--SetupIntent.retrieve.1.json
index 3acfec23e9f..9b429269d1c 100644
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--SetupIntent.retrieve.1.json
+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--SetupIntent.retrieve.1.json
@@ -2,21 +2,21 @@
"application": null,
"automatic_payment_methods": null,
"cancellation_reason": null,
- "client_secret": "seti_1ODZbCDEQaroqDjs5e7qZTsU_secret_P1cqQFyRzDI21LCG2tNQzAgNPyX69h3",
+ "client_secret": "seti_1OIlUmDEQaroqDjsdQg0j4LE_secret_P6zTb2zrPz8uA31ZJgmfP6aaqmy5BsU",
"created": 1010000003,
"customer": "cus_NORMALIZED0001",
"description": null,
"flow_directions": null,
- "id": "seti_1ODZbCDEQaroqDjs5e7qZTsU",
+ "id": "seti_1OIlUmDEQaroqDjsdQg0j4LE",
"last_setup_error": null,
- "latest_attempt": "setatt_1ODZbCDEQaroqDjsgBtwTg4F",
+ "latest_attempt": "setatt_1OIlUmDEQaroqDjsfKkUtoC5",
"livemode": false,
"mandate": null,
"metadata": {},
"next_action": null,
"object": "setup_intent",
"on_behalf_of": null,
- "payment_method": "pm_1ODZbCDEQaroqDjsGY2lvS6F",
+ "payment_method": "pm_1OIlUmDEQaroqDjs0AAGeLzU",
"payment_method_configuration_details": null,
"payment_method_options": {
"card": {
diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--checkout.Session.create.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--checkout.Session.create.1.json
index f8588d2ecac..6561cd0bd27 100644
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--checkout.Session.create.1.json
+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--checkout.Session.create.1.json
@@ -13,7 +13,7 @@
"client_secret": null,
"consent": null,
"consent_collection": null,
- "created": 1010000002,
+ "created": 1010000010,
"currency": null,
"currency_conversion": null,
"custom_fields": [],
@@ -34,7 +34,7 @@
},
"customer_email": null,
"expires_at": 1000000000,
- "id": "cs_test_NORMALIZED02htS61fSjAbYMo5ud8kjdoIpopM1iMXaIRbCMUDFtrFHhgb",
+ "id": "cs_test_NORMALIZED02LcQ7FboRfL6CvIJmITiEPinKLXZK5gNAAfOR4SpVVJ03mh",
"invoice": null,
"invoice_creation": null,
"livemode": false,
@@ -58,7 +58,7 @@
"enabled": false
},
"recovered_from": null,
- "setup_intent": "seti_1ODZbBDEQaroqDjsBIzEWYNw",
+ "setup_intent": "seti_1OIlUkDEQaroqDjsV01nm9wQ",
"shipping": null,
"shipping_address_collection": null,
"shipping_options": [],
@@ -69,5 +69,5 @@
"success_url": "http://zulip.testserver/billing/event_status?stripe_session_id={CHECKOUT_SESSION_ID}",
"total_details": null,
"ui_mode": "hosted",
- "url": "https://checkout.stripe.com/c/pay/cs_test_NORMALIZED02htS61fSjAbYMo5ud8kjdoIpopM1iMXaIRbCMUDFtrFHhgb#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"
+ "url": "https://checkout.stripe.com/c/pay/cs_test_NORMALIZED02LcQ7FboRfL6CvIJmITiEPinKLXZK5gNAAfOR4SpVVJ03mh#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"
}
diff --git a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--checkout.Session.list.1.json b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--checkout.Session.list.1.json
index 90c51f65b7c..e3e56b6a593 100644
--- a/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--checkout.Session.list.1.json
+++ b/corporate/tests/stripe_fixtures/upgrade_by_card_with_outdated_seat_count--checkout.Session.list.1.json
@@ -15,7 +15,7 @@
"client_secret": null,
"consent": null,
"consent_collection": null,
- "created": 1010000002,
+ "created": 1010000010,
"currency": null,
"currency_conversion": null,
"custom_fields": [],
@@ -36,7 +36,7 @@
},
"customer_email": null,
"expires_at": 1000000000,
- "id": "cs_test_NORMALIZED02htS61fSjAbYMo5ud8kjdoIpopM1iMXaIRbCMUDFtrFHhgb",
+ "id": "cs_test_NORMALIZED02LcQ7FboRfL6CvIJmITiEPinKLXZK5gNAAfOR4SpVVJ03mh",
"invoice": null,
"invoice_creation": null,
"livemode": false,
@@ -60,7 +60,7 @@
"enabled": false
},
"recovered_from": null,
- "setup_intent": "seti_1ODZbBDEQaroqDjsBIzEWYNw",
+ "setup_intent": "seti_1OIlUkDEQaroqDjsV01nm9wQ",
"shipping": null,
"shipping_address_collection": null,
"shipping_options": [],
@@ -71,7 +71,7 @@
"success_url": "http://zulip.testserver/billing/event_status?stripe_session_id={CHECKOUT_SESSION_ID}",
"total_details": null,
"ui_mode": "hosted",
- "url": "https://checkout.stripe.com/c/pay/cs_test_NORMALIZED02htS61fSjAbYMo5ud8kjdoIpopM1iMXaIRbCMUDFtrFHhgb#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"
+ "url": "https://checkout.stripe.com/c/pay/cs_test_NORMALIZED02LcQ7FboRfL6CvIJmITiEPinKLXZK5gNAAfOR4SpVVJ03mh#fidkdWxOYHwnPyd1blpxYHZxWl1UZjFOczZJXUE2PUpzUWNPV2ZpdlFzUCcpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBaZmppcGhrJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"
}
],
"has_more": true,
diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.py
index 6da41291ae7..863d25a3b59 100644
--- a/corporate/tests/test_stripe.py
+++ b/corporate/tests/test_stripe.py
@@ -45,6 +45,7 @@ from corporate.lib.stripe import (
AuditLogEventType,
BillingError,
BillingSessionAuditLogEventError,
+ InitialUpgradeRequest,
InvalidBillingScheduleError,
InvalidTierError,
RealmBillingSession,
@@ -1401,9 +1402,21 @@ class StripeTest(StripeTestCase):
hamlet = self.example_user("hamlet")
self.login_user(hamlet)
new_seat_count = 23
+ initial_upgrade_request = InitialUpgradeRequest(
+ manual_license_management=False,
+ tier=CustomerPlan.TIER_CLOUD_STANDARD,
+ )
+ billing_session = RealmBillingSession(hamlet)
+ _, context_when_upgrade_page_is_rendered = billing_session.get_initial_upgrade_context(
+ initial_upgrade_request
+ )
# Change the seat count while the user is going through the upgrade flow
with patch("corporate.lib.stripe.get_latest_seat_count", return_value=new_seat_count):
- self.add_card_and_upgrade(hamlet)
+ with patch(
+ "corporate.lib.stripe.RealmBillingSession.get_initial_upgrade_context",
+ return_value=(_, context_when_upgrade_page_is_rendered),
+ ):
+ self.add_card_and_upgrade(hamlet)
customer = Customer.objects.first()
assert customer is not None