UNPKG

@hyperse/paypal-node-sdk

Version:

NodeJS SDK for PayPal Checkout APIs

25 lines (24 loc) 973 B
import querystring from 'querystring'; import { HttpRequestBase } from '../core/HttpRequestBase.js'; import {} from '../types/type-webhook.js'; /** * Updates a webhook to replace webhook fields with new values. Supports only the replace operation. * Pass a json_patch object with replace operation and path, which is /url for a URL or /event_types for events. The value is either the URL or a list of events. * @see {@link https://developer.paypal.com/docs/api/webhooks/v1/#webhooks_update} * */ export class WebhookUpdateRequest extends HttpRequestBase { constructor(webhookId) { super(); this.verb = 'PATCH'; this.path = '/v1/notifications/webhooks/{webhook_id}?'; this.path = this.path.replace('{webhook_id}', querystring.escape(webhookId)); this.headers = { 'Content-Type': 'application/json', }; } requestBody(updateRequest) { this.body = updateRequest; return this; } }