@cosmosapp/pay_sdkDefinitionenServer

WebhookEndpoint

A registered webhook endpoint. Note: the signing secret is only ever present on the instance returned by create() / rotateSecret() — list/get responses never…

A registered webhook endpoint. Note: the signing secret is only ever present on the instance returned by create() / rotateSecret() — list/get responses never include it.

Constructor

WebhookEndpoint

constructor(client: Client, data: WebhookEndpointData | WebhookEndpointWithSecretData)

Parameters

  • client: Client
  • data: WebhookEndpointData | WebhookEndpointWithSecretData

Properties

url

url: string

description

description: string | null

enabled

enabled: boolean

eventTypes

eventTypes: WebhookEventType[]

createdAt

createdAt: Date

updatedAt

updatedAt: Date

secret

HMAC signing secret — only set on create/rotate responses.

readonly secret: string | null

protected

protected _patch(data: WebhookEndpointData | WebhookEndpointWithSecretData): this

get

Whether the endpoint receives all events (empty subscription).

get receivesAllEvents(): boolean

deleted

deleted: boolean

member

}>

Methods

fetch()

Re-fetch this endpoint.

fetch(): Promise<WebhookEndpoint>

Returns Promise<WebhookEndpoint>

edit()

Update url/description/enabled/eventTypes. Mutates and returns this.

edit(options: UpdateWebhookEndpointOptions): Promise<this>

Parameters

  • options: UpdateWebhookEndpointOptions

Returns Promise<this>

disable()

Pause deliveries to this endpoint.

disable(): Promise<this>

Returns Promise<this>

enable()

Resume deliveries to this endpoint.

enable(): Promise<this>

Returns Promise<this>

rotateSecret()

Rotate the signing secret (returns a new instance carrying the secret).

rotateSecret(): Promise<WebhookEndpoint>

Returns Promise<WebhookEndpoint>

ping()

Send a test event to verify the endpoint.

ping(): Promise<WebhookPingData>

Returns Promise<WebhookPingData>

fetchDeliveries()

List delivery attempts for this endpoint.

fetchDeliveries(options?: ListWebhookDeliveriesOptions): Promise<WebhookDeliveryPage>

Parameters

  • options (optional): ListWebhookDeliveriesOptions

Returns Promise<WebhookDeliveryPage>

delete()

Delete this endpoint.

delete(): Promise<{ id: string

Returns Promise<{ id: string

toJSON()

toJSON(): WebhookEndpointData

Returns WebhookEndpointData

Auf dieser Seite