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