-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(auth): added billing backend support (#1289)
* misc(auth): add async-stripe dep * feat(auth): added update tier handler The update tier accounts for changing the tier to Pro, requiring a payload with a completed checkout session in case of upgrading to Pro. * feat(auth): check subscription validity when getting user * feat(common): user Response with subscription id if any * test(auth): added integration tests for pro upgrade/downgrade * auth: added DEVELOPING notes and STRIPE_SECRET_KEY in Makefile * fix(auth): CI for auth fails because of memory preassure * auth: address O review comment on builder * circleci: added STRIPE_SECRET_KEY deploy images param * auth: change how we decode * auth: remove debug event * DEVELOPING: adjust testing Pro tier notes * auth: fix field name * auth: async-stripe relies on rustls and installed certs * auth: added executable rights to prepare.sh * auth: update first the mirrors * auth: add non-interactive flag * auth: fix prepare_args passing * auth: bump 0.28.1 && add explicit package version * common: bump to 0.28.1
1 parent
bdbf92f
commit b37b03f
Showing
26 changed files
with
1,279 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE users ADD COLUMN subscription_id TEXT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env sh | ||
|
||
############################################################################################## | ||
# This file is run by Containerfile for extra preparation steps for this crate's final image # | ||
############################################################################################## | ||
|
||
# We're using rustls for the async-stripe crate and that needs certificates installed. | ||
apt-get update | ||
apt install -y ca-certificates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
mod auth; | ||
mod helpers; | ||
mod session; | ||
mod stripe; | ||
mod users; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
pub(crate) const MOCKED_ACTIVE_SUBSCRIPTION: &str = r#"{ | ||
"id": "sub_1Nw8xOD8t1tt0S3DtwAuOVp6", | ||
"object": "subscription", | ||
"application": null, | ||
"application_fee_percent": null, | ||
"automatic_tax": { | ||
"enabled": false | ||
}, | ||
"billing_cycle_anchor": 1696102566, | ||
"billing_thresholds": null, | ||
"cancel_at": null, | ||
"cancel_at_period_end": false, | ||
"canceled_at": null, | ||
"cancellation_details": { | ||
"comment": null, | ||
"feedback": null, | ||
"reason": null | ||
}, | ||
"collection_method": "charge_automatically", | ||
"created": 1696102566, | ||
"currency": "ron", | ||
"current_period_end": 1698694566, | ||
"current_period_start": 1696102566, | ||
"customer": "cus_OjcBtb9CGkRN0Q", | ||
"days_until_due": null, | ||
"default_payment_method": "pm_1Nw8xND8t1tt0S3DdoPw8WzZ", | ||
"default_source": null, | ||
"default_tax_rates": [], | ||
"description": null, | ||
"discount": null, | ||
"ended_at": null, | ||
"items": { | ||
"object": "list", | ||
"data": [ | ||
{ | ||
"id": "si_OjcB0PrsQ861FB", | ||
"object": "subscription_item", | ||
"billing_thresholds": null, | ||
"created": 1696102567, | ||
"metadata": {}, | ||
"plan": { | ||
"id": "price_1NvdmxD8t1tt0S3DBi2jTI92", | ||
"object": "plan", | ||
"active": true, | ||
"aggregate_usage": null, | ||
"amount": 10000, | ||
"amount_decimal": "10000", | ||
"billing_scheme": "per_unit", | ||
"created": 1695982755, | ||
"currency": "ron", | ||
"interval": "month", | ||
"interval_count": 1, | ||
"livemode": false, | ||
"metadata": {}, | ||
"nickname": null, | ||
"product": "prod_Oj5yfmphYbZ8RE", | ||
"tiers_mode": null, | ||
"transform_usage": null, | ||
"trial_period_days": null, | ||
"usage_type": "licensed" | ||
}, | ||
"price": { | ||
"id": "price_1NvdmxD8t1tt0S3DBi2jTI92", | ||
"object": "price", | ||
"active": true, | ||
"billing_scheme": "per_unit", | ||
"created": 1695982755, | ||
"currency": "ron", | ||
"custom_unit_amount": null, | ||
"livemode": false, | ||
"lookup_key": null, | ||
"metadata": {}, | ||
"nickname": null, | ||
"product": "prod_Oj5yfmphYbZ8RE", | ||
"recurring": { | ||
"aggregate_usage": null, | ||
"interval": "month", | ||
"interval_count": 1, | ||
"trial_period_days": null, | ||
"usage_type": "licensed" | ||
}, | ||
"tax_behavior": "unspecified", | ||
"tiers_mode": null, | ||
"transform_quantity": null, | ||
"type": "recurring", | ||
"unit_amount": 10000, | ||
"unit_amount_decimal": "10000" | ||
}, | ||
"quantity": 1, | ||
"subscription": "sub_1Nw8xOD8t1tt0S3DtwAuOVp6", | ||
"tax_rates": [] | ||
} | ||
], | ||
"has_more": false, | ||
"total_count": 1, | ||
"url": "/v1/subscription_items?subscription=sub_1Nw8xOD8t1tt0S3DtwAuOVp6" | ||
}, | ||
"latest_invoice": "in_1Nw8xOD8t1tt0S3DU4YDQ8ok", | ||
"livemode": false, | ||
"metadata": {}, | ||
"next_pending_invoice_item_invoice": null, | ||
"on_behalf_of": null, | ||
"pause_collection": null, | ||
"payment_settings": { | ||
"payment_method_options": null, | ||
"payment_method_types": null, | ||
"save_default_payment_method": "off" | ||
}, | ||
"pending_invoice_item_interval": null, | ||
"pending_setup_intent": null, | ||
"pending_update": null, | ||
"plan": { | ||
"id": "price_1NvdmxD8t1tt0S3DBi2jTI92", | ||
"object": "plan", | ||
"active": true, | ||
"aggregate_usage": null, | ||
"amount": 10000, | ||
"amount_decimal": "10000", | ||
"billing_scheme": "per_unit", | ||
"created": 1695982755, | ||
"currency": "ron", | ||
"interval": "month", | ||
"interval_count": 1, | ||
"livemode": false, | ||
"metadata": {}, | ||
"nickname": null, | ||
"product": "prod_Oj5yfmphYbZ8RE", | ||
"tiers_mode": null, | ||
"transform_usage": null, | ||
"trial_period_days": null, | ||
"usage_type": "licensed" | ||
}, | ||
"quantity": 1, | ||
"schedule": null, | ||
"start_date": 1696102566, | ||
"status": "active", | ||
"test_clock": null, | ||
"transfer_data": null, | ||
"trial_end": null, | ||
"trial_settings": { | ||
"end_behavior": { | ||
"missing_payment_method": "create_invoice" | ||
} | ||
}, | ||
"trial_start": null | ||
} | ||
"#; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
pub(crate) const MOCKED_COMPLETED_CHECKOUT_SESSION: &str = r#"{ | ||
"id": "cs_test_a1nmf3TXSDqYScpNLEroolP1ugCtk8Rx7kivUjYHLUdmjyJoociglcbN8q", | ||
"object": "checkout.session", | ||
"after_expiration": null, | ||
"allow_promotion_codes": null, | ||
"amount_subtotal": 10000, | ||
"amount_total": 10000, | ||
"automatic_tax": { | ||
"enabled": false, | ||
"status": null | ||
}, | ||
"billing_address_collection": null, | ||
"cancel_url": "https://example.com/cancel", | ||
"client_reference_id": null, | ||
"consent": null, | ||
"consent_collection": null, | ||
"created": 1696102521, | ||
"currency": "ron", | ||
"currency_conversion": null, | ||
"custom_fields": [], | ||
"custom_text": { | ||
"shipping_address": null, | ||
"submit": null, | ||
"terms_of_service_acceptance": null | ||
}, | ||
"customer": "cus_OjcBtb9CGkRN0Q", | ||
"customer_creation": "always", | ||
"customer_details": { | ||
"address": { | ||
"city": null, | ||
"country": "RO", | ||
"line1": null, | ||
"line2": null, | ||
"postal_code": null, | ||
"state": null | ||
}, | ||
"email": "iulian@shuttle.rs", | ||
"name": "Iulian Barbu", | ||
"phone": null, | ||
"tax_exempt": "none", | ||
"tax_ids": [] | ||
}, | ||
"customer_email": null, | ||
"expires_at": 1696188921, | ||
"invoice": "in_1Nw8xOD8t1tt0S3DU4YDQ8ok", | ||
"invoice_creation": null, | ||
"livemode": false, | ||
"locale": null, | ||
"metadata": {}, | ||
"mode": "subscription", | ||
"payment_intent": null, | ||
"payment_link": null, | ||
"payment_method_collection": "always", | ||
"payment_method_configuration_details": null, | ||
"payment_method_options": null, | ||
"payment_method_types": [ | ||
"card" | ||
], | ||
"payment_status": "paid", | ||
"phone_number_collection": { | ||
"enabled": false | ||
}, | ||
"recovered_from": null, | ||
"setup_intent": null, | ||
"shipping_address_collection": null, | ||
"shipping_cost": null, | ||
"shipping_details": null, | ||
"shipping_options": [], | ||
"status": "complete", | ||
"submit_type": null, | ||
"subscription": "sub_1Nw8xOD8t1tt0S3DtwAuOVp6", | ||
"success_url": "https://example.com/success?session_id={CHECKOUT_SESSION_ID}", | ||
"total_details": { | ||
"amount_discount": 0, | ||
"amount_shipping": 0, | ||
"amount_tax": 0 | ||
}, | ||
"url": null | ||
} | ||
"#; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
pub(crate) const MOCKED_INCOMPLETE_CHECKOUT_SESSION: &str = r#"{ | ||
"id": "cs_test_a11rHy7qRTwFZuj4lBHso3Frq7CMZheZYcYqNXEFBV4oddxXFLx7bT911p", | ||
"object": "checkout.session", | ||
"after_expiration": null, | ||
"allow_promotion_codes": false, | ||
"amount_subtotal": 10000, | ||
"amount_total": 10000, | ||
"automatic_tax": { | ||
"enabled": false, | ||
"status": null | ||
}, | ||
"billing_address_collection": "auto", | ||
"cancel_url": "https://stripe.com", | ||
"client_reference_id": null, | ||
"consent": null, | ||
"consent_collection": { | ||
"promotions": "none", | ||
"terms_of_service": "none" | ||
}, | ||
"created": 1696098429, | ||
"currency": "ron", | ||
"currency_conversion": null, | ||
"custom_fields": [], | ||
"custom_text": { | ||
"shipping_address": null, | ||
"submit": null, | ||
"terms_of_service_acceptance": null | ||
}, | ||
"customer": null, | ||
"customer_creation": "if_required", | ||
"customer_details": null, | ||
"customer_email": null, | ||
"expires_at": 1696184829, | ||
"invoice": null, | ||
"invoice_creation": null, | ||
"livemode": false, | ||
"locale": "auto", | ||
"metadata": {}, | ||
"mode": "subscription", | ||
"payment_intent": null, | ||
"payment_link": "plink_1Nw7sYD8t1tt0S3DHQRms10g", | ||
"payment_method_collection": "always", | ||
"payment_method_configuration_details": null, | ||
"payment_method_options": null, | ||
"payment_method_types": [ | ||
"card" | ||
], | ||
"payment_status": "unpaid", | ||
"phone_number_collection": { | ||
"enabled": false | ||
}, | ||
"recovered_from": null, | ||
"setup_intent": null, | ||
"shipping_address_collection": null, | ||
"shipping_cost": null, | ||
"shipping_details": null, | ||
"shipping_options": [], | ||
"status": "open", | ||
"submit_type": "auto", | ||
"subscription": null, | ||
"success_url": "https://stripe.com", | ||
"total_details": { | ||
"amount_discount": 0, | ||
"amount_shipping": 0, | ||
"amount_tax": 0 | ||
}, | ||
"url": "https://checkout.stripe.com/c/pay/cs_test_a11rHy7qRTwFZuj4lBHso3Frq7CMZheZYcYqNXEFBV4oddxXFLx7bT911p#fidkdWxOYHwnPyd1blpxYHZxWjA0S3NhbkhBPXE0cXE1VjZBMm4xSjBpMm9LVEFhczBBVjF8XVx1aTdAVlxiUGlyN0J1d2xjXTU2cXNoNExzbzYwS1VufDZOS0IwV1ZUQ290RjxycXxTVEpjNTVIZnZXdVdkUycpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl" | ||
} | ||
"#; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use self::{ | ||
active_subscription::MOCKED_ACTIVE_SUBSCRIPTION, | ||
completed_checkout_session::MOCKED_COMPLETED_CHECKOUT_SESSION, | ||
incomplete_checkout_session::MOCKED_INCOMPLETE_CHECKOUT_SESSION, | ||
overdue_payment_checkout_session::MOCKED_OVERDUE_PAYMENT_CHECKOUT_SESSION, | ||
past_due_subscription::MOCKED_PAST_DUE_SUBSCRIPTION, | ||
}; | ||
|
||
mod active_subscription; | ||
mod completed_checkout_session; | ||
mod incomplete_checkout_session; | ||
mod overdue_payment_checkout_session; | ||
mod past_due_subscription; | ||
|
||
pub(crate) const MOCKED_SUBSCRIPTIONS: &[&str] = | ||
&[MOCKED_ACTIVE_SUBSCRIPTION, MOCKED_PAST_DUE_SUBSCRIPTION]; | ||
|
||
pub(crate) const MOCKED_CHECKOUT_SESSIONS: &[&str] = &[ | ||
MOCKED_COMPLETED_CHECKOUT_SESSION, | ||
MOCKED_INCOMPLETE_CHECKOUT_SESSION, | ||
MOCKED_OVERDUE_PAYMENT_CHECKOUT_SESSION, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// This is a synthetic checkout session. It is used to simplify the code path for downgrading to `PendingPaymentPro` tier | ||
// when user payment is overdue. | ||
|
||
pub(crate) const MOCKED_OVERDUE_PAYMENT_CHECKOUT_SESSION: &str = r#"{ | ||
"id": "cs_test_a11rHy7qRTwFZuj4lBHso3Frq7CMZheZYcYqNXEFBV4oddxXFLx7bT911p", | ||
"object": "checkout.session", | ||
"after_expiration": null, | ||
"allow_promotion_codes": false, | ||
"amount_subtotal": 10000, | ||
"amount_total": 10000, | ||
"automatic_tax": { | ||
"enabled": false, | ||
"status": null | ||
}, | ||
"billing_address_collection": "auto", | ||
"cancel_url": "https://stripe.com", | ||
"client_reference_id": null, | ||
"consent": null, | ||
"consent_collection": { | ||
"promotions": "none", | ||
"terms_of_service": "none" | ||
}, | ||
"created": 1696098429, | ||
"currency": "ron", | ||
"currency_conversion": null, | ||
"custom_fields": [], | ||
"custom_text": { | ||
"shipping_address": null, | ||
"submit": null, | ||
"terms_of_service_acceptance": null | ||
}, | ||
"customer": null, | ||
"customer_creation": "if_required", | ||
"customer_details": null, | ||
"customer_email": null, | ||
"expires_at": 1696184829, | ||
"invoice": null, | ||
"invoice_creation": null, | ||
"livemode": false, | ||
"locale": "auto", | ||
"metadata": {}, | ||
"mode": "subscription", | ||
"payment_intent": null, | ||
"payment_link": "plink_1Nw7sYD8t1tt0S3DHQRms10g", | ||
"payment_method_collection": "always", | ||
"payment_method_configuration_details": null, | ||
"payment_method_options": null, | ||
"payment_method_types": [ | ||
"card" | ||
], | ||
"payment_status": "unpaid", | ||
"phone_number_collection": { | ||
"enabled": false | ||
}, | ||
"recovered_from": null, | ||
"setup_intent": null, | ||
"shipping_address_collection": null, | ||
"shipping_cost": null, | ||
"shipping_details": null, | ||
"shipping_options": [], | ||
"status": "complete", | ||
"submit_type": "auto", | ||
"subscription": "sub_1NwObED8t1tt0S3Dq0IYOEsa", | ||
"success_url": "https://stripe.com", | ||
"total_details": { | ||
"amount_discount": 0, | ||
"amount_shipping": 0, | ||
"amount_tax": 0 | ||
}, | ||
"url": "https://checkout.stripe.com/c/pay/cs_test_a11rHy7qRTwFZuj4lBHso3Frq7CMZheZYcYqNXEFBV4oddxXFLx7bT911p#fidkdWxOYHwnPyd1blpxYHZxWjA0S3NhbkhBPXE0cXE1VjZBMm4xSjBpMm9LVEFhczBBVjF8XVx1aTdAVlxiUGlyN0J1d2xjXTU2cXNoNExzbzYwS1VufDZOS0IwV1ZUQ290RjxycXxTVEpjNTVIZnZXdVdkUycpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl" | ||
} | ||
"#; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
pub(crate) const MOCKED_PAST_DUE_SUBSCRIPTION: &str = r#"{ | ||
"id": "sub_1NwObED8t1tt0S3Dq0IYOEsa", | ||
"object": "subscription", | ||
"application": null, | ||
"application_fee_percent": null, | ||
"automatic_tax": { | ||
"enabled": false | ||
}, | ||
"billing_cycle_anchor": 1698930360, | ||
"billing_thresholds": null, | ||
"cancel_at": null, | ||
"cancel_at_period_end": false, | ||
"canceled_at": null, | ||
"cancellation_details": { | ||
"comment": null, | ||
"feedback": null, | ||
"reason": null | ||
}, | ||
"collection_method": "send_invoice", | ||
"created": 1698930360, | ||
"currency": "ron", | ||
"current_period_end": 1709384760, | ||
"current_period_start": 1706879160, | ||
"customer": "cus_OjsLL84gFdbFPP", | ||
"days_until_due": 30, | ||
"default_payment_method": null, | ||
"default_source": null, | ||
"default_tax_rates": [], | ||
"description": null, | ||
"discount": null, | ||
"ended_at": null, | ||
"items": { | ||
"object": "list", | ||
"data": [ | ||
{ | ||
"id": "si_OjsLE9Q9sTZMtM", | ||
"object": "subscription_item", | ||
"billing_thresholds": null, | ||
"created": 1698930360, | ||
"metadata": {}, | ||
"plan": { | ||
"id": "price_1NvdmxD8t1tt0S3DBi2jTI92", | ||
"object": "plan", | ||
"active": true, | ||
"aggregate_usage": null, | ||
"amount": 10000, | ||
"amount_decimal": "10000", | ||
"billing_scheme": "per_unit", | ||
"created": 1695982755, | ||
"currency": "ron", | ||
"interval": "month", | ||
"interval_count": 1, | ||
"livemode": false, | ||
"metadata": {}, | ||
"nickname": null, | ||
"product": "prod_Oj5yfmphYbZ8RE", | ||
"tiers_mode": null, | ||
"transform_usage": null, | ||
"trial_period_days": null, | ||
"usage_type": "licensed" | ||
}, | ||
"price": { | ||
"id": "price_1NvdmxD8t1tt0S3DBi2jTI92", | ||
"object": "price", | ||
"active": true, | ||
"billing_scheme": "per_unit", | ||
"created": 1695982755, | ||
"currency": "ron", | ||
"custom_unit_amount": null, | ||
"livemode": false, | ||
"lookup_key": null, | ||
"metadata": {}, | ||
"nickname": null, | ||
"product": "prod_Oj5yfmphYbZ8RE", | ||
"recurring": { | ||
"aggregate_usage": null, | ||
"interval": "month", | ||
"interval_count": 1, | ||
"trial_period_days": null, | ||
"usage_type": "licensed" | ||
}, | ||
"tax_behavior": "unspecified", | ||
"tiers_mode": null, | ||
"transform_quantity": null, | ||
"type": "recurring", | ||
"unit_amount": 10000, | ||
"unit_amount_decimal": "10000" | ||
}, | ||
"quantity": 1, | ||
"subscription": "sub_1NwObED8t1tt0S3Dq0IYOEsa", | ||
"tax_rates": [] | ||
} | ||
], | ||
"has_more": false, | ||
"total_count": 1, | ||
"url": "/v1/subscription_items?subscription=sub_1NwObED8t1tt0S3Dq0IYOEsa" | ||
}, | ||
"latest_invoice": "in_1NwOgYD8t1tt0S3DWcXcslkk", | ||
"livemode": false, | ||
"metadata": {}, | ||
"next_pending_invoice_item_invoice": null, | ||
"on_behalf_of": null, | ||
"pause_collection": null, | ||
"payment_settings": { | ||
"payment_method_options": null, | ||
"payment_method_types": null, | ||
"save_default_payment_method": "off" | ||
}, | ||
"pending_invoice_item_interval": null, | ||
"pending_setup_intent": null, | ||
"pending_update": null, | ||
"plan": { | ||
"id": "price_1NvdmxD8t1tt0S3DBi2jTI92", | ||
"object": "plan", | ||
"active": true, | ||
"aggregate_usage": null, | ||
"amount": 10000, | ||
"amount_decimal": "10000", | ||
"billing_scheme": "per_unit", | ||
"created": 1695982755, | ||
"currency": "ron", | ||
"interval": "month", | ||
"interval_count": 1, | ||
"livemode": false, | ||
"metadata": {}, | ||
"nickname": null, | ||
"product": "prod_Oj5yfmphYbZ8RE", | ||
"tiers_mode": null, | ||
"transform_usage": null, | ||
"trial_period_days": null, | ||
"usage_type": "licensed" | ||
}, | ||
"quantity": 1, | ||
"schedule": null, | ||
"start_date": 1698930360, | ||
"status": "past_due", | ||
"test_clock": "clock_1NwOQ2D8t1tt0S3DShKPQWLB", | ||
"transfer_data": null, | ||
"trial_end": null, | ||
"trial_settings": { | ||
"end_behavior": { | ||
"missing_payment_method": "create_invoice" | ||
} | ||
}, | ||
"trial_start": null | ||
} | ||
"#; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters