diff --git a/types/stripe/index.d.ts b/types/stripe/index.d.ts index fa41fe529c..bedc9ee33d 100644 --- a/types/stripe/index.d.ts +++ b/types/stripe/index.d.ts @@ -120,6 +120,7 @@ declare class Stripe { fileLinks: Stripe.resources.FileLinks; bitcoinReceivers: Stripe.resources.BitcoinReceivers; refunds: Stripe.resources.Refunds; + reviews: Stripe.resources.Reviews; countrySpecs: Stripe.resources.CountrySpecs; orders: Stripe.resources.Orders; products: Stripe.resources.Products; @@ -13901,6 +13902,49 @@ declare namespace Stripe { list(response?: IResponseFn>): IListPromise; } + class Reviews extends StripeResource { + /** + * Approves a Review object, closing it and removing it from the list of reviews. Returns the approved + * review object. + * @param id - The identifier of the review to be approved. + */ + approve( + id: string, + options: HeaderOptions, + response?: IResponseFn, + ): Promise; + approve(id: string, response?: IResponseFn): Promise; + + retrieve( + id: string, + options: HeaderOptions, + response?: IResponseFn, + ): Promise; + retrieve( + id: string, + response?: IResponseFn, + ): Promise; + + /** + * Returns a list of Review objects that have open set to true. The objects are sorted in descending + * order by creation date, with the most recently created object appearing first. + */ + list( + data: IListOptionsCreated, + options: HeaderOptions, + response?: IResponseFn>, + ): IListPromise; + list( + data: IListOptionsCreated, + response?: IResponseFn>, + ): IListPromise; + list( + options: HeaderOptions, + response?: IResponseFn>, + ): IListPromise; + list(response?: IResponseFn>): IListPromise; + } + class Sources extends StripeResource { /** Create Source: https://stripe.com/docs/api/sources/create */ create( diff --git a/types/stripe/stripe-tests.ts b/types/stripe/stripe-tests.ts index feb4cf04c8..38591253da 100644 --- a/types/stripe/stripe-tests.ts +++ b/types/stripe/stripe-tests.ts @@ -1394,6 +1394,35 @@ stripe.applicationFees.retrieveRefund('fee_1Eq2auEELBA7Bnp1FpeuNccq', 'fr_1Eq2au //#endregion +//#region Reviews tests +// ################################################################################## + +stripe.reviews.approve('prv_1FhJ93BZBR5SQORgPByBqMbC', (err, review) => { + review; // $ExpectType IReview +}); + +stripe.reviews.approve('prv_1FhJ93BZBR5SQORgPByBqMbC').then(review => { + review; // $ExpectType IReview +}); + +stripe.reviews.retrieve('prv_1FhJ93BZBR5SQORgPByBqMbC', (err, review) => { + review; // $ExpectType IReview +}); + +stripe.reviews.retrieve('prv_1FhJ93BZBR5SQORgPByBqMbC').then(review => { + review; // $ExpectType IReview +}); + +stripe.reviews.list({ limit: 3 }, (err, reviews) => { + reviews; // $ExpectType IList +}); + +stripe.reviews.list({ limit: 3 }).then(reviews => { + reviews; // $ExpectType IList +}); + +//#endregion + //#region External Accounts tests // ##################################################################################