Class: Infrawrench::BillingCapacityNamespace

Inherits:
Object
  • Object
show all
Defined in:
lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs

Overview

client.billing.capacity

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ BillingCapacityNamespace

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of BillingCapacityNamespace.

Parameters:



1016
1017
1018
# File 'lib/infrawrench/client.rb', line 1016

def initialize(transport)
  @transport = transport
end

Instance Method Details

#checkout(org_id: nil, body: nil, request_options: nil) ⇒ Hash

Start a Stripe Checkout session for prepaid capacity slots

A capacity slot is one seat bought outright for a fixed term instead of rented monthly, and it grants paid-plan access on its own. This is a one-time payment, so the seats are granted by the checkout.session.completed webhook once Stripe confirms the payment — a 200 here only means the buyer was sent to a payment page. Rejected with 400 for complimentary organizations, and 503 when the deployment has no one-time capacity price configured.

POST /api/org/orgId/billing/capacity/checkout

Raises on 400: Bad request

Raises on 500: Server error

Raises on 503: A backing service this endpoint depends on is not available

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • body (Hash, nil) (defaults to: nil)

    Request body, shaped as CapacityCheckoutRequest.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • org_id: (String, nil) (defaults to: nil)
  • body: (capacity_checkout_request, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as StripeRedirectUrl — see sig/infrawrench/sdk.rbs.

Raises:



1044
1045
1046
1047
1048
1049
1050
1051
1052
# File 'lib/infrawrench/client.rb', line 1044

def checkout(org_id: nil, body: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/billing/capacity/checkout",
    path_params: { "orgId" => org_id },
    body: body,
    request_options: request_options
  )
end