cloudflare
Version:
The official TypeScript library for the Cloudflare API
35 lines • 1.38 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PayInvoice = exports.BasePayInvoice = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../core/resource.js");
const path_1 = require("../../internal/utils/path.js");
var BasePayInvoice = /* @__PURE__ */ (() => {
class BasePayInvoice extends resource_1.APIResource {
/**
* Pays an outstanding invoice for an account. Returns a Stripe client secret when
* Strong Customer Authentication (SCA) is required to complete the payment.
*
* @example
* ```ts
* const payInvoice = await client.accounts.payInvoice.create({
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
create(params, options) {
const { account_id, ...body } = params;
return this._client.post((0, path_1.path) `/accounts/${account_id}/pay-invoice`, { body, ...options })._thenUnwrap((obj) => obj.result);
}
}
BasePayInvoice._key = Object.freeze([
'accounts',
'payInvoice',
]);
return BasePayInvoice;
})();
exports.BasePayInvoice = BasePayInvoice;
class PayInvoice extends BasePayInvoice {
}
exports.PayInvoice = PayInvoice;
//# sourceMappingURL=pay-invoice.js.map