cloudflare
Version:
The official TypeScript library for the Cloudflare API
38 lines • 1.5 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PaymentMethod = exports.BasePaymentMethod = 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 BasePaymentMethod = /* @__PURE__ */ (() => {
class BasePaymentMethod extends resource_1.APIResource {
/**
* Creates a Stripe payment intent for adding or updating a payment method on the
* account's billing profile. Returns a client secret for frontend payment method
* collection.
*
* @example
* ```ts
* const paymentMethod =
* await client.billing.profiles.paymentMethod.create({
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
create(params, options) {
const { account_id } = params;
return this._client.post((0, path_1.path) `/accounts/${account_id}/billing/profile/payment-method`, options)._thenUnwrap((obj) => obj.result);
}
}
BasePaymentMethod._key = Object.freeze([
'billing',
'profiles',
'paymentMethod',
]);
return BasePaymentMethod;
})();
exports.BasePaymentMethod = BasePaymentMethod;
class PaymentMethod extends BasePaymentMethod {
}
exports.PaymentMethod = PaymentMethod;
//# sourceMappingURL=payment-method.js.map