orb-billing
Version:
The official TypeScript library for the Orb API
24 lines • 1.02 kB
TypeScript
import { APIResource } from 'orb-billing/resource';
import { HeadersLike } from 'orb-billing/core';
export declare class Webhooks extends APIResource {
/**
* Validates that the given payload was sent by Orb and parses the payload.
*
* An error will be raised if the webhook payload was not sent by Orb.
*/
unwrap(payload: string, headers: HeadersLike, secret?: string | undefined | null): Object;
private parseSecret;
private signPayload;
/** Make an assertion, if not `true`, then throw. */
private assert;
/** Compare to array buffers or data views in a way that timing based attacks
* cannot gain information about the platform. */
private timingSafeEqual;
/**
* Validates whether or not the webhook payload was sent by Orb.
*
* An error will be raised if the webhook payload was not sent by Orb.
*/
verifySignature(body: string, headers: HeadersLike, secret?: string | undefined | null): void;
}
//# sourceMappingURL=webhooks.d.ts.map