Skip to content

Commit 3511d7f

Browse files
Remove parseSnapshotEvent (#2195)
1 parent ed3d49a commit 3511d7f

File tree

2 files changed

+0
-59
lines changed

2 files changed

+0
-59
lines changed

src/stripe.core.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -518,24 +518,6 @@ export function createStripe(
518518
receivedAt
519519
);
520520
},
521-
522-
parseSnapshotEvent(
523-
payload: string | Uint8Array,
524-
header: string | Uint8Array,
525-
secret: string,
526-
tolerance?: number,
527-
cryptoProvider?: CryptoProvider,
528-
receivedAt?: number
529-
): WebhookEvent {
530-
return this.webhooks.constructEvent(
531-
payload,
532-
header,
533-
secret,
534-
tolerance,
535-
cryptoProvider,
536-
receivedAt
537-
);
538-
},
539521
} as StripeObject;
540522

541523
return Stripe;

types/index.d.ts

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -546,47 +546,6 @@ declare module 'stripe' {
546546
*/
547547
receivedAt?: number
548548
) => Stripe.ThinEvent;
549-
550-
/**
551-
* Parses webhook event payload into a SnapshotEvent and verifies webhook signature.
552-
*
553-
* @throws Stripe.errors.StripeSignatureVerificationError
554-
*/
555-
parseSnapshotEvent: (
556-
/**
557-
* Raw text body payload received from Stripe.
558-
*/
559-
payload: string | Buffer,
560-
/**
561-
* Value of the `stripe-signature` header from Stripe.
562-
* Typically a string.
563-
*
564-
* Note that this is typed to accept an array of strings
565-
* so that it works seamlessly with express's types,
566-
* but will throw if an array is passed in practice
567-
* since express should never return this header as an array,
568-
* only a string.
569-
*/
570-
header: string | Buffer | Array<string>,
571-
/**
572-
* Your Webhook Signing Secret for this endpoint (e.g., 'whsec_...').
573-
* You can get this [in your dashboard](https://dashboard.stripe.com/webhooks).
574-
*/
575-
secret: string,
576-
/**
577-
* Seconds of tolerance on timestamps.
578-
*/
579-
tolerance?: number,
580-
/**
581-
* Optional CryptoProvider to use for computing HMAC signatures.
582-
*/
583-
cryptoProvider?: Stripe.CryptoProvider,
584-
585-
/**
586-
* Optional: timestamp to use when checking signature validity. Defaults to Date.now().
587-
*/
588-
receivedAt?: number
589-
) => Stripe.Event;
590549
}
591550

592551
export default Stripe;

0 commit comments

Comments
 (0)