UNPKG

stripe

Version:
36 lines 1.61 kB
"use strict"; // File generated from our OpenAPI spec Object.defineProperty(exports, "__esModule", { value: true }); exports.FileResource = void 0; const StripeResource_js_1 = require("../StripeResource.js"); class FileResource extends StripeResource_js_1.StripeResource { /** * Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top. */ list(params, options) { return this._makeRequest('GET', '/v1/files', params, options, { methodType: 'list', }); } /** * To upload a file to Stripe, you need to send a request of type multipart/form-data. Include the file you want to upload in the request, and the parameters for creating a file. * * All of Stripe's officially supported Client libraries support sending multipart/form-data. */ create(params, options) { return this._makeRequest('POST', '/v1/files', params, options, { headers: { 'Content-Type': 'multipart/form-data', }, apiBase: 'files', }); } /** * Retrieves the details of an existing file object. After you supply a unique file ID, Stripe returns the corresponding file object. Learn how to [access file contents](https://docs.stripe.com/docs/file-upload#download-file-contents). */ retrieve(id, params, options) { return this._makeRequest('GET', `/v1/files/${id}`, params, options); } } exports.FileResource = FileResource; //# sourceMappingURL=Files.js.map