cloudflare
Version:
The official TypeScript library for the Cloudflare API
33 lines • 1.27 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import { path } from "../../../internal/utils/path.mjs";
export var BasePaymentMethod = /* @__PURE__ */ (() => {
class BasePaymentMethod extends 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(path `/accounts/${account_id}/billing/profile/payment-method`, options)._thenUnwrap((obj) => obj.result);
}
}
BasePaymentMethod._key = Object.freeze([
'billing',
'profiles',
'paymentMethod',
]);
return BasePaymentMethod;
})();
export class PaymentMethod extends BasePaymentMethod {
}
//# sourceMappingURL=payment-method.mjs.map