Feat/billing enhancement (#2239)

Co-authored-by: takatost <takatost@gmail.com>
This commit is contained in:
Garfield Dai
2024-01-26 18:26:15 +08:00
committed by GitHub
parent 2fc0dcc10a
commit bb5d5fc683
8 changed files with 43 additions and 41 deletions

View File

@@ -186,10 +186,11 @@ class ModelProviderPaymentCheckoutUrlApi(Resource):
def get(self, provider: str):
if provider != 'anthropic':
raise ValueError(f'provider name {provider} is invalid')
BillingService.is_tenant_owner_or_admin(current_user)
data = BillingService.get_model_provider_payment_link(provider_name=provider,
tenant_id=current_user.current_tenant_id,
account_id=current_user.id)
account_id=current_user.id,
prefilled_email=current_user.email)
return data