@hyperse/paypal-node-sdk
Version:
NodeJS SDK for PayPal Checkout APIs
35 lines (34 loc) • 1.21 kB
JavaScript
import { HttpRequestBase } from '../core/HttpRequestBase.js';
import {} from '../types/type-webhook.js';
/**
* Verifies a webhook signature.
* @see {@link https://developer.paypal.com/docs/api/webhooks/v1/#verify-webhook-signature_post}
*
*/
export class VerifyWebhookSignature extends HttpRequestBase {
constructor() {
super();
this.path = '/v1/notifications/verify-webhook-signature?';
this.verb = 'POST';
this.headers = {
'Content-Type': 'application/json',
};
}
payPalRequestId(payPalRequestId) {
this.headers['PayPal-Request-Id'] = payPalRequestId;
return this;
}
/**
* 1. return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links.
* 2. return=representation. The server returns a complete resource representation, including the current state of the resource.
* @default `return=minimal`
*/
prefer(prefer) {
this.headers['Prefer'] = prefer;
return this;
}
requestBody(signature) {
this.body = signature;
return this;
}
}