Skip to content

Commit

Permalink
billing: Replace IDs and other values before writing fixtures.
Browse files Browse the repository at this point in the history
This makes a few other changes to the fixtures as well. Most are from API
updates, though I'm not sure why "Zulip Cloud Standard" got changed to
"Zulip Cloud Premium".

[Substantial edits by Rishi Gupta]
  • Loading branch information
hackerkid authored and ruchit2801 committed Feb 13, 2019
1 parent c9341a1 commit b73a8d0
Show file tree
Hide file tree
Showing 27 changed files with 378 additions and 315 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"account_balance": 0,
"created": 1539881153,
"created": 1542089871,
"currency": null,
"default_source": "card_1DMedAGh0CmXqmnwDLwrAV1v",
"default_source": "card_NORMALIZED00000000000001",
"delinquent": false,
"description": "zulip (Zulip Dev)",
"discount": null,
"email": "[email protected]",
"id": "cus_DoHBcS2dBGOP9t",
"invoice_prefix": "3B3F5D6",
"id": "cus_NORMALIZED0001",
"invoice_prefix": "NORMA01",
"livemode": false,
"metadata": {
"realm_id": "1",
Expand All @@ -29,14 +29,14 @@
"address_zip_check": "pass",
"brand": "Visa",
"country": "US",
"customer": "cus_DoHBcS2dBGOP9t",
"customer": "cus_NORMALIZED0001",
"cvc_check": "pass",
"dynamic_last4": null,
"exp_month": 3,
"exp_year": 2033,
"fingerprint": "6dAXT9VZvwro65EK",
"fingerprint": "NORMALIZED000001",
"funding": "credit",
"id": "card_1DMedAGh0CmXqmnwDLwrAV1v",
"id": "card_NORMALIZED00000000000001",
"last4": "4242",
"metadata": {},
"name": "Ada Starr",
Expand All @@ -47,14 +47,14 @@
"has_more": false,
"object": "list",
"total_count": 1,
"url": "/v1/customers/cus_DoHBcS2dBGOP9t/sources"
"url": "/v1/customers/cus_NORMALIZED0001/sources"
},
"subscriptions": {
"data": [],
"has_more": false,
"object": "list",
"total_count": 0,
"url": "/v1/customers/cus_DoHBcS2dBGOP9t/subscriptions"
"url": "/v1/customers/cus_NORMALIZED0001/subscriptions"
},
"tax_info": null,
"tax_info_verification": null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"account_balance": 0,
"created": 1539881153,
"created": 1542089871,
"currency": "usd",
"default_source": {
"address_city": "Pacific",
Expand All @@ -13,14 +13,14 @@
"address_zip_check": "pass",
"brand": "Visa",
"country": "US",
"customer": "cus_DoHBcS2dBGOP9t",
"customer": "cus_NORMALIZED0001",
"cvc_check": "pass",
"dynamic_last4": null,
"exp_month": 3,
"exp_year": 2033,
"fingerprint": "6dAXT9VZvwro65EK",
"fingerprint": "NORMALIZED000001",
"funding": "credit",
"id": "card_1DMedAGh0CmXqmnwDLwrAV1v",
"id": "card_NORMALIZED00000000000001",
"last4": "4242",
"metadata": {},
"name": "Ada Starr",
Expand All @@ -31,8 +31,8 @@
"description": "zulip (Zulip Dev)",
"discount": null,
"email": "[email protected]",
"id": "cus_DoHBcS2dBGOP9t",
"invoice_prefix": "3B3F5D6",
"id": "cus_NORMALIZED0001",
"invoice_prefix": "NORMA01",
"livemode": false,
"metadata": {
"realm_id": "1",
Expand All @@ -53,14 +53,14 @@
"address_zip_check": "pass",
"brand": "Visa",
"country": "US",
"customer": "cus_DoHBcS2dBGOP9t",
"customer": "cus_NORMALIZED0001",
"cvc_check": "pass",
"dynamic_last4": null,
"exp_month": 3,
"exp_year": 2033,
"fingerprint": "6dAXT9VZvwro65EK",
"fingerprint": "NORMALIZED000001",
"funding": "credit",
"id": "card_1DMedAGh0CmXqmnwDLwrAV1v",
"id": "card_NORMALIZED00000000000001",
"last4": "4242",
"metadata": {},
"name": "Ada Starr",
Expand All @@ -71,29 +71,30 @@
"has_more": false,
"object": "list",
"total_count": 1,
"url": "/v1/customers/cus_DoHBcS2dBGOP9t/sources"
"url": "/v1/customers/cus_NORMALIZED0001/sources"
},
"subscriptions": {
"data": [
{
"application_fee_percent": null,
"billing": "charge_automatically",
"billing_cycle_anchor": 1539881154,
"billing_cycle_anchor": 1542089872,
"cancel_at_period_end": false,
"canceled_at": null,
"created": 1539881154,
"current_period_end": 1571417154,
"current_period_start": 1539881154,
"customer": "cus_DoHBcS2dBGOP9t",
"created": 1542089872,
"current_period_end": 1573625872,
"current_period_start": 1542089872,
"customer": "cus_NORMALIZED0001",
"days_until_due": null,
"default_source": null,
"discount": null,
"ended_at": null,
"id": "sub_DoHBD49xn11qGo",
"id": "sub_NORMALIZED0001",
"items": {
"data": [
{
"created": 1539881154,
"id": "si_DoHB9flY9e7zrZ",
"created": 1542089873,
"id": "si_NORMALIZED0001",
"metadata": {},
"object": "subscription_item",
"plan": {
Expand All @@ -118,13 +119,13 @@
"usage_type": "licensed"
},
"quantity": 8,
"subscription": "sub_DoHBD49xn11qGo"
"subscription": "sub_NORMALIZED0001"
}
],
"has_more": false,
"object": "list",
"total_count": 1,
"url": "/v1/subscription_items?subscription=sub_DoHBD49xn11qGo"
"url": "/v1/subscription_items?subscription=sub_NORMALIZED0001"
},
"livemode": false,
"metadata": {},
Expand All @@ -151,7 +152,7 @@
"usage_type": "licensed"
},
"quantity": 8,
"start": 1539881154,
"start": 1542089872,
"status": "active",
"tax_percent": 0.0,
"trial_end": null,
Expand All @@ -161,7 +162,7 @@
"has_more": false,
"object": "list",
"total_count": 1,
"url": "/v1/customers/cus_DoHBcS2dBGOP9t/subscriptions"
"url": "/v1/customers/cus_NORMALIZED0001/subscriptions"
},
"tax_info": null,
"tax_info_verification": null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"account_balance": 0,
"created": 1539881153,
"created": 1542089871,
"currency": "usd",
"default_source": {
"address_city": "Pacific",
Expand All @@ -13,14 +13,14 @@
"address_zip_check": "pass",
"brand": "Visa",
"country": "US",
"customer": "cus_DoHBcS2dBGOP9t",
"customer": "cus_NORMALIZED0001",
"cvc_check": "pass",
"dynamic_last4": null,
"exp_month": 3,
"exp_year": 2033,
"fingerprint": "6dAXT9VZvwro65EK",
"fingerprint": "NORMALIZED000001",
"funding": "credit",
"id": "card_1DMedAGh0CmXqmnwDLwrAV1v",
"id": "card_NORMALIZED00000000000001",
"last4": "4242",
"metadata": {},
"name": "Ada Starr",
Expand All @@ -31,8 +31,8 @@
"description": "zulip (Zulip Dev)",
"discount": null,
"email": "[email protected]",
"id": "cus_DoHBcS2dBGOP9t",
"invoice_prefix": "3B3F5D6",
"id": "cus_NORMALIZED0001",
"invoice_prefix": "NORMA01",
"livemode": false,
"metadata": {
"realm_id": "1",
Expand All @@ -53,14 +53,14 @@
"address_zip_check": "pass",
"brand": "Visa",
"country": "US",
"customer": "cus_DoHBcS2dBGOP9t",
"customer": "cus_NORMALIZED0001",
"cvc_check": "pass",
"dynamic_last4": null,
"exp_month": 3,
"exp_year": 2033,
"fingerprint": "6dAXT9VZvwro65EK",
"fingerprint": "NORMALIZED000001",
"funding": "credit",
"id": "card_1DMedAGh0CmXqmnwDLwrAV1v",
"id": "card_NORMALIZED00000000000001",
"last4": "4242",
"metadata": {},
"name": "Ada Starr",
Expand All @@ -71,29 +71,30 @@
"has_more": false,
"object": "list",
"total_count": 1,
"url": "/v1/customers/cus_DoHBcS2dBGOP9t/sources"
"url": "/v1/customers/cus_NORMALIZED0001/sources"
},
"subscriptions": {
"data": [
{
"application_fee_percent": null,
"billing": "charge_automatically",
"billing_cycle_anchor": 1539881154,
"billing_cycle_anchor": 1542089872,
"cancel_at_period_end": false,
"canceled_at": null,
"created": 1539881154,
"current_period_end": 1571417154,
"current_period_start": 1539881154,
"customer": "cus_DoHBcS2dBGOP9t",
"created": 1542089872,
"current_period_end": 1573625872,
"current_period_start": 1542089872,
"customer": "cus_NORMALIZED0001",
"days_until_due": null,
"default_source": null,
"discount": null,
"ended_at": null,
"id": "sub_DoHBD49xn11qGo",
"id": "sub_NORMALIZED0001",
"items": {
"data": [
{
"created": 1539881154,
"id": "si_DoHB9flY9e7zrZ",
"created": 1542089873,
"id": "si_NORMALIZED0001",
"metadata": {},
"object": "subscription_item",
"plan": {
Expand All @@ -118,13 +119,13 @@
"usage_type": "licensed"
},
"quantity": 8,
"subscription": "sub_DoHBD49xn11qGo"
"subscription": "sub_NORMALIZED0001"
}
],
"has_more": false,
"object": "list",
"total_count": 1,
"url": "/v1/subscription_items?subscription=sub_DoHBD49xn11qGo"
"url": "/v1/subscription_items?subscription=sub_NORMALIZED0001"
},
"livemode": false,
"metadata": {},
Expand All @@ -151,7 +152,7 @@
"usage_type": "licensed"
},
"quantity": 8,
"start": 1539881154,
"start": 1542089872,
"status": "active",
"tax_percent": 0.0,
"trial_end": null,
Expand All @@ -161,7 +162,7 @@
"has_more": false,
"object": "list",
"total_count": 1,
"url": "/v1/customers/cus_DoHBcS2dBGOP9t/subscriptions"
"url": "/v1/customers/cus_NORMALIZED0001/subscriptions"
},
"tax_info": null,
"tax_info_verification": null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,29 @@
"charge": null,
"closed": false,
"currency": "usd",
"customer": "cus_DoHBcS2dBGOP9t",
"date": 1571417154,
"customer": "cus_NORMALIZED0001",
"date": 1573625872,
"default_source": null,
"description": "",
"discount": null,
"due_date": null,
"ending_balance": 0,
"finalized_at": null,
"forgiven": false,
"lines": {
"data": [
{
"amount": 64000,
"currency": "usd",
"description": "8 user \u00d7 Zulip Cloud Standard (at $80.00 / year)",
"description": "8 user \u00d7 Zulip Cloud Premium (at $80.00 / year)",
"discountable": true,
"id": "sli_31180ead97e161",
"id": "sli_NORMALIZED0001",
"livemode": false,
"metadata": {},
"object": "line_item",
"period": {
"end": 1603039554,
"start": 1571417154
"end": 1605248272,
"start": 1573625872
},
"plan": {
"active": true,
Expand All @@ -55,28 +57,30 @@
},
"proration": false,
"quantity": 8,
"subscription": "sub_DoHBD49xn11qGo",
"subscription_item": "si_DoHB9flY9e7zrZ",
"subscription": "sub_NORMALIZED0001",
"subscription_item": "si_NORMALIZED0001",
"type": "subscription"
}
],
"has_more": false,
"object": "list",
"total_count": 1,
"url": "/v1/invoices/upcoming/lines?customer=cus_DoHBcS2dBGOP9t"
"url": "/v1/invoices/upcoming/lines?customer=cus_NORMALIZED0001"
},
"livemode": false,
"metadata": {},
"next_payment_attempt": 1571420754,
"number": "3B3F5D6-0002",
"next_payment_attempt": 1573629472,
"number": "NORMALI-0001",
"object": "invoice",
"paid": false,
"period_end": 1571417154,
"period_start": 1539881154,
"payment_intent": null,
"period_end": 1573625872,
"period_start": 1542089872,
"receipt_number": null,
"starting_balance": 0,
"statement_descriptor": null,
"subscription": "sub_DoHBD49xn11qGo",
"status": "draft",
"subscription": "sub_NORMALIZED0001",
"subtotal": 64000,
"tax": 0,
"tax_percent": 0.0,
Expand Down
Loading

0 comments on commit b73a8d0

Please sign in to comment.