From 2c66f01c120335da7b30ecabc454cf5604192135 Mon Sep 17 00:00:00 2001 From: SDK Distribution Bot Date: Fri, 13 Feb 2026 03:09:16 +0000 Subject: [PATCH] feat: Update SDK from generator (2026-02-13) --- client/client/client.gen.ts | 81 ++++----- client/client/types.gen.ts | 52 ++---- client/client/utils.gen.ts | 28 +-- client/core/auth.gen.ts | 3 +- client/core/bodySerializer.gen.ts | 26 +-- client/core/params.gen.ts | 13 +- client/core/pathSerializer.gen.ts | 18 +- client/core/queryKeySerializer.gen.ts | 31 +--- client/core/serverSentEvents.gen.ts | 39 +--- client/core/types.gen.ts | 22 +-- client/core/utils.gen.ts | 5 +- client/index.ts | 4 +- client/sdk.gen.ts | 20 ++- client/types.gen.ts | 249 +++++++++++++++++++++++++- package.json | 2 +- payjpv2.ts | 2 +- 16 files changed, 348 insertions(+), 247 deletions(-) diff --git a/client/client/client.gen.ts b/client/client/client.gen.ts index bf75e62..d2e55a1 100644 --- a/client/client/client.gen.ts +++ b/client/client/client.gen.ts @@ -3,12 +3,7 @@ import { createSseClient } from '../core/serverSentEvents.gen'; import type { HttpMethod } from '../core/types.gen'; import { getValidRequestBody } from '../core/utils.gen'; -import type { - Client, - Config, - RequestOptions, - ResolvedRequestOptions, -} from './types.gen'; +import type { Client, Config, RequestOptions, ResolvedRequestOptions } from './types.gen'; import { buildUrl, createConfig, @@ -34,12 +29,7 @@ export const createClient = (config: Config = {}): Client => { return getConfig(); }; - const interceptors = createInterceptors< - Request, - Response, - unknown, - ResolvedRequestOptions - >(); + const interceptors = createInterceptors(); const beforeRequest = async (options: RequestOptions) => { const opts = { @@ -105,12 +95,7 @@ export const createClient = (config: Config = {}): Client => { for (const fn of interceptors.error.fns) { if (fn) { - finalError = (await fn( - error, - undefined as any, - request, - opts, - )) as unknown; + finalError = (await fn(error, undefined as any, request, opts)) as unknown; } } @@ -147,10 +132,7 @@ export const createClient = (config: Config = {}): Client => { ? getParseAs(response.headers.get('Content-Type')) : opts.parseAs) ?? 'json'; - if ( - response.status === 204 || - response.headers.get('Content-Length') === '0' - ) { + if (response.status === 204 || response.headers.get('Content-Length') === '0') { let emptyData: any; switch (parseAs) { case 'arrayBuffer': @@ -182,10 +164,16 @@ export const createClient = (config: Config = {}): Client => { case 'arrayBuffer': case 'blob': case 'formData': - case 'json': case 'text': data = await response[parseAs](); break; + case 'json': { + // Some servers return 200 with no Content-Length and empty body. + // response.json() would throw; read as text and parse if non-empty. + const text = await response.text(); + data = text ? JSON.parse(text) : {}; + break; + } case 'stream': return opts.responseStyle === 'data' ? response.body @@ -246,34 +234,29 @@ export const createClient = (config: Config = {}): Client => { }; }; - const makeMethodFn = - (method: Uppercase) => (options: RequestOptions) => - request({ ...options, method }); + const makeMethodFn = (method: Uppercase) => (options: RequestOptions) => + request({ ...options, method }); - const makeSseFn = - (method: Uppercase) => async (options: RequestOptions) => { - const { opts, url } = await beforeRequest(options); - return createSseClient({ - ...opts, - body: opts.body as BodyInit | null | undefined, - headers: opts.headers as unknown as Record, - method, - onRequest: async (url, init) => { - let request = new Request(url, init); - for (const fn of interceptors.request.fns) { - if (fn) { - request = await fn(request, opts); - } + const makeSseFn = (method: Uppercase) => async (options: RequestOptions) => { + const { opts, url } = await beforeRequest(options); + return createSseClient({ + ...opts, + body: opts.body as BodyInit | null | undefined, + headers: opts.headers as unknown as Record, + method, + onRequest: async (url, init) => { + let request = new Request(url, init); + for (const fn of interceptors.request.fns) { + if (fn) { + request = await fn(request, opts); } - return request; - }, - serializedBody: getValidRequestBody(opts) as - | BodyInit - | null - | undefined, - url, - }); - }; + } + return request; + }, + serializedBody: getValidRequestBody(opts) as BodyInit | null | undefined, + url, + }); + }; return { buildUrl, diff --git a/client/client/types.gen.ts b/client/client/types.gen.ts index b4a499c..cb6d0d5 100644 --- a/client/client/types.gen.ts +++ b/client/client/types.gen.ts @@ -5,17 +5,13 @@ import type { ServerSentEventsOptions, ServerSentEventsResult, } from '../core/serverSentEvents.gen'; -import type { - Client as CoreClient, - Config as CoreConfig, -} from '../core/types.gen'; +import type { Client as CoreClient, Config as CoreConfig } from '../core/types.gen'; import type { Middleware } from './utils.gen'; export type ResponseStyle = 'data' | 'fields'; export interface Config - extends Omit, - CoreConfig { + extends Omit, CoreConfig { /** * Base URL for all requests made by this client. */ @@ -42,14 +38,7 @@ export interface Config * * @default 'auto' */ - parseAs?: - | 'arrayBuffer' - | 'auto' - | 'blob' - | 'formData' - | 'json' - | 'stream' - | 'text'; + parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text'; /** * Should we return only data or multiple fields (data, error, response, etc.)? * @@ -69,7 +58,9 @@ export interface RequestOptions< TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string, -> extends Config<{ +> + extends + Config<{ responseStyle: TResponseStyle; throwOnError: ThrowOnError; }>, @@ -116,32 +107,22 @@ export type RequestResult< ? TData[keyof TData] : TData : { - data: TData extends Record - ? TData[keyof TData] - : TData; + data: TData extends Record ? TData[keyof TData] : TData; request: Request; response: Response; } > : Promise< TResponseStyle extends 'data' - ? - | (TData extends Record - ? TData[keyof TData] - : TData) - | undefined + ? (TData extends Record ? TData[keyof TData] : TData) | undefined : ( | { - data: TData extends Record - ? TData[keyof TData] - : TData; + data: TData extends Record ? TData[keyof TData] : TData; error: undefined; } | { data: undefined; - error: TError extends Record - ? TError[keyof TError] - : TError; + error: TError extends Record ? TError[keyof TError] : TError; } ) & { request: Request; @@ -180,10 +161,7 @@ type RequestFn = < TResponseStyle extends ResponseStyle = 'fields', >( options: Omit, 'method'> & - Pick< - Required>, - 'method' - >, + Pick>, 'method'>, ) => RequestResult; type BuildUrlFn = < @@ -197,13 +175,7 @@ type BuildUrlFn = < options: TData & Options, ) => string; -export type Client = CoreClient< - RequestFn, - Config, - MethodFn, - BuildUrlFn, - SseFn -> & { +export type Client = CoreClient & { interceptors: Middleware; }; diff --git a/client/client/utils.gen.ts b/client/client/utils.gen.ts index 4c48a9e..b4bd243 100644 --- a/client/client/utils.gen.ts +++ b/client/client/utils.gen.ts @@ -65,9 +65,7 @@ export const createQuerySerializer = ({ /** * Infers parseAs value from provided Content-Type header. */ -export const getParseAs = ( - contentType: string | null, -): Exclude => { +export const getParseAs = (contentType: string | null): Exclude => { if (!contentType) { // If no Content-Type header is provided, the best we can do is return the raw response body, // which is effectively the same as the 'stream' option. @@ -80,10 +78,7 @@ export const getParseAs = ( return; } - if ( - cleanContent.startsWith('application/json') || - cleanContent.endsWith('+json') - ) { + if (cleanContent.startsWith('application/json') || cleanContent.endsWith('+json')) { return 'json'; } @@ -92,9 +87,7 @@ export const getParseAs = ( } if ( - ['application/', 'audio/', 'image/', 'video/'].some((type) => - cleanContent.startsWith(type), - ) + ['application/', 'audio/', 'image/', 'video/'].some((type) => cleanContent.startsWith(type)) ) { return 'blob'; } @@ -201,10 +194,7 @@ export const mergeHeaders = ( continue; } - const iterator = - header instanceof Headers - ? headersEntries(header) - : Object.entries(header); + const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header); for (const [key, value] of iterator) { if (value === null) { @@ -233,10 +223,7 @@ type ErrInterceptor = ( options: Options, ) => Err | Promise; -type ReqInterceptor = ( - request: Req, - options: Options, -) => Req | Promise; +type ReqInterceptor = (request: Req, options: Options) => Req | Promise; type ResInterceptor = ( response: Res, @@ -270,10 +257,7 @@ class Interceptors { return this.fns.indexOf(id); } - update( - id: number | Interceptor, - fn: Interceptor, - ): number | Interceptor | false { + update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false { const index = this.getInterceptorIndex(id); if (this.fns[index]) { this.fns[index] = fn; diff --git a/client/core/auth.gen.ts b/client/core/auth.gen.ts index f8a7326..3ebf994 100644 --- a/client/core/auth.gen.ts +++ b/client/core/auth.gen.ts @@ -23,8 +23,7 @@ export const getAuthToken = async ( auth: Auth, callback: ((auth: Auth) => Promise | AuthToken) | AuthToken, ): Promise => { - const token = - typeof callback === 'function' ? await callback(auth) : callback; + const token = typeof callback === 'function' ? await callback(auth) : callback; if (!token) { return; diff --git a/client/core/bodySerializer.gen.ts b/client/core/bodySerializer.gen.ts index 552b50f..8ad92c9 100644 --- a/client/core/bodySerializer.gen.ts +++ b/client/core/bodySerializer.gen.ts @@ -1,10 +1,6 @@ // This file is auto-generated by @hey-api/openapi-ts -import type { - ArrayStyle, - ObjectStyle, - SerializerOptions, -} from './pathSerializer.gen'; +import type { ArrayStyle, ObjectStyle, SerializerOptions } from './pathSerializer.gen'; export type QuerySerializer = (query: Record) => string; @@ -24,11 +20,7 @@ export type QuerySerializerOptions = QuerySerializerOptionsObject & { parameters?: Record; }; -const serializeFormDataPair = ( - data: FormData, - key: string, - value: unknown, -): void => { +const serializeFormDataPair = (data: FormData, key: string, value: unknown): void => { if (typeof value === 'string' || value instanceof Blob) { data.append(key, value); } else if (value instanceof Date) { @@ -38,11 +30,7 @@ const serializeFormDataPair = ( } }; -const serializeUrlSearchParamsPair = ( - data: URLSearchParams, - key: string, - value: unknown, -): void => { +const serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value: unknown): void => { if (typeof value === 'string') { data.append(key, value); } else { @@ -73,15 +61,11 @@ export const formDataBodySerializer = { export const jsonBodySerializer = { bodySerializer: (body: T): string => - JSON.stringify(body, (_key, value) => - typeof value === 'bigint' ? value.toString() : value, - ), + JSON.stringify(body, (_key, value) => (typeof value === 'bigint' ? value.toString() : value)), }; export const urlSearchParamsBodySerializer = { - bodySerializer: | Array>>( - body: T, - ): string => { + bodySerializer: | Array>>(body: T): string => { const data = new URLSearchParams(); Object.entries(body).forEach(([key, value]) => { diff --git a/client/core/params.gen.ts b/client/core/params.gen.ts index 602715c..6099cab 100644 --- a/client/core/params.gen.ts +++ b/client/core/params.gen.ts @@ -102,10 +102,7 @@ const stripEmptySlots = (params: Params) => { } }; -export const buildClientParams = ( - args: ReadonlyArray, - fields: FieldsConfig, -) => { +export const buildClientParams = (args: ReadonlyArray, fields: FieldsConfig) => { const params: Params = { body: {}, headers: {}, @@ -148,15 +145,11 @@ export const buildClientParams = ( params[field.map] = value; } } else { - const extra = extraPrefixes.find(([prefix]) => - key.startsWith(prefix), - ); + const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix)); if (extra) { const [prefix, slot] = extra; - (params[slot] as Record)[ - key.slice(prefix.length) - ] = value; + (params[slot] as Record)[key.slice(prefix.length)] = value; } else if ('allowExtra' in config && config.allowExtra) { for (const [slot, allowed] of Object.entries(config.allowExtra)) { if (allowed) { diff --git a/client/core/pathSerializer.gen.ts b/client/core/pathSerializer.gen.ts index 8d99931..994b284 100644 --- a/client/core/pathSerializer.gen.ts +++ b/client/core/pathSerializer.gen.ts @@ -1,8 +1,6 @@ // This file is auto-generated by @hey-api/openapi-ts -interface SerializeOptions - extends SerializePrimitiveOptions, - SerializerOptions {} +interface SerializeOptions extends SerializePrimitiveOptions, SerializerOptions {} interface SerializePrimitiveOptions { allowReserved?: boolean; @@ -105,9 +103,7 @@ export const serializeArrayParam = ({ }); }) .join(separator); - return style === 'label' || style === 'matrix' - ? separator + joinedValues - : joinedValues; + return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues; }; export const serializePrimitiveParam = ({ @@ -146,11 +142,7 @@ export const serializeObjectParam = ({ if (style !== 'deepObject' && !explode) { let values: string[] = []; Object.entries(value).forEach(([key, v]) => { - values = [ - ...values, - key, - allowReserved ? (v as string) : encodeURIComponent(v as string), - ]; + values = [...values, key, allowReserved ? (v as string) : encodeURIComponent(v as string)]; }); const joinedValues = values.join(','); switch (style) { @@ -175,7 +167,5 @@ export const serializeObjectParam = ({ }), ) .join(separator); - return style === 'label' || style === 'matrix' - ? separator + joinedValues - : joinedValues; + return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues; }; diff --git a/client/core/queryKeySerializer.gen.ts b/client/core/queryKeySerializer.gen.ts index d3bb683..5000df6 100644 --- a/client/core/queryKeySerializer.gen.ts +++ b/client/core/queryKeySerializer.gen.ts @@ -15,11 +15,7 @@ export type JsonValue = * Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes. */ export const queryKeyJsonReplacer = (_key: string, value: unknown) => { - if ( - value === undefined || - typeof value === 'function' || - typeof value === 'symbol' - ) { + if (value === undefined || typeof value === 'function' || typeof value === 'symbol') { return undefined; } if (typeof value === 'bigint') { @@ -61,9 +57,7 @@ const isPlainObject = (value: unknown): value is Record => { * Turns URLSearchParams into a sorted JSON object for deterministic keys. */ const serializeSearchParams = (params: URLSearchParams): JsonValue => { - const entries = Array.from(params.entries()).sort(([a], [b]) => - a.localeCompare(b), - ); + const entries = Array.from(params.entries()).sort(([a], [b]) => a.localeCompare(b)); const result: Record = {}; for (const [key, value] of entries) { @@ -86,26 +80,16 @@ const serializeSearchParams = (params: URLSearchParams): JsonValue => { /** * Normalizes any accepted value into a JSON-friendly shape for query keys. */ -export const serializeQueryKeyValue = ( - value: unknown, -): JsonValue | undefined => { +export const serializeQueryKeyValue = (value: unknown): JsonValue | undefined => { if (value === null) { return null; } - if ( - typeof value === 'string' || - typeof value === 'number' || - typeof value === 'boolean' - ) { + if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') { return value; } - if ( - value === undefined || - typeof value === 'function' || - typeof value === 'symbol' - ) { + if (value === undefined || typeof value === 'function' || typeof value === 'symbol') { return undefined; } @@ -121,10 +105,7 @@ export const serializeQueryKeyValue = ( return stringifyToJsonValue(value); } - if ( - typeof URLSearchParams !== 'undefined' && - value instanceof URLSearchParams - ) { + if (typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams) { return serializeSearchParams(value); } diff --git a/client/core/serverSentEvents.gen.ts b/client/core/serverSentEvents.gen.ts index 343d25a..6aa6cf0 100644 --- a/client/core/serverSentEvents.gen.ts +++ b/client/core/serverSentEvents.gen.ts @@ -2,10 +2,7 @@ import type { Config } from './types.gen'; -export type ServerSentEventsOptions = Omit< - RequestInit, - 'method' -> & +export type ServerSentEventsOptions = Omit & Pick & { /** * Fetch API implementation. You can use this option to provide a custom @@ -74,11 +71,7 @@ export interface StreamEvent { retry?: number; } -export type ServerSentEventsResult< - TData = unknown, - TReturn = void, - TNext = unknown, -> = { +export type ServerSentEventsResult = { stream: AsyncGenerator< TData extends Record ? TData[keyof TData] : TData, TReturn, @@ -101,9 +94,7 @@ export const createSseClient = ({ }: ServerSentEventsOptions): ServerSentEventsResult => { let lastEventId: string | undefined; - const sleep = - sseSleepFn ?? - ((ms: number) => new Promise((resolve) => setTimeout(resolve, ms))); + const sleep = sseSleepFn ?? ((ms: number) => new Promise((resolve) => setTimeout(resolve, ms))); const createStream = async function* () { let retryDelay: number = sseDefaultRetryDelay ?? 3000; @@ -141,16 +132,11 @@ export const createSseClient = ({ const _fetch = options.fetch ?? globalThis.fetch; const response = await _fetch(request); - if (!response.ok) - throw new Error( - `SSE failed: ${response.status} ${response.statusText}`, - ); + if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`); if (!response.body) throw new Error('No body in SSE response'); - const reader = response.body - .pipeThrough(new TextDecoderStream()) - .getReader(); + const reader = response.body.pipeThrough(new TextDecoderStream()).getReader(); let buffer = ''; @@ -188,10 +174,7 @@ export const createSseClient = ({ } else if (line.startsWith('id:')) { lastEventId = line.replace(/^id:\s*/, ''); } else if (line.startsWith('retry:')) { - const parsed = Number.parseInt( - line.replace(/^retry:\s*/, ''), - 10, - ); + const parsed = Number.parseInt(line.replace(/^retry:\s*/, ''), 10); if (!Number.isNaN(parsed)) { retryDelay = parsed; } @@ -243,18 +226,12 @@ export const createSseClient = ({ // connection failed or aborted; retry after delay onSseError?.(error); - if ( - sseMaxRetryAttempts !== undefined && - attempt >= sseMaxRetryAttempts - ) { + if (sseMaxRetryAttempts !== undefined && attempt >= sseMaxRetryAttempts) { break; // stop after firing error } // exponential backoff: double retry each attempt, cap at 30s - const backoff = Math.min( - retryDelay * 2 ** (attempt - 1), - sseMaxRetryDelay ?? 30000, - ); + const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 30000); await sleep(backoff); } } diff --git a/client/core/types.gen.ts b/client/core/types.gen.ts index 643c070..9746325 100644 --- a/client/core/types.gen.ts +++ b/client/core/types.gen.ts @@ -1,11 +1,7 @@ // This file is auto-generated by @hey-api/openapi-ts import type { Auth, AuthToken } from './auth.gen'; -import type { - BodySerializer, - QuerySerializer, - QuerySerializerOptions, -} from './bodySerializer.gen'; +import type { BodySerializer, QuerySerializer, QuerySerializerOptions } from './bodySerializer.gen'; export type HttpMethod = | 'connect' @@ -34,9 +30,7 @@ export type Client< setConfig: (config: Config) => Config; } & { [K in HttpMethod]: MethodFn; -} & ([SseFn] extends [never] - ? { sse?: never } - : { sse: { [K in HttpMethod]: SseFn } }); +} & ([SseFn] extends [never] ? { sse?: never } : { sse: { [K in HttpMethod]: SseFn } }); export interface Config { /** @@ -59,13 +53,7 @@ export interface Config { | RequestInit['headers'] | Record< string, - | string - | number - | boolean - | (string | number | boolean)[] - | null - | undefined - | unknown + string | number | boolean | (string | number | boolean)[] | null | undefined | unknown >; /** * The request method. @@ -112,7 +100,5 @@ type IsExactlyNeverOrNeverUndefined = [T] extends [never] : false; export type OmitNever> = { - [K in keyof T as IsExactlyNeverOrNeverUndefined extends true - ? never - : K]: T[K]; + [K in keyof T as IsExactlyNeverOrNeverUndefined extends true ? never : K]: T[K]; }; diff --git a/client/core/utils.gen.ts b/client/core/utils.gen.ts index 0b5389d..e7ddbe3 100644 --- a/client/core/utils.gen.ts +++ b/client/core/utils.gen.ts @@ -44,10 +44,7 @@ export const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => { } if (Array.isArray(value)) { - url = url.replace( - match, - serializeArrayParam({ explode, name, style, value }), - ); + url = url.replace(match, serializeArrayParam({ explode, name, style, value })); continue; } diff --git a/client/index.ts b/client/index.ts index 5daf55f..46499f9 100644 --- a/client/index.ts +++ b/client/index.ts @@ -1,4 +1,4 @@ // This file is auto-generated by @hey-api/openapi-ts -export { attachPaymentMethod, cancelPaymentFlow, cancelSetupFlow, capturePaymentFlow, confirmPaymentFlow, createBalanceUrl, createCheckoutSession, createCustomer, createPaymentFlow, createPaymentMethod, createPaymentRefund, createPrice, createProduct, createSetupFlow, createStatementUrl, createTaxRate, deleteCustomer, deleteProduct, detachPaymentMethod, getAllBalances, getAllCheckoutSessionLineItems, getAllCheckoutSessions, getAllCustomers, getAllEvents, getAllPaymentFlows, getAllPaymentMethodConfigurations, getAllPaymentMethods, getAllPaymentRefunds, getAllPaymentTransactions, getAllPrices, getAllProducts, getAllSetupFlows, getAllStatements, getAllTaxRates, getAllTerms, getBalance, getCheckoutSession, getCustomer, getCustomerPaymentMethods, getEvent, getPaymentFlow, getPaymentFlowRefunds, getPaymentMethod, getPaymentMethodByCard, getPaymentMethodConfiguration, getPaymentRefund, getPaymentTransaction, getPrice, getProduct, getSetupFlow, getStatement, getTaxRate, getTerm, type Options, updateCheckoutSession, updateCustomer, updatePaymentFlow, updatePaymentMethod, updatePaymentMethodConfiguration, updatePaymentRefund, updatePrice, updateProduct, updateSetupFlow, updateTaxRate } from './sdk.gen'; -export type { AttachPaymentMethodData, AttachPaymentMethodError, AttachPaymentMethodErrors, AttachPaymentMethodResponse, AttachPaymentMethodResponses, BalanceListResponse, BalanceResponse, BalanceState, BalanceUrlResponse, BankInfoResponse, CancelPaymentFlowData, CancelPaymentFlowError, CancelPaymentFlowErrors, CancelPaymentFlowResponse, CancelPaymentFlowResponses, CancelSetupFlowData, CancelSetupFlowError, CancelSetupFlowErrors, CancelSetupFlowResponse, CancelSetupFlowResponses, CaptureMethod, CapturePaymentFlowData, CapturePaymentFlowError, CapturePaymentFlowErrors, CapturePaymentFlowResponse, CapturePaymentFlowResponses, CardConfigRequest, CheckoutSessionCreateRequest, CheckoutSessionCustomerDetailsAddressResponse, CheckoutSessionCustomerDetailsResponse, CheckoutSessionDetailsResponse, CheckoutSessionLineItemDataResponse, CheckoutSessionLineItemListResponse, CheckoutSessionListResponse, CheckoutSessionMode, CheckoutSessionPaymentMethodOptionsCardRequest, CheckoutSessionPaymentMethodOptionsRequest, CheckoutSessionStatus, CheckoutSessionSubmitType, CheckoutSessionUiMode, CheckoutSessionUpdateRequest, ClientOptions, ConfirmPaymentFlowData, ConfirmPaymentFlowError, ConfirmPaymentFlowErrors, ConfirmPaymentFlowResponse, ConfirmPaymentFlowResponses, Country, CreateBalanceUrlData, CreateBalanceUrlError, CreateBalanceUrlErrors, CreateBalanceUrlResponse, CreateBalanceUrlResponses, CreateCheckoutSessionData, CreateCheckoutSessionError, CreateCheckoutSessionErrors, CreateCheckoutSessionResponse, CreateCheckoutSessionResponses, CreateCustomerData, CreateCustomerError, CreateCustomerErrors, CreateCustomerResponse, CreateCustomerResponses, CreatePaymentFlowData, CreatePaymentFlowError, CreatePaymentFlowErrors, CreatePaymentFlowResponse, CreatePaymentFlowResponses, CreatePaymentMethodData, CreatePaymentMethodError, CreatePaymentMethodErrors, CreatePaymentMethodResponse, CreatePaymentMethodResponses, CreatePaymentRefundData, CreatePaymentRefundError, CreatePaymentRefundErrors, CreatePaymentRefundResponse, CreatePaymentRefundResponses, CreatePriceData, CreatePriceError, CreatePriceErrors, CreatePriceResponse, CreatePriceResponses, CreateProductData, CreateProductError, CreateProductErrors, CreateProductResponse, CreateProductResponses, CreateSetupFlowData, CreateSetupFlowError, CreateSetupFlowErrors, CreateSetupFlowResponse, CreateSetupFlowResponses, CreateStatementUrlData, CreateStatementUrlError, CreateStatementUrlErrors, CreateStatementUrlResponse, CreateStatementUrlResponses, CreateTaxRateData, CreateTaxRateError, CreateTaxRateErrors, CreateTaxRateResponse, CreateTaxRateResponses, Currency, CustomerCreateRequest, CustomerCreation, CustomerListResponse, CustomerResponse, CustomerUpdateRequest, DeleteCustomerData, DeleteCustomerError, DeleteCustomerErrors, DeleteCustomerResponse, DeleteCustomerResponses, DeleteProductData, DeleteProductError, DeleteProductErrors, DeleteProductResponse, DeleteProductResponses, DetachPaymentMethodData, DetachPaymentMethodError, DetachPaymentMethodErrors, DetachPaymentMethodResponse, DetachPaymentMethodResponses, DisplayPreferenceRequest, ErrorResponse, EventListResponse, EventResponse, GetAllBalancesData, GetAllBalancesError, GetAllBalancesErrors, GetAllBalancesResponse, GetAllBalancesResponses, GetAllCheckoutSessionLineItemsData, GetAllCheckoutSessionLineItemsError, GetAllCheckoutSessionLineItemsErrors, GetAllCheckoutSessionLineItemsResponse, GetAllCheckoutSessionLineItemsResponses, GetAllCheckoutSessionsData, GetAllCheckoutSessionsError, GetAllCheckoutSessionsErrors, GetAllCheckoutSessionsResponse, GetAllCheckoutSessionsResponses, GetAllCustomersData, GetAllCustomersError, GetAllCustomersErrors, GetAllCustomersResponse, GetAllCustomersResponses, GetAllEventsData, GetAllEventsError, GetAllEventsErrors, GetAllEventsResponse, GetAllEventsResponses, GetAllPaymentFlowsData, GetAllPaymentFlowsError, GetAllPaymentFlowsErrors, GetAllPaymentFlowsResponse, GetAllPaymentFlowsResponses, GetAllPaymentMethodConfigurationsData, GetAllPaymentMethodConfigurationsError, GetAllPaymentMethodConfigurationsErrors, GetAllPaymentMethodConfigurationsResponse, GetAllPaymentMethodConfigurationsResponses, GetAllPaymentMethodsData, GetAllPaymentMethodsError, GetAllPaymentMethodsErrors, GetAllPaymentMethodsResponse, GetAllPaymentMethodsResponses, GetAllPaymentRefundsData, GetAllPaymentRefundsError, GetAllPaymentRefundsErrors, GetAllPaymentRefundsResponse, GetAllPaymentRefundsResponses, GetAllPaymentTransactionsData, GetAllPaymentTransactionsError, GetAllPaymentTransactionsErrors, GetAllPaymentTransactionsResponse, GetAllPaymentTransactionsResponses, GetAllPricesData, GetAllPricesError, GetAllPricesErrors, GetAllPricesResponse, GetAllPricesResponses, GetAllProductsData, GetAllProductsError, GetAllProductsErrors, GetAllProductsResponse, GetAllProductsResponses, GetAllSetupFlowsData, GetAllSetupFlowsError, GetAllSetupFlowsErrors, GetAllSetupFlowsResponse, GetAllSetupFlowsResponses, GetAllStatementsData, GetAllStatementsError, GetAllStatementsErrors, GetAllStatementsResponse, GetAllStatementsResponses, GetAllTaxRatesData, GetAllTaxRatesError, GetAllTaxRatesErrors, GetAllTaxRatesResponse, GetAllTaxRatesResponses, GetAllTermsData, GetAllTermsError, GetAllTermsErrors, GetAllTermsResponse, GetAllTermsResponses, GetBalanceData, GetBalanceError, GetBalanceErrors, GetBalanceResponse, GetBalanceResponses, GetCheckoutSessionData, GetCheckoutSessionError, GetCheckoutSessionErrors, GetCheckoutSessionResponse, GetCheckoutSessionResponses, GetCustomerData, GetCustomerError, GetCustomerErrors, GetCustomerPaymentMethodsData, GetCustomerPaymentMethodsError, GetCustomerPaymentMethodsErrors, GetCustomerPaymentMethodsResponse, GetCustomerPaymentMethodsResponses, GetCustomerResponse, GetCustomerResponses, GetEventData, GetEventError, GetEventErrors, GetEventResponse, GetEventResponses, GetPaymentFlowData, GetPaymentFlowError, GetPaymentFlowErrors, GetPaymentFlowRefundsData, GetPaymentFlowRefundsError, GetPaymentFlowRefundsErrors, GetPaymentFlowRefundsResponse, GetPaymentFlowRefundsResponses, GetPaymentFlowResponse, GetPaymentFlowResponses, GetPaymentMethodByCardData, GetPaymentMethodByCardError, GetPaymentMethodByCardErrors, GetPaymentMethodByCardResponse, GetPaymentMethodByCardResponses, GetPaymentMethodConfigurationData, GetPaymentMethodConfigurationError, GetPaymentMethodConfigurationErrors, GetPaymentMethodConfigurationResponse, GetPaymentMethodConfigurationResponses, GetPaymentMethodData, GetPaymentMethodError, GetPaymentMethodErrors, GetPaymentMethodResponse, GetPaymentMethodResponses, GetPaymentRefundData, GetPaymentRefundError, GetPaymentRefundErrors, GetPaymentRefundResponse, GetPaymentRefundResponses, GetPaymentTransactionData, GetPaymentTransactionError, GetPaymentTransactionErrors, GetPaymentTransactionResponse, GetPaymentTransactionResponses, GetPriceData, GetPriceError, GetPriceErrors, GetPriceResponse, GetPriceResponses, GetProductData, GetProductError, GetProductErrors, GetProductResponse, GetProductResponses, GetSetupFlowData, GetSetupFlowError, GetSetupFlowErrors, GetSetupFlowResponse, GetSetupFlowResponses, GetStatementData, GetStatementError, GetStatementErrors, GetStatementResponse, GetStatementResponses, GetTaxRateData, GetTaxRateError, GetTaxRateErrors, GetTaxRateResponse, GetTaxRateResponses, GetTermData, GetTermError, GetTermErrors, GetTermResponse, GetTermResponses, LineItemRequest, Locale, PaymentFlowCancellationReason, PaymentFlowCancelRequest, PaymentFlowCaptureRequest, PaymentFlowConfirmRequest, PaymentFlowCreateRequest, PaymentFlowDataRequest, PaymentFlowListResponse, PaymentFlowPaymentMethodOptionsCardRequest, PaymentFlowPaymentMethodOptionsRequest, PaymentFlowResponse, PaymentFlowStatus, PaymentFlowUpdateRequest, PaymentMethodApplePayCreateRequest, PaymentMethodApplePayUpdateRequest, PaymentMethodAttachRequest, PaymentMethodBillingAddressRequest, PaymentMethodBillingAddressResponse, PaymentMethodBillingDetailsRequest, PaymentMethodBillingDetailsResponse, PaymentMethodCardBillingDetailsRequest, PaymentMethodCardCreateRequest, PaymentMethodCardDetailsResponse, PaymentMethodCardResponse, PaymentMethodCardUpdateRequest, PaymentMethodConfigurationDetailsResponse, PaymentMethodConfigurationDisplayPreference, PaymentMethodConfigurationListResponse, PaymentMethodConfigurationSettingResponse, PaymentMethodConfigurationUpdateRequest, PaymentMethodCreateCardDetailsRequest, PaymentMethodCreateRequest, PaymentMethodListResponse, PaymentMethodPayPayCreateRequest, PaymentMethodPayPayResponse, PaymentMethodPayPayUpdateRequest, PaymentMethodResponse, PaymentMethodTypes, PaymentMethodUpdateRequest, PaymentRefundCreateRequest, PaymentRefundListResponse, PaymentRefundReason, PaymentRefundResponse, PaymentRefundStatus, PaymentRefundUpdateRequest, PaymentTransactionListResponse, PaymentTransactionResponse, PaymentTransactionType, PayPayConfigRequest, PriceCreateRequest, PriceDetailsResponse, PriceListResponse, PriceType, PriceUpdateRequest, ProductCreateRequest, ProductDeletedResponse, ProductDetailsResponse, ProductListResponse, ProductUpdateRequest, SetupFlowCancellationReason, SetupFlowCancelRequest, SetupFlowCreateRequest, SetupFlowDataRequest, SetupFlowListResponse, SetupFlowPaymentMethodOptionsCardRequest, SetupFlowPaymentMethodOptionsRequest, SetupFlowResponse, SetupFlowStatus, SetupFlowUpdateRequest, StatementItemResponse, StatementListResponse, StatementResponse, StatementSubject, StatementType, StatementUrlResponse, TaxRateCreateRequest, TaxRateDetailsResponse, TaxRateListResponse, TaxRateUpdateRequest, TermListResponse, TermResponse, UpdateCheckoutSessionData, UpdateCheckoutSessionError, UpdateCheckoutSessionErrors, UpdateCheckoutSessionResponse, UpdateCheckoutSessionResponses, UpdateCustomerData, UpdateCustomerError, UpdateCustomerErrors, UpdateCustomerResponse, UpdateCustomerResponses, UpdatePaymentFlowData, UpdatePaymentFlowError, UpdatePaymentFlowErrors, UpdatePaymentFlowResponse, UpdatePaymentFlowResponses, UpdatePaymentMethodConfigurationData, UpdatePaymentMethodConfigurationError, UpdatePaymentMethodConfigurationErrors, UpdatePaymentMethodConfigurationResponse, UpdatePaymentMethodConfigurationResponses, UpdatePaymentMethodData, UpdatePaymentMethodError, UpdatePaymentMethodErrors, UpdatePaymentMethodResponse, UpdatePaymentMethodResponses, UpdatePaymentRefundData, UpdatePaymentRefundError, UpdatePaymentRefundErrors, UpdatePaymentRefundResponse, UpdatePaymentRefundResponses, UpdatePriceData, UpdatePriceError, UpdatePriceErrors, UpdatePriceResponse, UpdatePriceResponses, UpdateProductData, UpdateProductError, UpdateProductErrors, UpdateProductResponse, UpdateProductResponses, UpdateSetupFlowData, UpdateSetupFlowError, UpdateSetupFlowErrors, UpdateSetupFlowResponse, UpdateSetupFlowResponses, UpdateTaxRateData, UpdateTaxRateError, UpdateTaxRateErrors, UpdateTaxRateResponse, UpdateTaxRateResponses, Usage } from './types.gen'; +export { attachPaymentMethod, cancelPaymentFlow, cancelSetupFlow, capturePaymentFlow, confirmPaymentFlow, createBalanceUrl, createCheckoutSession, createCustomer, createPaymentFlow, createPaymentMethod, createPaymentRefund, createPrice, createProduct, createSetupFlow, createStatementUrl, createTaxRate, deleteCustomer, deleteProduct, detachPaymentMethod, getAllBalances, getAllCheckoutSessionLineItems, getAllCheckoutSessions, getAllCustomers, getAllEvents, getAllPaymentDisputes, getAllPaymentFlows, getAllPaymentMethodConfigurations, getAllPaymentMethods, getAllPaymentRefunds, getAllPaymentTransactions, getAllPrices, getAllProducts, getAllSetupFlows, getAllStatements, getAllTaxRates, getAllTerms, getBalance, getCheckoutSession, getCustomer, getCustomerPaymentMethods, getEvent, getPaymentDispute, getPaymentFlow, getPaymentFlowRefunds, getPaymentMethod, getPaymentMethodByCard, getPaymentMethodConfiguration, getPaymentRefund, getPaymentTransaction, getPrice, getProduct, getSetupFlow, getStatement, getTaxRate, getTerm, type Options, updateCheckoutSession, updateCustomer, updatePaymentFlow, updatePaymentMethod, updatePaymentMethodConfiguration, updatePaymentRefund, updatePrice, updateProduct, updateSetupFlow, updateTaxRate } from './sdk.gen'; +export type { AttachPaymentMethodData, AttachPaymentMethodError, AttachPaymentMethodErrors, AttachPaymentMethodResponse, AttachPaymentMethodResponses, BalanceListResponse, BalanceResponse, BalanceState, BalanceUrlResponse, BankInfoResponse, CancelPaymentFlowData, CancelPaymentFlowError, CancelPaymentFlowErrors, CancelPaymentFlowResponse, CancelPaymentFlowResponses, CancelSetupFlowData, CancelSetupFlowError, CancelSetupFlowErrors, CancelSetupFlowResponse, CancelSetupFlowResponses, CaptureMethod, CapturePaymentFlowData, CapturePaymentFlowError, CapturePaymentFlowErrors, CapturePaymentFlowResponse, CapturePaymentFlowResponses, CardConfigRequest, CheckoutSessionCreateRequest, CheckoutSessionCustomerDetailsAddressResponse, CheckoutSessionCustomerDetailsResponse, CheckoutSessionDetailsResponse, CheckoutSessionLineItemDataResponse, CheckoutSessionLineItemListResponse, CheckoutSessionListResponse, CheckoutSessionMode, CheckoutSessionPaymentMethodOptionsCardRequest, CheckoutSessionPaymentMethodOptionsRequest, CheckoutSessionStatus, CheckoutSessionSubmitType, CheckoutSessionUiMode, CheckoutSessionUpdateRequest, ClientOptions, ConfirmPaymentFlowData, ConfirmPaymentFlowError, ConfirmPaymentFlowErrors, ConfirmPaymentFlowResponse, ConfirmPaymentFlowResponses, Country, CreateBalanceUrlData, CreateBalanceUrlError, CreateBalanceUrlErrors, CreateBalanceUrlResponse, CreateBalanceUrlResponses, CreateCheckoutSessionData, CreateCheckoutSessionError, CreateCheckoutSessionErrors, CreateCheckoutSessionResponse, CreateCheckoutSessionResponses, CreateCustomerData, CreateCustomerError, CreateCustomerErrors, CreateCustomerResponse, CreateCustomerResponses, CreatePaymentFlowData, CreatePaymentFlowError, CreatePaymentFlowErrors, CreatePaymentFlowResponse, CreatePaymentFlowResponses, CreatePaymentMethodData, CreatePaymentMethodError, CreatePaymentMethodErrors, CreatePaymentMethodResponse, CreatePaymentMethodResponses, CreatePaymentRefundData, CreatePaymentRefundError, CreatePaymentRefundErrors, CreatePaymentRefundResponse, CreatePaymentRefundResponses, CreatePriceData, CreatePriceError, CreatePriceErrors, CreatePriceResponse, CreatePriceResponses, CreateProductData, CreateProductError, CreateProductErrors, CreateProductResponse, CreateProductResponses, CreateSetupFlowData, CreateSetupFlowError, CreateSetupFlowErrors, CreateSetupFlowResponse, CreateSetupFlowResponses, CreateStatementUrlData, CreateStatementUrlError, CreateStatementUrlErrors, CreateStatementUrlResponse, CreateStatementUrlResponses, CreateTaxRateData, CreateTaxRateError, CreateTaxRateErrors, CreateTaxRateResponse, CreateTaxRateResponses, Currency, CustomerCreateRequest, CustomerCreation, CustomerListResponse, CustomerResponse, CustomerUpdateRequest, DeleteCustomerData, DeleteCustomerError, DeleteCustomerErrors, DeleteCustomerResponse, DeleteCustomerResponses, DeleteProductData, DeleteProductError, DeleteProductErrors, DeleteProductResponse, DeleteProductResponses, DetachPaymentMethodData, DetachPaymentMethodError, DetachPaymentMethodErrors, DetachPaymentMethodResponse, DetachPaymentMethodResponses, DisplayPreferenceRequest, ErrorResponse, EventListResponse, EventResponse, GetAllBalancesData, GetAllBalancesError, GetAllBalancesErrors, GetAllBalancesResponse, GetAllBalancesResponses, GetAllCheckoutSessionLineItemsData, GetAllCheckoutSessionLineItemsError, GetAllCheckoutSessionLineItemsErrors, GetAllCheckoutSessionLineItemsResponse, GetAllCheckoutSessionLineItemsResponses, GetAllCheckoutSessionsData, GetAllCheckoutSessionsError, GetAllCheckoutSessionsErrors, GetAllCheckoutSessionsResponse, GetAllCheckoutSessionsResponses, GetAllCustomersData, GetAllCustomersError, GetAllCustomersErrors, GetAllCustomersResponse, GetAllCustomersResponses, GetAllEventsData, GetAllEventsError, GetAllEventsErrors, GetAllEventsResponse, GetAllEventsResponses, GetAllPaymentDisputesData, GetAllPaymentDisputesError, GetAllPaymentDisputesErrors, GetAllPaymentDisputesResponse, GetAllPaymentDisputesResponses, GetAllPaymentFlowsData, GetAllPaymentFlowsError, GetAllPaymentFlowsErrors, GetAllPaymentFlowsResponse, GetAllPaymentFlowsResponses, GetAllPaymentMethodConfigurationsData, GetAllPaymentMethodConfigurationsError, GetAllPaymentMethodConfigurationsErrors, GetAllPaymentMethodConfigurationsResponse, GetAllPaymentMethodConfigurationsResponses, GetAllPaymentMethodsData, GetAllPaymentMethodsError, GetAllPaymentMethodsErrors, GetAllPaymentMethodsResponse, GetAllPaymentMethodsResponses, GetAllPaymentRefundsData, GetAllPaymentRefundsError, GetAllPaymentRefundsErrors, GetAllPaymentRefundsResponse, GetAllPaymentRefundsResponses, GetAllPaymentTransactionsData, GetAllPaymentTransactionsError, GetAllPaymentTransactionsErrors, GetAllPaymentTransactionsResponse, GetAllPaymentTransactionsResponses, GetAllPricesData, GetAllPricesError, GetAllPricesErrors, GetAllPricesResponse, GetAllPricesResponses, GetAllProductsData, GetAllProductsError, GetAllProductsErrors, GetAllProductsResponse, GetAllProductsResponses, GetAllSetupFlowsData, GetAllSetupFlowsError, GetAllSetupFlowsErrors, GetAllSetupFlowsResponse, GetAllSetupFlowsResponses, GetAllStatementsData, GetAllStatementsError, GetAllStatementsErrors, GetAllStatementsResponse, GetAllStatementsResponses, GetAllTaxRatesData, GetAllTaxRatesError, GetAllTaxRatesErrors, GetAllTaxRatesResponse, GetAllTaxRatesResponses, GetAllTermsData, GetAllTermsError, GetAllTermsErrors, GetAllTermsResponse, GetAllTermsResponses, GetBalanceData, GetBalanceError, GetBalanceErrors, GetBalanceResponse, GetBalanceResponses, GetCheckoutSessionData, GetCheckoutSessionError, GetCheckoutSessionErrors, GetCheckoutSessionResponse, GetCheckoutSessionResponses, GetCustomerData, GetCustomerError, GetCustomerErrors, GetCustomerPaymentMethodsData, GetCustomerPaymentMethodsError, GetCustomerPaymentMethodsErrors, GetCustomerPaymentMethodsResponse, GetCustomerPaymentMethodsResponses, GetCustomerResponse, GetCustomerResponses, GetEventData, GetEventError, GetEventErrors, GetEventResponse, GetEventResponses, GetPaymentDisputeData, GetPaymentDisputeError, GetPaymentDisputeErrors, GetPaymentDisputeResponse, GetPaymentDisputeResponses, GetPaymentFlowData, GetPaymentFlowError, GetPaymentFlowErrors, GetPaymentFlowRefundsData, GetPaymentFlowRefundsError, GetPaymentFlowRefundsErrors, GetPaymentFlowRefundsResponse, GetPaymentFlowRefundsResponses, GetPaymentFlowResponse, GetPaymentFlowResponses, GetPaymentMethodByCardData, GetPaymentMethodByCardError, GetPaymentMethodByCardErrors, GetPaymentMethodByCardResponse, GetPaymentMethodByCardResponses, GetPaymentMethodConfigurationData, GetPaymentMethodConfigurationError, GetPaymentMethodConfigurationErrors, GetPaymentMethodConfigurationResponse, GetPaymentMethodConfigurationResponses, GetPaymentMethodData, GetPaymentMethodError, GetPaymentMethodErrors, GetPaymentMethodResponse, GetPaymentMethodResponses, GetPaymentRefundData, GetPaymentRefundError, GetPaymentRefundErrors, GetPaymentRefundResponse, GetPaymentRefundResponses, GetPaymentTransactionData, GetPaymentTransactionError, GetPaymentTransactionErrors, GetPaymentTransactionResponse, GetPaymentTransactionResponses, GetPriceData, GetPriceError, GetPriceErrors, GetPriceResponse, GetPriceResponses, GetProductData, GetProductError, GetProductErrors, GetProductResponse, GetProductResponses, GetSetupFlowData, GetSetupFlowError, GetSetupFlowErrors, GetSetupFlowResponse, GetSetupFlowResponses, GetStatementData, GetStatementError, GetStatementErrors, GetStatementResponse, GetStatementResponses, GetTaxRateData, GetTaxRateError, GetTaxRateErrors, GetTaxRateResponse, GetTaxRateResponses, GetTermData, GetTermError, GetTermErrors, GetTermResponse, GetTermResponses, LineItemRequest, Locale, PaymentDisputeListResponse, PaymentDisputeReason, PaymentDisputeResponse, PaymentDisputeStatus, PaymentFlowCancellationReason, PaymentFlowCancelRequest, PaymentFlowCaptureRequest, PaymentFlowConfirmRequest, PaymentFlowCreateRequest, PaymentFlowDataRequest, PaymentFlowListResponse, PaymentFlowPaymentMethodOptionsCardRequest, PaymentFlowPaymentMethodOptionsRequest, PaymentFlowResponse, PaymentFlowStatus, PaymentFlowUpdateRequest, PaymentMethodApplePayCreateRequest, PaymentMethodApplePayUpdateRequest, PaymentMethodAttachRequest, PaymentMethodBillingAddressRequest, PaymentMethodBillingAddressResponse, PaymentMethodBillingDetailsRequest, PaymentMethodBillingDetailsResponse, PaymentMethodCardBillingDetailsRequest, PaymentMethodCardCreateRequest, PaymentMethodCardDetailsResponse, PaymentMethodCardResponse, PaymentMethodCardUpdateRequest, PaymentMethodConfigurationDetailsResponse, PaymentMethodConfigurationDisplayPreference, PaymentMethodConfigurationListResponse, PaymentMethodConfigurationSettingResponse, PaymentMethodConfigurationUpdateRequest, PaymentMethodCreateCardDetailsRequest, PaymentMethodCreateRequest, PaymentMethodListResponse, PaymentMethodPayPayCreateRequest, PaymentMethodPayPayResponse, PaymentMethodPayPayUpdateRequest, PaymentMethodResponse, PaymentMethodTypes, PaymentMethodUpdateRequest, PaymentRefundCreateRequest, PaymentRefundListResponse, PaymentRefundReason, PaymentRefundResponse, PaymentRefundStatus, PaymentRefundUpdateRequest, PaymentTransactionListResponse, PaymentTransactionResponse, PaymentTransactionType, PayPayConfigRequest, PriceCreateRequest, PriceDetailsResponse, PriceListResponse, PriceType, PriceUpdateRequest, ProductCreateRequest, ProductDeletedResponse, ProductDetailsResponse, ProductListResponse, ProductUpdateRequest, SetupFlowCancellationReason, SetupFlowCancelRequest, SetupFlowCreateRequest, SetupFlowDataRequest, SetupFlowListResponse, SetupFlowPaymentMethodOptionsCardRequest, SetupFlowPaymentMethodOptionsRequest, SetupFlowResponse, SetupFlowStatus, SetupFlowUpdateRequest, StatementItemResponse, StatementListResponse, StatementResponse, StatementSubject, StatementType, StatementUrlResponse, TaxRateCreateRequest, TaxRateDetailsResponse, TaxRateListResponse, TaxRateUpdateRequest, TermListResponse, TermResponse, UpdateCheckoutSessionData, UpdateCheckoutSessionError, UpdateCheckoutSessionErrors, UpdateCheckoutSessionResponse, UpdateCheckoutSessionResponses, UpdateCustomerData, UpdateCustomerError, UpdateCustomerErrors, UpdateCustomerResponse, UpdateCustomerResponses, UpdatePaymentFlowData, UpdatePaymentFlowError, UpdatePaymentFlowErrors, UpdatePaymentFlowResponse, UpdatePaymentFlowResponses, UpdatePaymentMethodConfigurationData, UpdatePaymentMethodConfigurationError, UpdatePaymentMethodConfigurationErrors, UpdatePaymentMethodConfigurationResponse, UpdatePaymentMethodConfigurationResponses, UpdatePaymentMethodData, UpdatePaymentMethodError, UpdatePaymentMethodErrors, UpdatePaymentMethodResponse, UpdatePaymentMethodResponses, UpdatePaymentRefundData, UpdatePaymentRefundError, UpdatePaymentRefundErrors, UpdatePaymentRefundResponse, UpdatePaymentRefundResponses, UpdatePriceData, UpdatePriceError, UpdatePriceErrors, UpdatePriceResponse, UpdatePriceResponses, UpdateProductData, UpdateProductError, UpdateProductErrors, UpdateProductResponse, UpdateProductResponses, UpdateSetupFlowData, UpdateSetupFlowError, UpdateSetupFlowErrors, UpdateSetupFlowResponse, UpdateSetupFlowResponses, UpdateTaxRateData, UpdateTaxRateError, UpdateTaxRateErrors, UpdateTaxRateResponse, UpdateTaxRateResponses, Usage } from './types.gen'; diff --git a/client/sdk.gen.ts b/client/sdk.gen.ts index b2e6fa7..91d5ba7 100644 --- a/client/sdk.gen.ts +++ b/client/sdk.gen.ts @@ -2,7 +2,7 @@ import type { Client, Options as Options2, TDataShape } from './client'; import { client } from './client.gen'; -import type { AttachPaymentMethodData, AttachPaymentMethodErrors, AttachPaymentMethodResponses, CancelPaymentFlowData, CancelPaymentFlowErrors, CancelPaymentFlowResponses, CancelSetupFlowData, CancelSetupFlowErrors, CancelSetupFlowResponses, CapturePaymentFlowData, CapturePaymentFlowErrors, CapturePaymentFlowResponses, ConfirmPaymentFlowData, ConfirmPaymentFlowErrors, ConfirmPaymentFlowResponses, CreateBalanceUrlData, CreateBalanceUrlErrors, CreateBalanceUrlResponses, CreateCheckoutSessionData, CreateCheckoutSessionErrors, CreateCheckoutSessionResponses, CreateCustomerData, CreateCustomerErrors, CreateCustomerResponses, CreatePaymentFlowData, CreatePaymentFlowErrors, CreatePaymentFlowResponses, CreatePaymentMethodData, CreatePaymentMethodErrors, CreatePaymentMethodResponses, CreatePaymentRefundData, CreatePaymentRefundErrors, CreatePaymentRefundResponses, CreatePriceData, CreatePriceErrors, CreatePriceResponses, CreateProductData, CreateProductErrors, CreateProductResponses, CreateSetupFlowData, CreateSetupFlowErrors, CreateSetupFlowResponses, CreateStatementUrlData, CreateStatementUrlErrors, CreateStatementUrlResponses, CreateTaxRateData, CreateTaxRateErrors, CreateTaxRateResponses, DeleteCustomerData, DeleteCustomerErrors, DeleteCustomerResponses, DeleteProductData, DeleteProductErrors, DeleteProductResponses, DetachPaymentMethodData, DetachPaymentMethodErrors, DetachPaymentMethodResponses, GetAllBalancesData, GetAllBalancesErrors, GetAllBalancesResponses, GetAllCheckoutSessionLineItemsData, GetAllCheckoutSessionLineItemsErrors, GetAllCheckoutSessionLineItemsResponses, GetAllCheckoutSessionsData, GetAllCheckoutSessionsErrors, GetAllCheckoutSessionsResponses, GetAllCustomersData, GetAllCustomersErrors, GetAllCustomersResponses, GetAllEventsData, GetAllEventsErrors, GetAllEventsResponses, GetAllPaymentFlowsData, GetAllPaymentFlowsErrors, GetAllPaymentFlowsResponses, GetAllPaymentMethodConfigurationsData, GetAllPaymentMethodConfigurationsErrors, GetAllPaymentMethodConfigurationsResponses, GetAllPaymentMethodsData, GetAllPaymentMethodsErrors, GetAllPaymentMethodsResponses, GetAllPaymentRefundsData, GetAllPaymentRefundsErrors, GetAllPaymentRefundsResponses, GetAllPaymentTransactionsData, GetAllPaymentTransactionsErrors, GetAllPaymentTransactionsResponses, GetAllPricesData, GetAllPricesErrors, GetAllPricesResponses, GetAllProductsData, GetAllProductsErrors, GetAllProductsResponses, GetAllSetupFlowsData, GetAllSetupFlowsErrors, GetAllSetupFlowsResponses, GetAllStatementsData, GetAllStatementsErrors, GetAllStatementsResponses, GetAllTaxRatesData, GetAllTaxRatesErrors, GetAllTaxRatesResponses, GetAllTermsData, GetAllTermsErrors, GetAllTermsResponses, GetBalanceData, GetBalanceErrors, GetBalanceResponses, GetCheckoutSessionData, GetCheckoutSessionErrors, GetCheckoutSessionResponses, GetCustomerData, GetCustomerErrors, GetCustomerPaymentMethodsData, GetCustomerPaymentMethodsErrors, GetCustomerPaymentMethodsResponses, GetCustomerResponses, GetEventData, GetEventErrors, GetEventResponses, GetPaymentFlowData, GetPaymentFlowErrors, GetPaymentFlowRefundsData, GetPaymentFlowRefundsErrors, GetPaymentFlowRefundsResponses, GetPaymentFlowResponses, GetPaymentMethodByCardData, GetPaymentMethodByCardErrors, GetPaymentMethodByCardResponses, GetPaymentMethodConfigurationData, GetPaymentMethodConfigurationErrors, GetPaymentMethodConfigurationResponses, GetPaymentMethodData, GetPaymentMethodErrors, GetPaymentMethodResponses, GetPaymentRefundData, GetPaymentRefundErrors, GetPaymentRefundResponses, GetPaymentTransactionData, GetPaymentTransactionErrors, GetPaymentTransactionResponses, GetPriceData, GetPriceErrors, GetPriceResponses, GetProductData, GetProductErrors, GetProductResponses, GetSetupFlowData, GetSetupFlowErrors, GetSetupFlowResponses, GetStatementData, GetStatementErrors, GetStatementResponses, GetTaxRateData, GetTaxRateErrors, GetTaxRateResponses, GetTermData, GetTermErrors, GetTermResponses, UpdateCheckoutSessionData, UpdateCheckoutSessionErrors, UpdateCheckoutSessionResponses, UpdateCustomerData, UpdateCustomerErrors, UpdateCustomerResponses, UpdatePaymentFlowData, UpdatePaymentFlowErrors, UpdatePaymentFlowResponses, UpdatePaymentMethodConfigurationData, UpdatePaymentMethodConfigurationErrors, UpdatePaymentMethodConfigurationResponses, UpdatePaymentMethodData, UpdatePaymentMethodErrors, UpdatePaymentMethodResponses, UpdatePaymentRefundData, UpdatePaymentRefundErrors, UpdatePaymentRefundResponses, UpdatePriceData, UpdatePriceErrors, UpdatePriceResponses, UpdateProductData, UpdateProductErrors, UpdateProductResponses, UpdateSetupFlowData, UpdateSetupFlowErrors, UpdateSetupFlowResponses, UpdateTaxRateData, UpdateTaxRateErrors, UpdateTaxRateResponses } from './types.gen'; +import type { AttachPaymentMethodData, AttachPaymentMethodErrors, AttachPaymentMethodResponses, CancelPaymentFlowData, CancelPaymentFlowErrors, CancelPaymentFlowResponses, CancelSetupFlowData, CancelSetupFlowErrors, CancelSetupFlowResponses, CapturePaymentFlowData, CapturePaymentFlowErrors, CapturePaymentFlowResponses, ConfirmPaymentFlowData, ConfirmPaymentFlowErrors, ConfirmPaymentFlowResponses, CreateBalanceUrlData, CreateBalanceUrlErrors, CreateBalanceUrlResponses, CreateCheckoutSessionData, CreateCheckoutSessionErrors, CreateCheckoutSessionResponses, CreateCustomerData, CreateCustomerErrors, CreateCustomerResponses, CreatePaymentFlowData, CreatePaymentFlowErrors, CreatePaymentFlowResponses, CreatePaymentMethodData, CreatePaymentMethodErrors, CreatePaymentMethodResponses, CreatePaymentRefundData, CreatePaymentRefundErrors, CreatePaymentRefundResponses, CreatePriceData, CreatePriceErrors, CreatePriceResponses, CreateProductData, CreateProductErrors, CreateProductResponses, CreateSetupFlowData, CreateSetupFlowErrors, CreateSetupFlowResponses, CreateStatementUrlData, CreateStatementUrlErrors, CreateStatementUrlResponses, CreateTaxRateData, CreateTaxRateErrors, CreateTaxRateResponses, DeleteCustomerData, DeleteCustomerErrors, DeleteCustomerResponses, DeleteProductData, DeleteProductErrors, DeleteProductResponses, DetachPaymentMethodData, DetachPaymentMethodErrors, DetachPaymentMethodResponses, GetAllBalancesData, GetAllBalancesErrors, GetAllBalancesResponses, GetAllCheckoutSessionLineItemsData, GetAllCheckoutSessionLineItemsErrors, GetAllCheckoutSessionLineItemsResponses, GetAllCheckoutSessionsData, GetAllCheckoutSessionsErrors, GetAllCheckoutSessionsResponses, GetAllCustomersData, GetAllCustomersErrors, GetAllCustomersResponses, GetAllEventsData, GetAllEventsErrors, GetAllEventsResponses, GetAllPaymentDisputesData, GetAllPaymentDisputesErrors, GetAllPaymentDisputesResponses, GetAllPaymentFlowsData, GetAllPaymentFlowsErrors, GetAllPaymentFlowsResponses, GetAllPaymentMethodConfigurationsData, GetAllPaymentMethodConfigurationsErrors, GetAllPaymentMethodConfigurationsResponses, GetAllPaymentMethodsData, GetAllPaymentMethodsErrors, GetAllPaymentMethodsResponses, GetAllPaymentRefundsData, GetAllPaymentRefundsErrors, GetAllPaymentRefundsResponses, GetAllPaymentTransactionsData, GetAllPaymentTransactionsErrors, GetAllPaymentTransactionsResponses, GetAllPricesData, GetAllPricesErrors, GetAllPricesResponses, GetAllProductsData, GetAllProductsErrors, GetAllProductsResponses, GetAllSetupFlowsData, GetAllSetupFlowsErrors, GetAllSetupFlowsResponses, GetAllStatementsData, GetAllStatementsErrors, GetAllStatementsResponses, GetAllTaxRatesData, GetAllTaxRatesErrors, GetAllTaxRatesResponses, GetAllTermsData, GetAllTermsErrors, GetAllTermsResponses, GetBalanceData, GetBalanceErrors, GetBalanceResponses, GetCheckoutSessionData, GetCheckoutSessionErrors, GetCheckoutSessionResponses, GetCustomerData, GetCustomerErrors, GetCustomerPaymentMethodsData, GetCustomerPaymentMethodsErrors, GetCustomerPaymentMethodsResponses, GetCustomerResponses, GetEventData, GetEventErrors, GetEventResponses, GetPaymentDisputeData, GetPaymentDisputeErrors, GetPaymentDisputeResponses, GetPaymentFlowData, GetPaymentFlowErrors, GetPaymentFlowRefundsData, GetPaymentFlowRefundsErrors, GetPaymentFlowRefundsResponses, GetPaymentFlowResponses, GetPaymentMethodByCardData, GetPaymentMethodByCardErrors, GetPaymentMethodByCardResponses, GetPaymentMethodConfigurationData, GetPaymentMethodConfigurationErrors, GetPaymentMethodConfigurationResponses, GetPaymentMethodData, GetPaymentMethodErrors, GetPaymentMethodResponses, GetPaymentRefundData, GetPaymentRefundErrors, GetPaymentRefundResponses, GetPaymentTransactionData, GetPaymentTransactionErrors, GetPaymentTransactionResponses, GetPriceData, GetPriceErrors, GetPriceResponses, GetProductData, GetProductErrors, GetProductResponses, GetSetupFlowData, GetSetupFlowErrors, GetSetupFlowResponses, GetStatementData, GetStatementErrors, GetStatementResponses, GetTaxRateData, GetTaxRateErrors, GetTaxRateResponses, GetTermData, GetTermErrors, GetTermResponses, UpdateCheckoutSessionData, UpdateCheckoutSessionErrors, UpdateCheckoutSessionResponses, UpdateCustomerData, UpdateCustomerErrors, UpdateCustomerResponses, UpdatePaymentFlowData, UpdatePaymentFlowErrors, UpdatePaymentFlowResponses, UpdatePaymentMethodConfigurationData, UpdatePaymentMethodConfigurationErrors, UpdatePaymentMethodConfigurationResponses, UpdatePaymentMethodData, UpdatePaymentMethodErrors, UpdatePaymentMethodResponses, UpdatePaymentRefundData, UpdatePaymentRefundErrors, UpdatePaymentRefundResponses, UpdatePriceData, UpdatePriceErrors, UpdatePriceResponses, UpdateProductData, UpdateProductErrors, UpdateProductResponses, UpdateSetupFlowData, UpdateSetupFlowErrors, UpdateSetupFlowResponses, UpdateTaxRateData, UpdateTaxRateErrors, UpdateTaxRateResponses } from './types.gen'; export type Options = Options2 & { /** @@ -359,6 +359,24 @@ export const createPaymentRefund = (option } }); +/** + * Get Payment Dispute + */ +export const getPaymentDispute = (options: Options) => (options.client ?? client).get({ + security: [{ scheme: 'basic', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/v2/payment_disputes/{payment_dispute_id}', + ...options +}); + +/** + * Get All Payment Disputes + */ +export const getAllPaymentDisputes = (options?: Options) => (options?.client ?? client).get({ + security: [{ scheme: 'basic', type: 'http' }, { scheme: 'bearer', type: 'http' }], + url: '/v2/payment_disputes', + ...options +}); + /** * Get Setup Flow */ diff --git a/client/types.gen.ts b/client/types.gen.ts index 4078ddb..96802b7 100644 --- a/client/types.gen.ts +++ b/client/types.gen.ts @@ -609,7 +609,7 @@ export type CheckoutSessionLineItemDataResponse = { * * 説明 */ - description: string; + description: string | null; /** * 料金情報 */ @@ -1090,6 +1090,149 @@ export type PayPayConfigRequest = { display_preference?: DisplayPreferenceRequest | null; }; +/** + * PaymentDisputeListResponse + */ +export type PaymentDisputeListResponse = { + /** + * Object + */ + object?: 'list'; + /** + * Url + * + * リスト取得URL + */ + url: string; + /** + * Has More + * + * 次のページがあるかどうか + */ + has_more: boolean; + /** + * Data + * + * PaymentDispute リスト + */ + data: Array; +}; + +/** + * PaymentDisputeReason + */ +export type PaymentDisputeReason = 'researching' | 'researching_fraudulent' | 'warned_fraudulent' | 'confirmed_fraudulent' | 'unrecognized' | 'fraudulent' | 'product_not_received' | 'online_fraudulent' | 'incorrect_account_details' | 'receiving_chargeback' | 'duplicate' | 'not_authorized' | 'subscription_canceled' | 'check_returned' | 'other'; + +/** + * PaymentDisputeResponse + */ +export type PaymentDisputeResponse = { + /** + * Object + */ + object?: 'payment_dispute'; + /** + * Id + * + * PaymentDispute ID + */ + id: string; + /** + * Livemode + * + * 本番環境かどうか + */ + livemode: boolean; + /** + * Payment Flow Id + * + * 関連する PaymentFlow の ID + */ + payment_flow_id: string; + /** + * Amount + * + * 金額 + */ + amount: number; + /** + * 通貨コード (ISO 4217) + */ + currency: Currency; + /** + * disputeのステータス + * + * | 値 | + * |:---| + * | **pre_warning_needs_response**: 利用照会 | + * | **warning_needs_response**: 配送保留 | + * | **warning_needs_refund**: 配送停止 | + * | **warning_under_review**: 加盟店回答済 | + * | **needs_response**: チャージバック | + * | **under_review**: 反証済 | + * | **lost**: チャージバック受入 | + * | **cancel**: 取下げ | + */ + status: PaymentDisputeStatus; + /** + * disputeの理由 + * + * | 値 | + * |:---| + * | **researching**: 利用内容確認 | + * | **researching_fraudulent**: 悪用調査 | + * | **warned_fraudulent**: 悪用懸念 | + * | **confirmed_fraudulent**: 悪用確定 | + * | **unrecognized**: 利用覚えなし | + * | **fraudulent**: 不正利用 | + * | **product_not_received**: サービスまたは商品未提供 | + * | **online_fraudulent**: 非対面不正 | + * | **incorrect_account_details**: 第三者利用 | + * | **receiving_chargeback**: チャージバック受信 | + * | **duplicate**: 重複決済 | + * | **not_authorized**: オーソリ未取得 | + * | **subscription_canceled**: 取消済リカーリング | + * | **check_returned**: 返品未処理 | + * | **other**: その他 | + */ + reason: PaymentDisputeReason | null; + /** + * Due By + * + * 回答期限 + */ + due_by: string | null; + /** + * 支払い方法の種類 + */ + payment_method_type: PaymentMethodTypes; + /** + * Metadata + * + * メタデータ + */ + metadata: { + [key: string]: string | number | boolean; + }; + /** + * Created At + * + * 作成日時 (UTC, ISO 8601 形式) + */ + created_at: string; + /** + * Updated At + * + * 更新日時 (UTC, ISO 8601 形式) + */ + updated_at: string; +}; + +/** + * PaymentDisputeStatus + */ +export type PaymentDisputeStatus = 'pre_warning_needs_response' | 'warning_needs_response' | 'warning_needs_refund' | 'warning_under_review' | 'needs_response' | 'under_review' | 'lost' | 'cancel'; + /** * PaymentFlowCancelRequest */ @@ -1152,7 +1295,7 @@ export type PaymentFlowConfirmRequest = { * | 値 | * |:---| * | **automatic**: (デフォルト) 顧客が支払いを承認すると、自動的に確定させます。 | - * | **manual**: 顧客が支払いを承認すると一旦確定を保留し、後で Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 | + * | **manual**: 顧客が支払いを承認すると一旦確定を保留し、後で Payment Flow の Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 | */ capture_method?: CaptureMethod; /** @@ -1211,7 +1354,7 @@ export type PaymentFlowCreateRequest = { * | 値 | * |:---| * | **automatic**: (デフォルト) 顧客が支払いを承認すると、自動的に確定させます。 | - * | **manual**: 顧客が支払いを承認すると一旦確定を保留し、後で Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 | + * | **manual**: 顧客が支払いを承認すると一旦確定を保留し、後で Payment Flow の Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 | */ capture_method?: CaptureMethod; /** @@ -1252,7 +1395,7 @@ export type PaymentFlowDataRequest = { * | 指定できる値 | * |:---| * | **automatic**: 顧客が支払いを承認すると自動的に確定します。 | - * | **manual**: 顧客が支払いを承認すると一旦確定を保留し、後で Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 | + * | **manual**: 顧客が支払いを承認すると一旦確定を保留し、後で Payment Flow の Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 | */ capture_method?: CaptureMethod; /** @@ -3007,7 +3150,7 @@ export type SetupFlowCreateRequest = { * * この SetupFlow で使用できる支払い方法の種類のリスト。 指定しない場合は、PAY.JP は支払い方法の設定から利用可能な支払い方法を動的に表示します。 */ - payment_method_types?: Array<'card' | 'apple_pay'>; + payment_method_types?: Array<'card'>; /** * 支払い方法が今後どのように使用されるかを指定します。指定されていない場合、この値はデフォルトで `off_session` になります。 * @@ -3249,7 +3392,7 @@ export type SetupFlowUpdateRequest = { * * この SetupFlow で使用できる支払い方法の種類のリスト。 指定しない場合は、PAY.JP は支払い方法の設定から利用可能な支払い方法を動的に表示します。 */ - payment_method_types?: Array<'card' | 'apple_pay'>; + payment_method_types?: Array<'card'>; /** * Description * @@ -4882,6 +5025,100 @@ export type CreatePaymentRefundResponses = { export type CreatePaymentRefundResponse = CreatePaymentRefundResponses[keyof CreatePaymentRefundResponses]; +export type GetPaymentDisputeData = { + body?: never; + path: { + /** + * Payment Dispute Id + */ + payment_dispute_id: string; + }; + query?: never; + url: '/v2/payment_disputes/{payment_dispute_id}'; +}; + +export type GetPaymentDisputeErrors = { + /** + * Not Found + */ + 404: ErrorResponse; + /** + * Validation Error + */ + 422: ErrorResponse; +}; + +export type GetPaymentDisputeError = GetPaymentDisputeErrors[keyof GetPaymentDisputeErrors]; + +export type GetPaymentDisputeResponses = { + /** + * Successful Response + */ + 200: PaymentDisputeResponse; +}; + +export type GetPaymentDisputeResponse = GetPaymentDisputeResponses[keyof GetPaymentDisputeResponses]; + +export type GetAllPaymentDisputesData = { + body?: never; + path?: never; + query?: { + /** + * Limit + * + * 取得するデータの最大件数 + */ + limit?: number; + /** + * Starting After + * + * このIDより後のデータを取得 + */ + starting_after?: string; + /** + * Ending Before + * + * このIDより前のデータを取得 + */ + ending_before?: string; + /** + * Payment Flow Id + * + * 取得する payment_dispute に紐づく payment_flow の ID + */ + payment_flow_id?: string | null; + /** + * Status + * + * 取得する payment_dispute のステータス。複数指定可能 + */ + status?: Array | null; + }; + url: '/v2/payment_disputes'; +}; + +export type GetAllPaymentDisputesErrors = { + /** + * Resource Missing + */ + 400: ErrorResponse; + /** + * Validation Error + */ + 422: ErrorResponse; +}; + +export type GetAllPaymentDisputesError = GetAllPaymentDisputesErrors[keyof GetAllPaymentDisputesErrors]; + +export type GetAllPaymentDisputesResponses = { + /** + * Successful Response + */ + 200: PaymentDisputeListResponse; +}; + +export type GetAllPaymentDisputesResponse = GetAllPaymentDisputesResponses[keyof GetAllPaymentDisputesResponses]; + export type GetSetupFlowData = { body?: never; path: { diff --git a/package.json b/package.json index dcafbdf..8a1273c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@payjp/payjpv2", - "version": "1.0.4", + "version": "1.0.5", "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", diff --git a/payjpv2.ts b/payjpv2.ts index 0948c74..4933123 100644 --- a/payjpv2.ts +++ b/payjpv2.ts @@ -5,7 +5,7 @@ import { type Client, } from "./client/client"; -const BINDINGS_VERSION = '1.0.4'; +const BINDINGS_VERSION = '1.0.5'; const DEFAULT_BASE_URL = "https://api.pay.jp"; export interface ClientConfig {