stripe / stripe-node

Node.js library for the Stripe API.
https://stripe.com
MIT License
3.89k stars 753 forks source link

Add raw request #2189

Closed prathmesh-stripe closed 1 month ago

prathmesh-stripe commented 1 month ago

Changelog

Adds the ability to make requests to the Stripe API that are not directly supported in the SDK, by providing an HTTP method, url and relevant parameters

Example:

import Stripe from 'stripe';
const stripe = new Stripe('sk_test_...');

const response = await stripe.rawRequest(
  'POST',
  '/v1/beta_endpoint',
  { param: 123 },
  { apiVersion: '2022-11-15; feature_beta=v3' }
);
prathmesh-stripe commented 1 month ago

Not sure why tests aren't working. They do pass locally.