import { Controller, Post, UseGuards } from '@nestjs/common' import { BasicAuthorizationGuard } from '../../../guards/basic_authorization.guard' import { PaymentMethod } from '../domain' @UseGuards(BasicAuthorizationGuard) @Controller('subscriptions/payment-method') export class PaymentMethodController { constructor(private readonly paymentMethod: PaymentMethod) {} @Post('client-session-token') async generateClientSessionToken(): Promise<{ session_token: string }> { return { session_token: await this.paymentMethod.generateClientSession() } } }