5
5
from viam import logging
6
6
from viam .proto .app .billing import (
7
7
BillingServiceStub ,
8
+ CreateInvoiceAndChargeImmediatelyRequest ,
9
+ CreateInvoiceAndChargeImmediatelyResponse ,
8
10
GetCurrentMonthUsageRequest ,
9
11
GetCurrentMonthUsageResponse ,
10
12
GetInvoicePdfRequest ,
13
15
GetInvoicesSummaryResponse ,
14
16
GetOrgBillingInformationRequest ,
15
17
GetOrgBillingInformationResponse ,
16
- CreateInvoiceAndChargeImmediatelyRequest ,
17
- CreateInvoiceAndChargeImmediatelyResponse ,
18
18
)
19
19
20
20
LOGGER = logging .getLogger (__name__ )
@@ -144,7 +144,9 @@ async def get_org_billing_information(self, org_id: str, timeout: Optional[float
144
144
request = GetOrgBillingInformationRequest (org_id = org_id )
145
145
return await self ._billing_client .GetOrgBillingInformation (request , metadata = self ._metadata , timeout = timeout )
146
146
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 :
148
150
"""Create a flat fee invoice and charge the organization on the spot. The caller must be an owner of the organization being charged.
149
151
This function blocks until payment is confirmed, but will time out after 2 minutes if there is no confirmation.
150
152
@@ -158,5 +160,9 @@ async def create_invoice_and_charge_immediately(self, org_id_to_charge: str, amo
158
160
description (str): a short description of the charge to display on the invoice PDF (must be 100 characters or less)
159
161
org_id_for_branding (str): the organization whose branding to use in the invoice confirmation email
160
162
"""
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