55from viam import logging
66from viam .proto .app .billing import (
77 BillingServiceStub ,
8+ CreateInvoiceAndChargeImmediatelyRequest ,
9+ CreateInvoiceAndChargeImmediatelyResponse ,
810 GetCurrentMonthUsageRequest ,
911 GetCurrentMonthUsageResponse ,
1012 GetInvoicePdfRequest ,
1315 GetInvoicesSummaryResponse ,
1416 GetOrgBillingInformationRequest ,
1517 GetOrgBillingInformationResponse ,
16- CreateInvoiceAndChargeImmediatelyRequest ,
17- CreateInvoiceAndChargeImmediatelyResponse ,
1818)
1919
2020LOGGER = logging .getLogger (__name__ )
@@ -144,7 +144,9 @@ async def get_org_billing_information(self, org_id: str, timeout: Optional[float
144144 request = GetOrgBillingInformationRequest (org_id = org_id )
145145 return await self ._billing_client .GetOrgBillingInformation (request , metadata = self ._metadata , timeout = timeout )
146146
147- async def create_invoice_and_charge_immediately (self , org_id_to_charge : str , amount : float , description : Optional [str ] = None , org_id_for_branding : Optional [str ] = None ) -> None :
147+ async def create_invoice_and_charge_immediately (
148+ self , org_id_to_charge : str , amount : float , description : Optional [str ] = None , org_id_for_branding : Optional [str ] = None
149+ ) -> None :
148150 """Create a flat fee invoice and charge the organization on the spot. The caller must be an owner of the organization being charged.
149151 This function blocks until payment is confirmed, but will time out after 2 minutes if there is no confirmation.
150152
@@ -158,5 +160,9 @@ async def create_invoice_and_charge_immediately(self, org_id_to_charge: str, amo
158160 description (str): a short description of the charge to display on the invoice PDF (must be 100 characters or less)
159161 org_id_for_branding (str): the organization whose branding to use in the invoice confirmation email
160162 """
161- request = CreateInvoiceAndChargeImmediatelyRequest (org_id_to_charge = org_id_to_charge , amount = amount , description = description , org_id_for_branding = org_id_for_branding )
162- _ : CreateInvoiceAndChargeImmediatelyResponse = await self ._billing_client .CreateInvoiceAndChargeImmediately (request , metadata = self ._metadata )
163+ request = CreateInvoiceAndChargeImmediatelyRequest (
164+ org_id_to_charge = org_id_to_charge , amount = amount , description = description , org_id_for_branding = org_id_for_branding
165+ )
166+ _ : CreateInvoiceAndChargeImmediatelyResponse = await self ._billing_client .CreateInvoiceAndChargeImmediately (
167+ request , metadata = self ._metadata
168+ )
0 commit comments