@payjp/payjpv2 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,1730 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+ let node_os = require("node:os");
29
+ node_os = __toESM(node_os);
30
+
31
+ //#region client/core/bodySerializer.gen.ts
32
+ const jsonBodySerializer = { bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value) };
33
+
34
+ //#endregion
35
+ //#region client/core/params.gen.ts
36
+ const extraPrefixes = Object.entries({
37
+ $body_: "body",
38
+ $headers_: "headers",
39
+ $path_: "path",
40
+ $query_: "query"
41
+ });
42
+
43
+ //#endregion
44
+ //#region client/core/serverSentEvents.gen.ts
45
+ const createSseClient = ({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url, ...options }) => {
46
+ let lastEventId;
47
+ const sleep = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
48
+ const createStream = async function* () {
49
+ let retryDelay = sseDefaultRetryDelay ?? 3e3;
50
+ let attempt = 0;
51
+ const signal = options.signal ?? new AbortController().signal;
52
+ while (true) {
53
+ if (signal.aborted) break;
54
+ attempt++;
55
+ const headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers);
56
+ if (lastEventId !== void 0) headers.set("Last-Event-ID", lastEventId);
57
+ try {
58
+ const requestInit = {
59
+ redirect: "follow",
60
+ ...options,
61
+ body: options.serializedBody,
62
+ headers,
63
+ signal
64
+ };
65
+ let request = new Request(url, requestInit);
66
+ if (onRequest) request = await onRequest(url, requestInit);
67
+ const response = await (options.fetch ?? globalThis.fetch)(request);
68
+ if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`);
69
+ if (!response.body) throw new Error("No body in SSE response");
70
+ const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
71
+ let buffer = "";
72
+ const abortHandler = () => {
73
+ try {
74
+ reader.cancel();
75
+ } catch {}
76
+ };
77
+ signal.addEventListener("abort", abortHandler);
78
+ try {
79
+ while (true) {
80
+ const { done, value } = await reader.read();
81
+ if (done) break;
82
+ buffer += value;
83
+ const chunks = buffer.split("\n\n");
84
+ buffer = chunks.pop() ?? "";
85
+ for (const chunk of chunks) {
86
+ const lines = chunk.split("\n");
87
+ const dataLines = [];
88
+ let eventName;
89
+ for (const line of lines) if (line.startsWith("data:")) dataLines.push(line.replace(/^data:\s*/, ""));
90
+ else if (line.startsWith("event:")) eventName = line.replace(/^event:\s*/, "");
91
+ else if (line.startsWith("id:")) lastEventId = line.replace(/^id:\s*/, "");
92
+ else if (line.startsWith("retry:")) {
93
+ const parsed = Number.parseInt(line.replace(/^retry:\s*/, ""), 10);
94
+ if (!Number.isNaN(parsed)) retryDelay = parsed;
95
+ }
96
+ let data;
97
+ let parsedJson = false;
98
+ if (dataLines.length) {
99
+ const rawData = dataLines.join("\n");
100
+ try {
101
+ data = JSON.parse(rawData);
102
+ parsedJson = true;
103
+ } catch {
104
+ data = rawData;
105
+ }
106
+ }
107
+ if (parsedJson) {
108
+ if (responseValidator) await responseValidator(data);
109
+ if (responseTransformer) data = await responseTransformer(data);
110
+ }
111
+ onSseEvent?.({
112
+ data,
113
+ event: eventName,
114
+ id: lastEventId,
115
+ retry: retryDelay
116
+ });
117
+ if (dataLines.length) yield data;
118
+ }
119
+ }
120
+ } finally {
121
+ signal.removeEventListener("abort", abortHandler);
122
+ reader.releaseLock();
123
+ }
124
+ break;
125
+ } catch (error) {
126
+ onSseError?.(error);
127
+ if (sseMaxRetryAttempts !== void 0 && attempt >= sseMaxRetryAttempts) break;
128
+ await sleep(Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 3e4));
129
+ }
130
+ }
131
+ };
132
+ return { stream: createStream() };
133
+ };
134
+
135
+ //#endregion
136
+ //#region client/core/pathSerializer.gen.ts
137
+ const separatorArrayExplode = (style) => {
138
+ switch (style) {
139
+ case "label": return ".";
140
+ case "matrix": return ";";
141
+ case "simple": return ",";
142
+ default: return "&";
143
+ }
144
+ };
145
+ const separatorArrayNoExplode = (style) => {
146
+ switch (style) {
147
+ case "form": return ",";
148
+ case "pipeDelimited": return "|";
149
+ case "spaceDelimited": return "%20";
150
+ default: return ",";
151
+ }
152
+ };
153
+ const separatorObjectExplode = (style) => {
154
+ switch (style) {
155
+ case "label": return ".";
156
+ case "matrix": return ";";
157
+ case "simple": return ",";
158
+ default: return "&";
159
+ }
160
+ };
161
+ const serializeArrayParam = ({ allowReserved, explode, name, style, value }) => {
162
+ if (!explode) {
163
+ const joinedValues$1 = (allowReserved ? value : value.map((v) => encodeURIComponent(v))).join(separatorArrayNoExplode(style));
164
+ switch (style) {
165
+ case "label": return `.${joinedValues$1}`;
166
+ case "matrix": return `;${name}=${joinedValues$1}`;
167
+ case "simple": return joinedValues$1;
168
+ default: return `${name}=${joinedValues$1}`;
169
+ }
170
+ }
171
+ const separator = separatorArrayExplode(style);
172
+ const joinedValues = value.map((v) => {
173
+ if (style === "label" || style === "simple") return allowReserved ? v : encodeURIComponent(v);
174
+ return serializePrimitiveParam({
175
+ allowReserved,
176
+ name,
177
+ value: v
178
+ });
179
+ }).join(separator);
180
+ return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
181
+ };
182
+ const serializePrimitiveParam = ({ allowReserved, name, value }) => {
183
+ if (value === void 0 || value === null) return "";
184
+ if (typeof value === "object") throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");
185
+ return `${name}=${allowReserved ? value : encodeURIComponent(value)}`;
186
+ };
187
+ const serializeObjectParam = ({ allowReserved, explode, name, style, value, valueOnly }) => {
188
+ if (value instanceof Date) return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`;
189
+ if (style !== "deepObject" && !explode) {
190
+ let values = [];
191
+ Object.entries(value).forEach(([key, v]) => {
192
+ values = [
193
+ ...values,
194
+ key,
195
+ allowReserved ? v : encodeURIComponent(v)
196
+ ];
197
+ });
198
+ const joinedValues$1 = values.join(",");
199
+ switch (style) {
200
+ case "form": return `${name}=${joinedValues$1}`;
201
+ case "label": return `.${joinedValues$1}`;
202
+ case "matrix": return `;${name}=${joinedValues$1}`;
203
+ default: return joinedValues$1;
204
+ }
205
+ }
206
+ const separator = separatorObjectExplode(style);
207
+ const joinedValues = Object.entries(value).map(([key, v]) => serializePrimitiveParam({
208
+ allowReserved,
209
+ name: style === "deepObject" ? `${name}[${key}]` : key,
210
+ value: v
211
+ })).join(separator);
212
+ return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
213
+ };
214
+
215
+ //#endregion
216
+ //#region client/core/utils.gen.ts
217
+ const PATH_PARAM_RE = /\{[^{}]+\}/g;
218
+ const defaultPathSerializer = ({ path, url: _url }) => {
219
+ let url = _url;
220
+ const matches = _url.match(PATH_PARAM_RE);
221
+ if (matches) for (const match of matches) {
222
+ let explode = false;
223
+ let name = match.substring(1, match.length - 1);
224
+ let style = "simple";
225
+ if (name.endsWith("*")) {
226
+ explode = true;
227
+ name = name.substring(0, name.length - 1);
228
+ }
229
+ if (name.startsWith(".")) {
230
+ name = name.substring(1);
231
+ style = "label";
232
+ } else if (name.startsWith(";")) {
233
+ name = name.substring(1);
234
+ style = "matrix";
235
+ }
236
+ const value = path[name];
237
+ if (value === void 0 || value === null) continue;
238
+ if (Array.isArray(value)) {
239
+ url = url.replace(match, serializeArrayParam({
240
+ explode,
241
+ name,
242
+ style,
243
+ value
244
+ }));
245
+ continue;
246
+ }
247
+ if (typeof value === "object") {
248
+ url = url.replace(match, serializeObjectParam({
249
+ explode,
250
+ name,
251
+ style,
252
+ value,
253
+ valueOnly: true
254
+ }));
255
+ continue;
256
+ }
257
+ if (style === "matrix") {
258
+ url = url.replace(match, `;${serializePrimitiveParam({
259
+ name,
260
+ value
261
+ })}`);
262
+ continue;
263
+ }
264
+ const replaceValue = encodeURIComponent(style === "label" ? `.${value}` : value);
265
+ url = url.replace(match, replaceValue);
266
+ }
267
+ return url;
268
+ };
269
+ const getUrl = ({ baseUrl, path, query, querySerializer, url: _url }) => {
270
+ const pathUrl = _url.startsWith("/") ? _url : `/${_url}`;
271
+ let url = (baseUrl ?? "") + pathUrl;
272
+ if (path) url = defaultPathSerializer({
273
+ path,
274
+ url
275
+ });
276
+ let search = query ? querySerializer(query) : "";
277
+ if (search.startsWith("?")) search = search.substring(1);
278
+ if (search) url += `?${search}`;
279
+ return url;
280
+ };
281
+ function getValidRequestBody(options) {
282
+ const hasBody = options.body !== void 0;
283
+ if (hasBody && options.bodySerializer) {
284
+ if ("serializedBody" in options) return options.serializedBody !== void 0 && options.serializedBody !== "" ? options.serializedBody : null;
285
+ return options.body !== "" ? options.body : null;
286
+ }
287
+ if (hasBody) return options.body;
288
+ }
289
+
290
+ //#endregion
291
+ //#region client/core/auth.gen.ts
292
+ const getAuthToken = async (auth, callback) => {
293
+ const token = typeof callback === "function" ? await callback(auth) : callback;
294
+ if (!token) return;
295
+ if (auth.scheme === "bearer") return `Bearer ${token}`;
296
+ if (auth.scheme === "basic") return `Basic ${btoa(token)}`;
297
+ return token;
298
+ };
299
+
300
+ //#endregion
301
+ //#region client/client/utils.gen.ts
302
+ const createQuerySerializer = ({ parameters = {}, ...args } = {}) => {
303
+ const querySerializer = (queryParams) => {
304
+ const search = [];
305
+ if (queryParams && typeof queryParams === "object") for (const name in queryParams) {
306
+ const value = queryParams[name];
307
+ if (value === void 0 || value === null) continue;
308
+ const options = parameters[name] || args;
309
+ if (Array.isArray(value)) {
310
+ const serializedArray = serializeArrayParam({
311
+ allowReserved: options.allowReserved,
312
+ explode: true,
313
+ name,
314
+ style: "form",
315
+ value,
316
+ ...options.array
317
+ });
318
+ if (serializedArray) search.push(serializedArray);
319
+ } else if (typeof value === "object") {
320
+ const serializedObject = serializeObjectParam({
321
+ allowReserved: options.allowReserved,
322
+ explode: true,
323
+ name,
324
+ style: "deepObject",
325
+ value,
326
+ ...options.object
327
+ });
328
+ if (serializedObject) search.push(serializedObject);
329
+ } else {
330
+ const serializedPrimitive = serializePrimitiveParam({
331
+ allowReserved: options.allowReserved,
332
+ name,
333
+ value
334
+ });
335
+ if (serializedPrimitive) search.push(serializedPrimitive);
336
+ }
337
+ }
338
+ return search.join("&");
339
+ };
340
+ return querySerializer;
341
+ };
342
+ /**
343
+ * Infers parseAs value from provided Content-Type header.
344
+ */
345
+ const getParseAs = (contentType) => {
346
+ if (!contentType) return "stream";
347
+ const cleanContent = contentType.split(";")[0]?.trim();
348
+ if (!cleanContent) return;
349
+ if (cleanContent.startsWith("application/json") || cleanContent.endsWith("+json")) return "json";
350
+ if (cleanContent === "multipart/form-data") return "formData";
351
+ if ([
352
+ "application/",
353
+ "audio/",
354
+ "image/",
355
+ "video/"
356
+ ].some((type) => cleanContent.startsWith(type))) return "blob";
357
+ if (cleanContent.startsWith("text/")) return "text";
358
+ };
359
+ const checkForExistence = (options, name) => {
360
+ if (!name) return false;
361
+ if (options.headers.has(name) || options.query?.[name] || options.headers.get("Cookie")?.includes(`${name}=`)) return true;
362
+ return false;
363
+ };
364
+ const setAuthParams = async ({ security, ...options }) => {
365
+ for (const auth of security) {
366
+ if (checkForExistence(options, auth.name)) continue;
367
+ const token = await getAuthToken(auth, options.auth);
368
+ if (!token) continue;
369
+ const name = auth.name ?? "Authorization";
370
+ switch (auth.in) {
371
+ case "query":
372
+ if (!options.query) options.query = {};
373
+ options.query[name] = token;
374
+ break;
375
+ case "cookie":
376
+ options.headers.append("Cookie", `${name}=${token}`);
377
+ break;
378
+ case "header":
379
+ default:
380
+ options.headers.set(name, token);
381
+ break;
382
+ }
383
+ }
384
+ };
385
+ const buildUrl = (options) => getUrl({
386
+ baseUrl: options.baseUrl,
387
+ path: options.path,
388
+ query: options.query,
389
+ querySerializer: typeof options.querySerializer === "function" ? options.querySerializer : createQuerySerializer(options.querySerializer),
390
+ url: options.url
391
+ });
392
+ const mergeConfigs = (a, b) => {
393
+ const config = {
394
+ ...a,
395
+ ...b
396
+ };
397
+ if (config.baseUrl?.endsWith("/")) config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1);
398
+ config.headers = mergeHeaders(a.headers, b.headers);
399
+ return config;
400
+ };
401
+ const headersEntries = (headers) => {
402
+ const entries = [];
403
+ headers.forEach((value, key) => {
404
+ entries.push([key, value]);
405
+ });
406
+ return entries;
407
+ };
408
+ const mergeHeaders = (...headers) => {
409
+ const mergedHeaders = new Headers();
410
+ for (const header of headers) {
411
+ if (!header) continue;
412
+ const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header);
413
+ for (const [key, value] of iterator) if (value === null) mergedHeaders.delete(key);
414
+ else if (Array.isArray(value)) for (const v of value) mergedHeaders.append(key, v);
415
+ else if (value !== void 0) mergedHeaders.set(key, typeof value === "object" ? JSON.stringify(value) : value);
416
+ }
417
+ return mergedHeaders;
418
+ };
419
+ var Interceptors = class {
420
+ constructor() {
421
+ this.fns = [];
422
+ }
423
+ clear() {
424
+ this.fns = [];
425
+ }
426
+ eject(id) {
427
+ const index = this.getInterceptorIndex(id);
428
+ if (this.fns[index]) this.fns[index] = null;
429
+ }
430
+ exists(id) {
431
+ const index = this.getInterceptorIndex(id);
432
+ return Boolean(this.fns[index]);
433
+ }
434
+ getInterceptorIndex(id) {
435
+ if (typeof id === "number") return this.fns[id] ? id : -1;
436
+ return this.fns.indexOf(id);
437
+ }
438
+ update(id, fn) {
439
+ const index = this.getInterceptorIndex(id);
440
+ if (this.fns[index]) {
441
+ this.fns[index] = fn;
442
+ return id;
443
+ }
444
+ return false;
445
+ }
446
+ use(fn) {
447
+ this.fns.push(fn);
448
+ return this.fns.length - 1;
449
+ }
450
+ };
451
+ const createInterceptors = () => ({
452
+ error: new Interceptors(),
453
+ request: new Interceptors(),
454
+ response: new Interceptors()
455
+ });
456
+ const defaultQuerySerializer = createQuerySerializer({
457
+ allowReserved: false,
458
+ array: {
459
+ explode: true,
460
+ style: "form"
461
+ },
462
+ object: {
463
+ explode: true,
464
+ style: "deepObject"
465
+ }
466
+ });
467
+ const defaultHeaders = { "Content-Type": "application/json" };
468
+ const createConfig = (override = {}) => ({
469
+ ...jsonBodySerializer,
470
+ headers: defaultHeaders,
471
+ parseAs: "auto",
472
+ querySerializer: defaultQuerySerializer,
473
+ ...override
474
+ });
475
+
476
+ //#endregion
477
+ //#region client/client/client.gen.ts
478
+ const createClient$1 = (config = {}) => {
479
+ let _config = mergeConfigs(createConfig(), config);
480
+ const getConfig = () => ({ ..._config });
481
+ const setConfig = (config$1) => {
482
+ _config = mergeConfigs(_config, config$1);
483
+ return getConfig();
484
+ };
485
+ const interceptors = createInterceptors();
486
+ const beforeRequest = async (options) => {
487
+ const opts = {
488
+ ..._config,
489
+ ...options,
490
+ fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
491
+ headers: mergeHeaders(_config.headers, options.headers),
492
+ serializedBody: void 0
493
+ };
494
+ if (opts.security) await setAuthParams({
495
+ ...opts,
496
+ security: opts.security
497
+ });
498
+ if (opts.requestValidator) await opts.requestValidator(opts);
499
+ if (opts.body !== void 0 && opts.bodySerializer) opts.serializedBody = opts.bodySerializer(opts.body);
500
+ if (opts.body === void 0 || opts.serializedBody === "") opts.headers.delete("Content-Type");
501
+ return {
502
+ opts,
503
+ url: buildUrl(opts)
504
+ };
505
+ };
506
+ const request = async (options) => {
507
+ const { opts, url } = await beforeRequest(options);
508
+ const requestInit = {
509
+ redirect: "follow",
510
+ ...opts,
511
+ body: getValidRequestBody(opts)
512
+ };
513
+ let request$1 = new Request(url, requestInit);
514
+ for (const fn of interceptors.request.fns) if (fn) request$1 = await fn(request$1, opts);
515
+ const _fetch = opts.fetch;
516
+ let response;
517
+ try {
518
+ response = await _fetch(request$1);
519
+ } catch (error$1) {
520
+ let finalError$1 = error$1;
521
+ for (const fn of interceptors.error.fns) if (fn) finalError$1 = await fn(error$1, void 0, request$1, opts);
522
+ finalError$1 = finalError$1 || {};
523
+ if (opts.throwOnError) throw finalError$1;
524
+ return opts.responseStyle === "data" ? void 0 : {
525
+ error: finalError$1,
526
+ request: request$1,
527
+ response: void 0
528
+ };
529
+ }
530
+ for (const fn of interceptors.response.fns) if (fn) response = await fn(response, request$1, opts);
531
+ const result = {
532
+ request: request$1,
533
+ response
534
+ };
535
+ if (response.ok) {
536
+ const parseAs = (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json";
537
+ if (response.status === 204 || response.headers.get("Content-Length") === "0") {
538
+ let emptyData;
539
+ switch (parseAs) {
540
+ case "arrayBuffer":
541
+ case "blob":
542
+ case "text":
543
+ emptyData = await response[parseAs]();
544
+ break;
545
+ case "formData":
546
+ emptyData = new FormData();
547
+ break;
548
+ case "stream":
549
+ emptyData = response.body;
550
+ break;
551
+ case "json":
552
+ default:
553
+ emptyData = {};
554
+ break;
555
+ }
556
+ return opts.responseStyle === "data" ? emptyData : {
557
+ data: emptyData,
558
+ ...result
559
+ };
560
+ }
561
+ let data;
562
+ switch (parseAs) {
563
+ case "arrayBuffer":
564
+ case "blob":
565
+ case "formData":
566
+ case "json":
567
+ case "text":
568
+ data = await response[parseAs]();
569
+ break;
570
+ case "stream": return opts.responseStyle === "data" ? response.body : {
571
+ data: response.body,
572
+ ...result
573
+ };
574
+ }
575
+ if (parseAs === "json") {
576
+ if (opts.responseValidator) await opts.responseValidator(data);
577
+ if (opts.responseTransformer) data = await opts.responseTransformer(data);
578
+ }
579
+ return opts.responseStyle === "data" ? data : {
580
+ data,
581
+ ...result
582
+ };
583
+ }
584
+ const textError = await response.text();
585
+ let jsonError;
586
+ try {
587
+ jsonError = JSON.parse(textError);
588
+ } catch {}
589
+ const error = jsonError ?? textError;
590
+ let finalError = error;
591
+ for (const fn of interceptors.error.fns) if (fn) finalError = await fn(error, response, request$1, opts);
592
+ finalError = finalError || {};
593
+ if (opts.throwOnError) throw finalError;
594
+ return opts.responseStyle === "data" ? void 0 : {
595
+ error: finalError,
596
+ ...result
597
+ };
598
+ };
599
+ const makeMethodFn = (method) => (options) => request({
600
+ ...options,
601
+ method
602
+ });
603
+ const makeSseFn = (method) => async (options) => {
604
+ const { opts, url } = await beforeRequest(options);
605
+ return createSseClient({
606
+ ...opts,
607
+ body: opts.body,
608
+ headers: opts.headers,
609
+ method,
610
+ onRequest: async (url$1, init) => {
611
+ let request$1 = new Request(url$1, init);
612
+ for (const fn of interceptors.request.fns) if (fn) request$1 = await fn(request$1, opts);
613
+ return request$1;
614
+ },
615
+ url
616
+ });
617
+ };
618
+ return {
619
+ buildUrl,
620
+ connect: makeMethodFn("CONNECT"),
621
+ delete: makeMethodFn("DELETE"),
622
+ get: makeMethodFn("GET"),
623
+ getConfig,
624
+ head: makeMethodFn("HEAD"),
625
+ interceptors,
626
+ options: makeMethodFn("OPTIONS"),
627
+ patch: makeMethodFn("PATCH"),
628
+ post: makeMethodFn("POST"),
629
+ put: makeMethodFn("PUT"),
630
+ request,
631
+ setConfig,
632
+ sse: {
633
+ connect: makeSseFn("CONNECT"),
634
+ delete: makeSseFn("DELETE"),
635
+ get: makeSseFn("GET"),
636
+ head: makeSseFn("HEAD"),
637
+ options: makeSseFn("OPTIONS"),
638
+ patch: makeSseFn("PATCH"),
639
+ post: makeSseFn("POST"),
640
+ put: makeSseFn("PUT"),
641
+ trace: makeSseFn("TRACE")
642
+ },
643
+ trace: makeMethodFn("TRACE")
644
+ };
645
+ };
646
+
647
+ //#endregion
648
+ //#region payjpv2.ts
649
+ const BINDINGS_VERSION = "0.0.1";
650
+ const DEFAULT_BASE_URL = "https://api.pay.jp";
651
+ function createClient(config) {
652
+ const ua = {
653
+ bindings_version: BINDINGS_VERSION,
654
+ lang: "node",
655
+ lang_version: process.version,
656
+ publisher: "payjp",
657
+ uname: [
658
+ node_os.default.platform(),
659
+ node_os.default.release(),
660
+ node_os.default.arch()
661
+ ].join(" ")
662
+ };
663
+ return createClient$1(createConfig({
664
+ baseUrl: config.baseUrl || DEFAULT_BASE_URL,
665
+ headers: {
666
+ Authorization: `Bearer ${config.apiKey}`,
667
+ "Content-Type": "application/json",
668
+ "User-Agent": `payjp/payjpv2 NodeBindings/${BINDINGS_VERSION}`,
669
+ "X-Payjp-Client-User-Agent": JSON.stringify(ua)
670
+ }
671
+ }));
672
+ }
673
+
674
+ //#endregion
675
+ //#region client/client.gen.ts
676
+ const client = createClient$1(createConfig());
677
+
678
+ //#endregion
679
+ //#region client/sdk.gen.ts
680
+ /**
681
+ * Get All Payment Methods
682
+ */
683
+ const getAllPaymentMethods = (options) => (options?.client ?? client).get({
684
+ security: [{
685
+ scheme: "basic",
686
+ type: "http"
687
+ }, {
688
+ scheme: "bearer",
689
+ type: "http"
690
+ }],
691
+ url: "/v2/payment_methods",
692
+ ...options
693
+ });
694
+ /**
695
+ * Create Payment Method
696
+ */
697
+ const createPaymentMethod = (options) => (options.client ?? client).post({
698
+ security: [{
699
+ scheme: "basic",
700
+ type: "http"
701
+ }, {
702
+ scheme: "bearer",
703
+ type: "http"
704
+ }],
705
+ url: "/v2/payment_methods",
706
+ ...options,
707
+ headers: {
708
+ "Content-Type": "application/json",
709
+ ...options.headers
710
+ }
711
+ });
712
+ /**
713
+ * Get Payment Method
714
+ */
715
+ const getPaymentMethod = (options) => (options.client ?? client).get({
716
+ security: [{
717
+ scheme: "basic",
718
+ type: "http"
719
+ }, {
720
+ scheme: "bearer",
721
+ type: "http"
722
+ }],
723
+ url: "/v2/payment_methods/{payment_method_id}",
724
+ ...options
725
+ });
726
+ /**
727
+ * Update Payment Method
728
+ */
729
+ const updatePaymentMethod = (options) => (options.client ?? client).post({
730
+ security: [{
731
+ scheme: "basic",
732
+ type: "http"
733
+ }, {
734
+ scheme: "bearer",
735
+ type: "http"
736
+ }],
737
+ url: "/v2/payment_methods/{payment_method_id}",
738
+ ...options,
739
+ headers: {
740
+ "Content-Type": "application/json",
741
+ ...options.headers
742
+ }
743
+ });
744
+ /**
745
+ * Get Payment Method By Card
746
+ */
747
+ const getPaymentMethodByCard = (options) => (options.client ?? client).get({
748
+ security: [{
749
+ scheme: "basic",
750
+ type: "http"
751
+ }, {
752
+ scheme: "bearer",
753
+ type: "http"
754
+ }],
755
+ url: "/v2/payment_methods/cards/{card_id}",
756
+ ...options
757
+ });
758
+ /**
759
+ * Attach Payment Method
760
+ */
761
+ const attachPaymentMethod = (options) => (options.client ?? client).post({
762
+ security: [{
763
+ scheme: "basic",
764
+ type: "http"
765
+ }, {
766
+ scheme: "bearer",
767
+ type: "http"
768
+ }],
769
+ url: "/v2/payment_methods/{payment_method_id}/attach",
770
+ ...options,
771
+ headers: {
772
+ "Content-Type": "application/json",
773
+ ...options.headers
774
+ }
775
+ });
776
+ /**
777
+ * Detach Payment Method
778
+ */
779
+ const detachPaymentMethod = (options) => (options.client ?? client).post({
780
+ security: [{
781
+ scheme: "basic",
782
+ type: "http"
783
+ }, {
784
+ scheme: "bearer",
785
+ type: "http"
786
+ }],
787
+ url: "/v2/payment_methods/{payment_method_id}/detach",
788
+ ...options
789
+ });
790
+ /**
791
+ * Get Payment Method Configuration
792
+ */
793
+ const getPaymentMethodConfiguration = (options) => (options.client ?? client).get({
794
+ security: [{
795
+ scheme: "basic",
796
+ type: "http"
797
+ }, {
798
+ scheme: "bearer",
799
+ type: "http"
800
+ }],
801
+ url: "/v2/payment_method_configurations/{payment_method_configuration_id}",
802
+ ...options
803
+ });
804
+ /**
805
+ * Update Payment Method Configuration
806
+ */
807
+ const updatePaymentMethodConfiguration = (options) => (options.client ?? client).post({
808
+ security: [{
809
+ scheme: "basic",
810
+ type: "http"
811
+ }, {
812
+ scheme: "bearer",
813
+ type: "http"
814
+ }],
815
+ url: "/v2/payment_method_configurations/{payment_method_configuration_id}",
816
+ ...options,
817
+ headers: {
818
+ "Content-Type": "application/json",
819
+ ...options.headers
820
+ }
821
+ });
822
+ /**
823
+ * Get All Payment Method Configurations
824
+ */
825
+ const getAllPaymentMethodConfigurations = (options) => (options?.client ?? client).get({
826
+ security: [{
827
+ scheme: "basic",
828
+ type: "http"
829
+ }, {
830
+ scheme: "bearer",
831
+ type: "http"
832
+ }],
833
+ url: "/v2/payment_method_configurations",
834
+ ...options
835
+ });
836
+ /**
837
+ * Get All Products
838
+ */
839
+ const getAllProducts = (options) => (options?.client ?? client).get({
840
+ security: [{
841
+ scheme: "basic",
842
+ type: "http"
843
+ }, {
844
+ scheme: "bearer",
845
+ type: "http"
846
+ }],
847
+ url: "/v2/products",
848
+ ...options
849
+ });
850
+ /**
851
+ * Create Product
852
+ */
853
+ const createProduct = (options) => (options.client ?? client).post({
854
+ security: [{
855
+ scheme: "basic",
856
+ type: "http"
857
+ }, {
858
+ scheme: "bearer",
859
+ type: "http"
860
+ }],
861
+ url: "/v2/products",
862
+ ...options,
863
+ headers: {
864
+ "Content-Type": "application/json",
865
+ ...options.headers
866
+ }
867
+ });
868
+ /**
869
+ * Delete Product
870
+ */
871
+ const deleteProduct = (options) => (options.client ?? client).delete({
872
+ security: [{
873
+ scheme: "basic",
874
+ type: "http"
875
+ }, {
876
+ scheme: "bearer",
877
+ type: "http"
878
+ }],
879
+ url: "/v2/products/{product_id}",
880
+ ...options
881
+ });
882
+ /**
883
+ * Get Product
884
+ */
885
+ const getProduct = (options) => (options.client ?? client).get({
886
+ security: [{
887
+ scheme: "basic",
888
+ type: "http"
889
+ }, {
890
+ scheme: "bearer",
891
+ type: "http"
892
+ }],
893
+ url: "/v2/products/{product_id}",
894
+ ...options
895
+ });
896
+ /**
897
+ * Update Product
898
+ */
899
+ const updateProduct = (options) => (options.client ?? client).post({
900
+ security: [{
901
+ scheme: "basic",
902
+ type: "http"
903
+ }, {
904
+ scheme: "bearer",
905
+ type: "http"
906
+ }],
907
+ url: "/v2/products/{product_id}",
908
+ ...options,
909
+ headers: {
910
+ "Content-Type": "application/json",
911
+ ...options.headers
912
+ }
913
+ });
914
+ /**
915
+ * Get All Prices
916
+ */
917
+ const getAllPrices = (options) => (options?.client ?? client).get({
918
+ security: [{
919
+ scheme: "basic",
920
+ type: "http"
921
+ }, {
922
+ scheme: "bearer",
923
+ type: "http"
924
+ }],
925
+ url: "/v2/prices",
926
+ ...options
927
+ });
928
+ /**
929
+ * Create Price
930
+ */
931
+ const createPrice = (options) => (options.client ?? client).post({
932
+ security: [{
933
+ scheme: "basic",
934
+ type: "http"
935
+ }, {
936
+ scheme: "bearer",
937
+ type: "http"
938
+ }],
939
+ url: "/v2/prices",
940
+ ...options,
941
+ headers: {
942
+ "Content-Type": "application/json",
943
+ ...options.headers
944
+ }
945
+ });
946
+ /**
947
+ * Get Price
948
+ */
949
+ const getPrice = (options) => (options.client ?? client).get({
950
+ security: [{
951
+ scheme: "basic",
952
+ type: "http"
953
+ }, {
954
+ scheme: "bearer",
955
+ type: "http"
956
+ }],
957
+ url: "/v2/prices/{price_id}",
958
+ ...options
959
+ });
960
+ /**
961
+ * Update Price
962
+ */
963
+ const updatePrice = (options) => (options.client ?? client).post({
964
+ security: [{
965
+ scheme: "basic",
966
+ type: "http"
967
+ }, {
968
+ scheme: "bearer",
969
+ type: "http"
970
+ }],
971
+ url: "/v2/prices/{price_id}",
972
+ ...options,
973
+ headers: {
974
+ "Content-Type": "application/json",
975
+ ...options.headers
976
+ }
977
+ });
978
+ /**
979
+ * Get Payment Flow
980
+ */
981
+ const getPaymentFlow = (options) => (options.client ?? client).get({
982
+ security: [{
983
+ scheme: "basic",
984
+ type: "http"
985
+ }, {
986
+ scheme: "bearer",
987
+ type: "http"
988
+ }],
989
+ url: "/v2/payment_flows/{payment_flow_id}",
990
+ ...options
991
+ });
992
+ /**
993
+ * Update Payment Flow
994
+ */
995
+ const updatePaymentFlow = (options) => (options.client ?? client).post({
996
+ security: [{
997
+ scheme: "basic",
998
+ type: "http"
999
+ }, {
1000
+ scheme: "bearer",
1001
+ type: "http"
1002
+ }],
1003
+ url: "/v2/payment_flows/{payment_flow_id}",
1004
+ ...options,
1005
+ headers: {
1006
+ "Content-Type": "application/json",
1007
+ ...options.headers
1008
+ }
1009
+ });
1010
+ /**
1011
+ * Get All Payment Flows
1012
+ */
1013
+ const getAllPaymentFlows = (options) => (options?.client ?? client).get({
1014
+ security: [{
1015
+ scheme: "basic",
1016
+ type: "http"
1017
+ }, {
1018
+ scheme: "bearer",
1019
+ type: "http"
1020
+ }],
1021
+ url: "/v2/payment_flows",
1022
+ ...options
1023
+ });
1024
+ /**
1025
+ * Create Payment Flow
1026
+ */
1027
+ const createPaymentFlow = (options) => (options.client ?? client).post({
1028
+ security: [{
1029
+ scheme: "basic",
1030
+ type: "http"
1031
+ }, {
1032
+ scheme: "bearer",
1033
+ type: "http"
1034
+ }],
1035
+ url: "/v2/payment_flows",
1036
+ ...options,
1037
+ headers: {
1038
+ "Content-Type": "application/json",
1039
+ ...options.headers
1040
+ }
1041
+ });
1042
+ /**
1043
+ * Cancel Payment Flow
1044
+ */
1045
+ const cancelPaymentFlow = (options) => (options.client ?? client).post({
1046
+ security: [{
1047
+ scheme: "basic",
1048
+ type: "http"
1049
+ }, {
1050
+ scheme: "bearer",
1051
+ type: "http"
1052
+ }],
1053
+ url: "/v2/payment_flows/{payment_flow_id}/cancel",
1054
+ ...options,
1055
+ headers: {
1056
+ "Content-Type": "application/json",
1057
+ ...options.headers
1058
+ }
1059
+ });
1060
+ /**
1061
+ * Capture Payment Flow
1062
+ */
1063
+ const capturePaymentFlow = (options) => (options.client ?? client).post({
1064
+ security: [{
1065
+ scheme: "basic",
1066
+ type: "http"
1067
+ }, {
1068
+ scheme: "bearer",
1069
+ type: "http"
1070
+ }],
1071
+ url: "/v2/payment_flows/{payment_flow_id}/capture",
1072
+ ...options,
1073
+ headers: {
1074
+ "Content-Type": "application/json",
1075
+ ...options.headers
1076
+ }
1077
+ });
1078
+ /**
1079
+ * Confirm Payment Flow
1080
+ */
1081
+ const confirmPaymentFlow = (options) => (options.client ?? client).post({
1082
+ security: [{
1083
+ scheme: "basic",
1084
+ type: "http"
1085
+ }, {
1086
+ scheme: "bearer",
1087
+ type: "http"
1088
+ }],
1089
+ url: "/v2/payment_flows/{payment_flow_id}/confirm",
1090
+ ...options,
1091
+ headers: {
1092
+ "Content-Type": "application/json",
1093
+ ...options.headers
1094
+ }
1095
+ });
1096
+ /**
1097
+ * Get Payment Flow Refunds
1098
+ *
1099
+ * Payment Flowに紐づくRefundsをリスト取得する
1100
+ */
1101
+ const getPaymentFlowRefunds = (options) => (options.client ?? client).get({
1102
+ security: [{
1103
+ scheme: "basic",
1104
+ type: "http"
1105
+ }, {
1106
+ scheme: "bearer",
1107
+ type: "http"
1108
+ }],
1109
+ url: "/v2/payment_flows/{payment_flow_id}/refunds",
1110
+ ...options
1111
+ });
1112
+ /**
1113
+ * Get Payment Refund
1114
+ */
1115
+ const getPaymentRefund = (options) => (options.client ?? client).get({
1116
+ security: [{
1117
+ scheme: "basic",
1118
+ type: "http"
1119
+ }, {
1120
+ scheme: "bearer",
1121
+ type: "http"
1122
+ }],
1123
+ url: "/v2/payment_refunds/{payment_refund_id}",
1124
+ ...options
1125
+ });
1126
+ /**
1127
+ * Update Payment Refund
1128
+ */
1129
+ const updatePaymentRefund = (options) => (options.client ?? client).post({
1130
+ security: [{
1131
+ scheme: "basic",
1132
+ type: "http"
1133
+ }, {
1134
+ scheme: "bearer",
1135
+ type: "http"
1136
+ }],
1137
+ url: "/v2/payment_refunds/{payment_refund_id}",
1138
+ ...options,
1139
+ headers: {
1140
+ "Content-Type": "application/json",
1141
+ ...options.headers
1142
+ }
1143
+ });
1144
+ /**
1145
+ * Get All Payment Refunds
1146
+ */
1147
+ const getAllPaymentRefunds = (options) => (options?.client ?? client).get({
1148
+ security: [{
1149
+ scheme: "basic",
1150
+ type: "http"
1151
+ }, {
1152
+ scheme: "bearer",
1153
+ type: "http"
1154
+ }],
1155
+ url: "/v2/payment_refunds",
1156
+ ...options
1157
+ });
1158
+ /**
1159
+ * Create Payment Refund
1160
+ */
1161
+ const createPaymentRefund = (options) => (options.client ?? client).post({
1162
+ security: [{
1163
+ scheme: "basic",
1164
+ type: "http"
1165
+ }, {
1166
+ scheme: "bearer",
1167
+ type: "http"
1168
+ }],
1169
+ url: "/v2/payment_refunds",
1170
+ ...options,
1171
+ headers: {
1172
+ "Content-Type": "application/json",
1173
+ ...options.headers
1174
+ }
1175
+ });
1176
+ /**
1177
+ * Get Setup Flow
1178
+ */
1179
+ const getSetupFlow = (options) => (options.client ?? client).get({
1180
+ security: [{
1181
+ scheme: "basic",
1182
+ type: "http"
1183
+ }, {
1184
+ scheme: "bearer",
1185
+ type: "http"
1186
+ }],
1187
+ url: "/v2/setup_flows/{setup_flow_id}",
1188
+ ...options
1189
+ });
1190
+ /**
1191
+ * Update Setup Flow
1192
+ */
1193
+ const updateSetupFlow = (options) => (options.client ?? client).post({
1194
+ security: [{
1195
+ scheme: "basic",
1196
+ type: "http"
1197
+ }, {
1198
+ scheme: "bearer",
1199
+ type: "http"
1200
+ }],
1201
+ url: "/v2/setup_flows/{setup_flow_id}",
1202
+ ...options,
1203
+ headers: {
1204
+ "Content-Type": "application/json",
1205
+ ...options.headers
1206
+ }
1207
+ });
1208
+ /**
1209
+ * Get All Setup Flows
1210
+ */
1211
+ const getAllSetupFlows = (options) => (options?.client ?? client).get({
1212
+ security: [{
1213
+ scheme: "basic",
1214
+ type: "http"
1215
+ }, {
1216
+ scheme: "bearer",
1217
+ type: "http"
1218
+ }],
1219
+ url: "/v2/setup_flows",
1220
+ ...options
1221
+ });
1222
+ /**
1223
+ * Create Setup Flow
1224
+ */
1225
+ const createSetupFlow = (options) => (options?.client ?? client).post({
1226
+ security: [{
1227
+ scheme: "basic",
1228
+ type: "http"
1229
+ }, {
1230
+ scheme: "bearer",
1231
+ type: "http"
1232
+ }],
1233
+ url: "/v2/setup_flows",
1234
+ ...options,
1235
+ headers: {
1236
+ "Content-Type": "application/json",
1237
+ ...options?.headers
1238
+ }
1239
+ });
1240
+ /**
1241
+ * Cancel Setup Flow
1242
+ */
1243
+ const cancelSetupFlow = (options) => (options.client ?? client).post({
1244
+ security: [{
1245
+ scheme: "basic",
1246
+ type: "http"
1247
+ }, {
1248
+ scheme: "bearer",
1249
+ type: "http"
1250
+ }],
1251
+ url: "/v2/setup_flows/{setup_flow_id}/cancel",
1252
+ ...options,
1253
+ headers: {
1254
+ "Content-Type": "application/json",
1255
+ ...options.headers
1256
+ }
1257
+ });
1258
+ /**
1259
+ * Confirm Setup Flow
1260
+ */
1261
+ const confirmSetupFlow = (options) => (options.client ?? client).post({
1262
+ security: [{
1263
+ scheme: "basic",
1264
+ type: "http"
1265
+ }, {
1266
+ scheme: "bearer",
1267
+ type: "http"
1268
+ }],
1269
+ url: "/v2/setup_flows/{setup_flow_id}/confirm",
1270
+ ...options,
1271
+ headers: {
1272
+ "Content-Type": "application/json",
1273
+ ...options.headers
1274
+ }
1275
+ });
1276
+ /**
1277
+ * Get Statement
1278
+ */
1279
+ const getStatement = (options) => (options.client ?? client).get({
1280
+ security: [{
1281
+ scheme: "basic",
1282
+ type: "http"
1283
+ }, {
1284
+ scheme: "bearer",
1285
+ type: "http"
1286
+ }],
1287
+ url: "/v2/statements/{statement_id}",
1288
+ ...options
1289
+ });
1290
+ /**
1291
+ * Get All Statements
1292
+ */
1293
+ const getAllStatements = (options) => (options?.client ?? client).get({
1294
+ security: [{
1295
+ scheme: "basic",
1296
+ type: "http"
1297
+ }, {
1298
+ scheme: "bearer",
1299
+ type: "http"
1300
+ }],
1301
+ url: "/v2/statements",
1302
+ ...options
1303
+ });
1304
+ /**
1305
+ * Create Statement Url
1306
+ */
1307
+ const createStatementUrl = (options) => (options.client ?? client).post({
1308
+ security: [{
1309
+ scheme: "basic",
1310
+ type: "http"
1311
+ }, {
1312
+ scheme: "bearer",
1313
+ type: "http"
1314
+ }],
1315
+ url: "/v2/statements/{statement_id}/statement_urls",
1316
+ ...options
1317
+ });
1318
+ /**
1319
+ * Get Balance
1320
+ */
1321
+ const getBalance = (options) => (options.client ?? client).get({
1322
+ security: [{
1323
+ scheme: "basic",
1324
+ type: "http"
1325
+ }, {
1326
+ scheme: "bearer",
1327
+ type: "http"
1328
+ }],
1329
+ url: "/v2/balances/{balance_id}",
1330
+ ...options
1331
+ });
1332
+ /**
1333
+ * Get All Balances
1334
+ */
1335
+ const getAllBalances = (options) => (options?.client ?? client).get({
1336
+ security: [{
1337
+ scheme: "basic",
1338
+ type: "http"
1339
+ }, {
1340
+ scheme: "bearer",
1341
+ type: "http"
1342
+ }],
1343
+ url: "/v2/balances",
1344
+ ...options
1345
+ });
1346
+ /**
1347
+ * Create Balance Url
1348
+ */
1349
+ const createBalanceUrl = (options) => (options.client ?? client).post({
1350
+ security: [{
1351
+ scheme: "basic",
1352
+ type: "http"
1353
+ }, {
1354
+ scheme: "bearer",
1355
+ type: "http"
1356
+ }],
1357
+ url: "/v2/balances/{balance_id}/balance_urls",
1358
+ ...options
1359
+ });
1360
+ /**
1361
+ * Get All Checkout Sessions
1362
+ */
1363
+ const getAllCheckoutSessions = (options) => (options?.client ?? client).get({
1364
+ security: [{
1365
+ scheme: "basic",
1366
+ type: "http"
1367
+ }, {
1368
+ scheme: "bearer",
1369
+ type: "http"
1370
+ }],
1371
+ url: "/v2/checkout/sessions",
1372
+ ...options
1373
+ });
1374
+ /**
1375
+ * Create Checkout Session
1376
+ */
1377
+ const createCheckoutSession = (options) => (options.client ?? client).post({
1378
+ security: [{
1379
+ scheme: "basic",
1380
+ type: "http"
1381
+ }, {
1382
+ scheme: "bearer",
1383
+ type: "http"
1384
+ }],
1385
+ url: "/v2/checkout/sessions",
1386
+ ...options,
1387
+ headers: {
1388
+ "Content-Type": "application/json",
1389
+ ...options.headers
1390
+ }
1391
+ });
1392
+ /**
1393
+ * Get Checkout Session
1394
+ */
1395
+ const getCheckoutSession = (options) => (options.client ?? client).get({
1396
+ security: [{
1397
+ scheme: "basic",
1398
+ type: "http"
1399
+ }, {
1400
+ scheme: "bearer",
1401
+ type: "http"
1402
+ }],
1403
+ url: "/v2/checkout/sessions/{checkout_session_id}",
1404
+ ...options
1405
+ });
1406
+ /**
1407
+ * Update Checkout Session
1408
+ */
1409
+ const updateCheckoutSession = (options) => (options.client ?? client).post({
1410
+ security: [{
1411
+ scheme: "basic",
1412
+ type: "http"
1413
+ }, {
1414
+ scheme: "bearer",
1415
+ type: "http"
1416
+ }],
1417
+ url: "/v2/checkout/sessions/{checkout_session_id}",
1418
+ ...options,
1419
+ headers: {
1420
+ "Content-Type": "application/json",
1421
+ ...options.headers
1422
+ }
1423
+ });
1424
+ /**
1425
+ * Get All Tax Rates
1426
+ */
1427
+ const getAllTaxRates = (options) => (options?.client ?? client).get({
1428
+ security: [{
1429
+ scheme: "basic",
1430
+ type: "http"
1431
+ }, {
1432
+ scheme: "bearer",
1433
+ type: "http"
1434
+ }],
1435
+ url: "/v2/tax_rates",
1436
+ ...options
1437
+ });
1438
+ /**
1439
+ * Create Tax Rate
1440
+ */
1441
+ const createTaxRate = (options) => (options.client ?? client).post({
1442
+ security: [{
1443
+ scheme: "basic",
1444
+ type: "http"
1445
+ }, {
1446
+ scheme: "bearer",
1447
+ type: "http"
1448
+ }],
1449
+ url: "/v2/tax_rates",
1450
+ ...options,
1451
+ headers: {
1452
+ "Content-Type": "application/json",
1453
+ ...options.headers
1454
+ }
1455
+ });
1456
+ /**
1457
+ * Get Tax Rate
1458
+ */
1459
+ const getTaxRate = (options) => (options.client ?? client).get({
1460
+ security: [{
1461
+ scheme: "basic",
1462
+ type: "http"
1463
+ }, {
1464
+ scheme: "bearer",
1465
+ type: "http"
1466
+ }],
1467
+ url: "/v2/tax_rates/{tax_rate_id}",
1468
+ ...options
1469
+ });
1470
+ /**
1471
+ * Update Tax Rate
1472
+ */
1473
+ const updateTaxRate = (options) => (options.client ?? client).post({
1474
+ security: [{
1475
+ scheme: "basic",
1476
+ type: "http"
1477
+ }, {
1478
+ scheme: "bearer",
1479
+ type: "http"
1480
+ }],
1481
+ url: "/v2/tax_rates/{tax_rate_id}",
1482
+ ...options,
1483
+ headers: {
1484
+ "Content-Type": "application/json",
1485
+ ...options.headers
1486
+ }
1487
+ });
1488
+ /**
1489
+ * Get All Customers
1490
+ */
1491
+ const getAllCustomers = (options) => (options?.client ?? client).get({
1492
+ security: [{
1493
+ scheme: "basic",
1494
+ type: "http"
1495
+ }, {
1496
+ scheme: "bearer",
1497
+ type: "http"
1498
+ }],
1499
+ url: "/v2/customers",
1500
+ ...options
1501
+ });
1502
+ /**
1503
+ * Create Customer
1504
+ */
1505
+ const createCustomer = (options) => (options.client ?? client).post({
1506
+ security: [{
1507
+ scheme: "basic",
1508
+ type: "http"
1509
+ }, {
1510
+ scheme: "bearer",
1511
+ type: "http"
1512
+ }],
1513
+ url: "/v2/customers",
1514
+ ...options,
1515
+ headers: {
1516
+ "Content-Type": "application/json",
1517
+ ...options.headers
1518
+ }
1519
+ });
1520
+ /**
1521
+ * Delete Customer
1522
+ */
1523
+ const deleteCustomer = (options) => (options.client ?? client).delete({
1524
+ security: [{
1525
+ scheme: "basic",
1526
+ type: "http"
1527
+ }, {
1528
+ scheme: "bearer",
1529
+ type: "http"
1530
+ }],
1531
+ url: "/v2/customers/{customer_id}",
1532
+ ...options
1533
+ });
1534
+ /**
1535
+ * Get Customer
1536
+ */
1537
+ const getCustomer = (options) => (options.client ?? client).get({
1538
+ security: [{
1539
+ scheme: "basic",
1540
+ type: "http"
1541
+ }, {
1542
+ scheme: "bearer",
1543
+ type: "http"
1544
+ }],
1545
+ url: "/v2/customers/{customer_id}",
1546
+ ...options
1547
+ });
1548
+ /**
1549
+ * Update Customer
1550
+ */
1551
+ const updateCustomer = (options) => (options.client ?? client).post({
1552
+ security: [{
1553
+ scheme: "basic",
1554
+ type: "http"
1555
+ }, {
1556
+ scheme: "bearer",
1557
+ type: "http"
1558
+ }],
1559
+ url: "/v2/customers/{customer_id}",
1560
+ ...options,
1561
+ headers: {
1562
+ "Content-Type": "application/json",
1563
+ ...options.headers
1564
+ }
1565
+ });
1566
+ /**
1567
+ * Get Customer Payment Methods
1568
+ */
1569
+ const getCustomerPaymentMethods = (options) => (options.client ?? client).get({
1570
+ security: [{
1571
+ scheme: "basic",
1572
+ type: "http"
1573
+ }, {
1574
+ scheme: "bearer",
1575
+ type: "http"
1576
+ }],
1577
+ url: "/v2/customers/{customer_id}/payment_methods",
1578
+ ...options
1579
+ });
1580
+ /**
1581
+ * Get All Events
1582
+ */
1583
+ const getAllEvents = (options) => (options?.client ?? client).get({
1584
+ security: [{
1585
+ scheme: "basic",
1586
+ type: "http"
1587
+ }, {
1588
+ scheme: "bearer",
1589
+ type: "http"
1590
+ }],
1591
+ url: "/v2/events",
1592
+ ...options
1593
+ });
1594
+ /**
1595
+ * Get Event
1596
+ */
1597
+ const getEvent = (options) => (options.client ?? client).get({
1598
+ security: [{
1599
+ scheme: "basic",
1600
+ type: "http"
1601
+ }, {
1602
+ scheme: "bearer",
1603
+ type: "http"
1604
+ }],
1605
+ url: "/v2/events/{event_id}",
1606
+ ...options
1607
+ });
1608
+ /**
1609
+ * Get Payment Transaction
1610
+ */
1611
+ const getPaymentTransaction = (options) => (options.client ?? client).get({
1612
+ security: [{
1613
+ scheme: "basic",
1614
+ type: "http"
1615
+ }, {
1616
+ scheme: "bearer",
1617
+ type: "http"
1618
+ }],
1619
+ url: "/v2/payment_transactions/{payment_transaction_id}",
1620
+ ...options
1621
+ });
1622
+ /**
1623
+ * Get All Payment Transactions
1624
+ */
1625
+ const getAllPaymentTransactions = (options) => (options?.client ?? client).get({
1626
+ security: [{
1627
+ scheme: "basic",
1628
+ type: "http"
1629
+ }, {
1630
+ scheme: "bearer",
1631
+ type: "http"
1632
+ }],
1633
+ url: "/v2/payment_transactions",
1634
+ ...options
1635
+ });
1636
+ /**
1637
+ * Get Term
1638
+ */
1639
+ const getTerm = (options) => (options.client ?? client).get({
1640
+ security: [{
1641
+ scheme: "basic",
1642
+ type: "http"
1643
+ }, {
1644
+ scheme: "bearer",
1645
+ type: "http"
1646
+ }],
1647
+ url: "/v2/terms/{term_id}",
1648
+ ...options
1649
+ });
1650
+ /**
1651
+ * Get All Terms
1652
+ */
1653
+ const getAllTerms = (options) => (options?.client ?? client).get({
1654
+ security: [{
1655
+ scheme: "basic",
1656
+ type: "http"
1657
+ }, {
1658
+ scheme: "bearer",
1659
+ type: "http"
1660
+ }],
1661
+ url: "/v2/terms",
1662
+ ...options
1663
+ });
1664
+
1665
+ //#endregion
1666
+ exports.attachPaymentMethod = attachPaymentMethod;
1667
+ exports.cancelPaymentFlow = cancelPaymentFlow;
1668
+ exports.cancelSetupFlow = cancelSetupFlow;
1669
+ exports.capturePaymentFlow = capturePaymentFlow;
1670
+ exports.confirmPaymentFlow = confirmPaymentFlow;
1671
+ exports.confirmSetupFlow = confirmSetupFlow;
1672
+ exports.createBalanceUrl = createBalanceUrl;
1673
+ exports.createCheckoutSession = createCheckoutSession;
1674
+ exports.createClient = createClient;
1675
+ exports.createCustomer = createCustomer;
1676
+ exports.createPaymentFlow = createPaymentFlow;
1677
+ exports.createPaymentMethod = createPaymentMethod;
1678
+ exports.createPaymentRefund = createPaymentRefund;
1679
+ exports.createPrice = createPrice;
1680
+ exports.createProduct = createProduct;
1681
+ exports.createSetupFlow = createSetupFlow;
1682
+ exports.createStatementUrl = createStatementUrl;
1683
+ exports.createTaxRate = createTaxRate;
1684
+ exports.deleteCustomer = deleteCustomer;
1685
+ exports.deleteProduct = deleteProduct;
1686
+ exports.detachPaymentMethod = detachPaymentMethod;
1687
+ exports.getAllBalances = getAllBalances;
1688
+ exports.getAllCheckoutSessions = getAllCheckoutSessions;
1689
+ exports.getAllCustomers = getAllCustomers;
1690
+ exports.getAllEvents = getAllEvents;
1691
+ exports.getAllPaymentFlows = getAllPaymentFlows;
1692
+ exports.getAllPaymentMethodConfigurations = getAllPaymentMethodConfigurations;
1693
+ exports.getAllPaymentMethods = getAllPaymentMethods;
1694
+ exports.getAllPaymentRefunds = getAllPaymentRefunds;
1695
+ exports.getAllPaymentTransactions = getAllPaymentTransactions;
1696
+ exports.getAllPrices = getAllPrices;
1697
+ exports.getAllProducts = getAllProducts;
1698
+ exports.getAllSetupFlows = getAllSetupFlows;
1699
+ exports.getAllStatements = getAllStatements;
1700
+ exports.getAllTaxRates = getAllTaxRates;
1701
+ exports.getAllTerms = getAllTerms;
1702
+ exports.getBalance = getBalance;
1703
+ exports.getCheckoutSession = getCheckoutSession;
1704
+ exports.getCustomer = getCustomer;
1705
+ exports.getCustomerPaymentMethods = getCustomerPaymentMethods;
1706
+ exports.getEvent = getEvent;
1707
+ exports.getPaymentFlow = getPaymentFlow;
1708
+ exports.getPaymentFlowRefunds = getPaymentFlowRefunds;
1709
+ exports.getPaymentMethod = getPaymentMethod;
1710
+ exports.getPaymentMethodByCard = getPaymentMethodByCard;
1711
+ exports.getPaymentMethodConfiguration = getPaymentMethodConfiguration;
1712
+ exports.getPaymentRefund = getPaymentRefund;
1713
+ exports.getPaymentTransaction = getPaymentTransaction;
1714
+ exports.getPrice = getPrice;
1715
+ exports.getProduct = getProduct;
1716
+ exports.getSetupFlow = getSetupFlow;
1717
+ exports.getStatement = getStatement;
1718
+ exports.getTaxRate = getTaxRate;
1719
+ exports.getTerm = getTerm;
1720
+ exports.updateCheckoutSession = updateCheckoutSession;
1721
+ exports.updateCustomer = updateCustomer;
1722
+ exports.updatePaymentFlow = updatePaymentFlow;
1723
+ exports.updatePaymentMethod = updatePaymentMethod;
1724
+ exports.updatePaymentMethodConfiguration = updatePaymentMethodConfiguration;
1725
+ exports.updatePaymentRefund = updatePaymentRefund;
1726
+ exports.updatePrice = updatePrice;
1727
+ exports.updateProduct = updateProduct;
1728
+ exports.updateSetupFlow = updateSetupFlow;
1729
+ exports.updateTaxRate = updateTaxRate;
1730
+ //# sourceMappingURL=index.cjs.map