Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

Commit

Stripe's checkout and receipts call the plan "g1t plan for <workspace>", not "g1t g1t for <workspace>" (plan_line_name), and the plan's card on Billing says the usage month apart from when the plan renews ("Usage month Oct 1 - Oct 31; the plan renews Nov 15"), since a plan bought mid-month renews on its own day. Seen in the live rehearsal on syntaqx (#47). Checked: cargo test -p g1t-billing (290), the site's typecheck and tests (952).

G1t-Session:
ses_01m4y8v7hae5csmqcavv6wprjy
syntaqxcommitted Parentab64e5cBrowse files
2 files+10−20/2 viewed
+1−1
179179 }
180180 about={
181181 on
182− ? `Billing period ${period}. One price for the workspace, never per seat.`
182+ ? `Usage month ${period}${subscription?.periodEnd ? `; the plan renews ${endsOn(subscription.periodEnd)}` : ""}. One price for the workspace, never per seat.`
183183 : "The forge is free: repositories, issues, pull requests, reviews, search and the audit log. Checks, workflows and deployments need the plan, or the trial."
184184 }
185185 aside={
+9−1
901901 ("subscription_data[metadata][workspace]", workspace.to_owned()),
902902 ("subscription_data[metadata][feature]", feature.to_owned()),
903903 ];
904− fields.extend(page_line(monthly_cents, format!("g1t {title} for {workspace}"), None, true));
904+ fields.extend(page_line(monthly_cents, plan_line_name(title, workspace), None, true));
905905 fields.extend(checkout_tax_fields(customer));
906906 if let Some(customer) = customer {
907907 fields.push(("customer", customer.to_owned()));
909909 fields
910910 }
911911
912+/// What a plan is called on Stripe's page and the receipts: "g1t plan for
913+/// acme", "g1t Deployments plan for acme"; never "g1t g1t".
914+pub(crate) fn plan_line_name(title: &str, workspace: &str) -> String {
915+ if title == "g1t" { format!("g1t plan for {workspace}") } else { format!("g1t {title} plan for {workspace}") }
916+}
917+
912918 /// A card check's page's fields: setup mode, nothing charged, so nothing
913919 /// to tax. Setup mode takes no line items and no amount. The billing
914920 /// address is asked for all the same, and copied onto the customer once
11961202 fn untaxed_requests_lose_only_automatic_tax() {
11971203 let body = form(&[("mode", "payment".to_owned()), ("automatic_tax[enabled]", "true".to_owned()), ("tax_id_collection[enabled]", "true".to_owned())]);
11981204 assert_eq!(without_automatic_tax(&body), form(&[("mode", "payment".to_owned()), ("tax_id_collection[enabled]", "true".to_owned())]));
1205+ assert_eq!(plan_line_name("g1t", "acme"), "g1t plan for acme");
1206+ assert_eq!(plan_line_name("Deployments", "acme"), "g1t Deployments plan for acme");
11991207 assert!(taxed_path("/checkout/sessions") && taxed_path("/invoices") && taxed_path("/subscriptions"));
12001208 // An enrollment converting to the plan turns tax on by updating it.
12011209 assert!(taxed_path("/subscriptions/sub_1") && taxed_path("/subscriptions/sub_1?expand[]=latest_invoice"));

Comments

Sign in to comment.