#tom-smithhisler_code
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1491089276602024068
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there, just to clarify, which other properties are you referring to? can you provide an example of the old type you're comparing against?
Absolutely - standby I'll gather the exact issue.
generateTestHeaderString: function(opts: WebhookTestHeaderOptions): string https://github.com/stripe/stripe-node/blob/master/src/Webhooks.ts#L179
The input opts defined in Webhooks.ts is
type WebhookTestHeaderOptions = {
timestamp: number;
payload: string;
secret: string;
scheme: string;
signature: string;
cryptoProvider: CryptoProvider;
};
The old manually typed Webhooks.d.ts file (https://github.com/stripe/stripe-node/blob/9c0a9cb7482d19c2e6e6b5b5574c1a2f0149a2a9/types/Webhooks.d.ts#L104) used:
export interface WebhookTestHeaderOptions {
/**
* JSON stringified payload object, containing the 'id' and 'object' parameters.
*/
payload: string;
/**
* Timestamp of the header. Defaults to Date.now().
*/
timestamp?: number;
/**
* Stripe webhook secret, e.g., 'whsec_...'.
*/
secret: string;
/**
* Version of API to hit. Defaults to 'v1'.
*/
scheme?: string;
/**
* Computed webhook signature.
*/
signature?: string;
/**
* Optional CryptoProvider to use for computing HMAC signatures, if no
* signature is given.
*/
cryptoProvider?: CryptoProvider;
}
In the old interface, only payload and secret were required, all others were optional. The new (well it's not new, but now the exported type is derived from it) type requires all parameters.
thanks, looking into this now
this does seem to be a legitimate bug to me. I'm seeing some other Typescript type problems with v22 in the github project's issues but nothing specific to what you've identified. can you file an issue here? https://github.com/stripe/stripe-node/issues
someone on the SDK team should respond and identify workarounds / figure out if this needs to be patched
Will do!