Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/api/src/campaign-types/campaign-types.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Public, RoleMatchingMode, Roles } from 'nest-keycloak-connect'
import { CampaignTypesService } from './campaign-types.service'
import { CreateCampaignTypeDto } from './dto/create-campaign-type.dto'
import { UpdateCampaignTypeDto } from './dto/update-campaign-type.dto'
import { ApiTags } from '@nestjs/swagger';
import { ApiTags } from '@nestjs/swagger'

@ApiTags('campaign-types')
@Controller('campaign-types')
Expand Down
8 changes: 8 additions & 0 deletions apps/api/src/stripe/stripe-api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ export class StripeApiClient {
return this.stripe.charges.retrieve(id, params, options)
}

// Webhook Endpoints
listWebhookEndpoints(
params?: Stripe.WebhookEndpointListParams,
options?: Stripe.RequestOptions,
) {
return this.stripe.webhookEndpoints.list(params, options)
}

// Invoices
retrieveInvoice(
id: string,
Expand Down
9 changes: 9 additions & 0 deletions apps/api/src/stripe/stripe.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@ export class StripeController {
return this.stripeService.cancelPaymentIntent(id, cancelPaymentIntentDto)
}

@Get('webhook-endpoints')
@Roles({
roles: [EditFinancialsRequests.role],
mode: RoleMatchingMode.ANY,
})
listWebhookEndpoints() {
return this.stripeService.listWebhookEndpoints()
}

@Get('prices')
@Public()
findPrices() {
Expand Down
10 changes: 10 additions & 0 deletions apps/api/src/stripe/stripe.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,16 @@ export class StripeService {
}
}

async listWebhookEndpoints() {
const list = await this.api.listWebhookEndpoints({ limit: 100 })
return list.data.map((ep) => ({
id: ep.id,
url: ep.url,
status: ep.status,
enabled_events: ep.enabled_events,
}))
}

async createCustomer(email: string, name: string, paymentMethod: Stripe.PaymentMethod) {
const customerLookup = await this.api.listCustomers({
email,
Expand Down
Loading