Class StripeClient
- java.lang.Object
-
- com.chrt.api.resources.billing.stripe.StripeClient
-
public class StripeClient extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected ClientOptionsclientOptions
-
Constructor Summary
Constructors Constructor Description StripeClient(ClientOptions clientOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CreateCheckoutSessionRescreateCheckoutSessionV1(CreateCheckoutSessionReq request)Creates a Stripe checkout session for a subscription against the Stripe product+price chosen by the frontend.CreateCheckoutSessionRescreateCheckoutSessionV1(CreateCheckoutSessionReq request, RequestOptions requestOptions)Creates a Stripe checkout session for a subscription against the Stripe product+price chosen by the frontend.CreateCustomerPortalSessionRescreateCustomerPortalSessionV1()Creates a Stripe customer-portal session so the org's admin can self-serve update card / view invoices / cancel subscription.CreateCustomerPortalSessionRescreateCustomerPortalSessionV1(RequestOptions requestOptions)Creates a Stripe customer-portal session so the org's admin can self-serve update card / view invoices / cancel subscription.RawStripeClientwithRawResponse()Get responses with HTTP metadata like headers
-
-
-
Field Detail
-
clientOptions
protected final ClientOptions clientOptions
-
-
Constructor Detail
-
StripeClient
public StripeClient(ClientOptions clientOptions)
-
-
Method Detail
-
withRawResponse
public RawStripeClient withRawResponse()
Get responses with HTTP metadata like headers
-
createCheckoutSessionV1
public CreateCheckoutSessionRes createCheckoutSessionV1(CreateCheckoutSessionReq request)
Creates a Stripe checkout session for a subscription against the Stripe product+price chosen by the frontend. Stripe rejects unknown/archived/mode-mismatched price IDs. Returns 409use_create_customer_portal_sessionif the org already has an active subscription in Stripe (source of truth -- bypasses any JWT staleness). FE should route those users to POST /billing/create-customer-portal-session/v1 to manage. authz: allowed_org_types=[provider] (shippers cannot subscribe -- they are never gated, paying would be a no-op), min_org_role=administrator (committing the company to recurring charges is a finance decision, not an operator one). | (CreateCheckoutSessionReq) -> (CreateCheckoutSessionRes)
-
createCheckoutSessionV1
public CreateCheckoutSessionRes createCheckoutSessionV1(CreateCheckoutSessionReq request, RequestOptions requestOptions)
Creates a Stripe checkout session for a subscription against the Stripe product+price chosen by the frontend. Stripe rejects unknown/archived/mode-mismatched price IDs. Returns 409use_create_customer_portal_sessionif the org already has an active subscription in Stripe (source of truth -- bypasses any JWT staleness). FE should route those users to POST /billing/create-customer-portal-session/v1 to manage. authz: allowed_org_types=[provider] (shippers cannot subscribe -- they are never gated, paying would be a no-op), min_org_role=administrator (committing the company to recurring charges is a finance decision, not an operator one). | (CreateCheckoutSessionReq) -> (CreateCheckoutSessionRes)
-
createCustomerPortalSessionV1
public CreateCustomerPortalSessionRes createCustomerPortalSessionV1()
Creates a Stripe customer-portal session so the org's admin can self-serve update card / view invoices / cancel subscription. authz: allowed_org_types=[provider], min_org_role=administrator (same gate as create-checkout-session — cancelling/updating-card has the same financial weight as subscribing). Returns 404use_create_checkout_sessionif the org has no Stripe customer. POST /billing/create-checkout-session/v1 first. | (no body) -> (CreateCustomerPortalSessionRes)
-
createCustomerPortalSessionV1
public CreateCustomerPortalSessionRes createCustomerPortalSessionV1(RequestOptions requestOptions)
Creates a Stripe customer-portal session so the org's admin can self-serve update card / view invoices / cancel subscription. authz: allowed_org_types=[provider], min_org_role=administrator (same gate as create-checkout-session — cancelling/updating-card has the same financial weight as subscribing). Returns 404use_create_checkout_sessionif the org has no Stripe customer. POST /billing/create-checkout-session/v1 first. | (no body) -> (CreateCustomerPortalSessionRes)
-
-