@vulog/aima-billing 1.2.30 → 1.2.31

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,157 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") 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) __defProp(to, key, {
13
+ get: ((k) => from[k]).bind(null, key),
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
20
+ value: mod,
21
+ enumerable: true
22
+ }) : target, mod));
23
+ //#endregion
24
+ let zod = require("zod");
25
+ zod = __toESM(zod);
26
+ //#region src/chargeProduct.ts
27
+ const schema$5 = zod.default.object({
28
+ productId: zod.default.string().trim().min(1).uuid(),
29
+ serviceId: zod.default.string().trim().min(1).uuid().nullable().optional(),
30
+ amount: zod.default.number().min(0),
31
+ userId: zod.default.string().trim().min(1).uuid(),
32
+ entityId: zod.default.string().trim().min(1).uuid(),
33
+ subscriptionId: zod.default.string().trim().min(1).uuid().nullable().optional(),
34
+ productNotes: zod.default.string().trim().nullable().optional(),
35
+ originId: zod.default.string().trim().nullable().optional(),
36
+ chargeProductRequestId: zod.default.string().trim().min(1).uuid().nullable().optional(),
37
+ additionalInfo: zod.default.object({ manualPayment: zod.default.boolean().optional() }).optional()
38
+ });
39
+ const chargeProduct = async (client, info) => {
40
+ const result = schema$5.safeParse(info);
41
+ if (!result.success) throw new TypeError("Invalid args", { cause: result.error.issues });
42
+ return client.post(`/boapi/proxy/billing/fleets/${client.clientOptions.fleetId}/invoices/product`, info).then(({ data }) => data);
43
+ };
44
+ //#endregion
45
+ //#region src/getUserCreditsByEntityId.ts
46
+ const getUserCreditsByEntityId = async (client, id) => {
47
+ const result = zod.z.string().trim().min(1).uuid().safeParse(id);
48
+ if (!result.success) throw new TypeError("Invalid id", { cause: result.error.issues });
49
+ return client.get(`/boapi/proxy/billing/fleets/${client.clientOptions.fleetId}/wallet/entity/${id}`).then(({ data }) => data);
50
+ };
51
+ //#endregion
52
+ //#region src/addCredits.ts
53
+ const schema$4 = zod.default.object({
54
+ initialAmount: zod.default.number().min(0),
55
+ validityStartDate: zod.default.string().datetime(),
56
+ validityEndDate: zod.default.string().datetime(),
57
+ notes: zod.default.string().trim().nullable().optional(),
58
+ discountCategory: zod.default.enum(["CREDITS", "PERCENTAGE"]),
59
+ oneTimeUsage: zod.default.boolean().optional(),
60
+ entityId: zod.default.string().trim().min(1).uuid(),
61
+ type: zod.default.enum([
62
+ "LOCAL",
63
+ "GLOBAL",
64
+ "PERIODIC"
65
+ ]),
66
+ usage: zod.default.enum([
67
+ "TRIP",
68
+ "REGISTRATION",
69
+ "PRODUCTS",
70
+ "ALL"
71
+ ])
72
+ });
73
+ const addCredits = async (client, payload) => {
74
+ const result = schema$4.safeParse(payload);
75
+ if (!result.success) throw new TypeError("Invalid args", { cause: result.error.issues });
76
+ return client.post(`/boapi/proxy/billing/fleets/${client.clientOptions.fleetId}/entities/${payload.entityId}/wallets`, result.data).then(({ data }) => data);
77
+ };
78
+ //#endregion
79
+ //#region src/getInvoiceById.ts
80
+ const getInvoiceById = async (client, id) => {
81
+ if (!zod.z.string().trim().min(1).uuid().safeParse(id).success) throw new Error("Invalid invoice ID");
82
+ return client.get(`/boapi/proxy/billing/fleets/${client.clientOptions.fleetId}/invoices/${id}`).then(({ data }) => data);
83
+ };
84
+ //#endregion
85
+ //#region src/getRefundableAmount.ts
86
+ const schema$3 = zod.default.string().trim().min(1);
87
+ const getRefundableAmount = async (client, invoiceId) => {
88
+ const result = schema$3.safeParse(invoiceId);
89
+ if (!result.success) throw new TypeError("Invalid args", { cause: result.error.issues });
90
+ return client.get(`/boapi/proxy/billing/fleets/${client.clientOptions.fleetId}/invoices/${invoiceId}/refundableAmount`).then(({ data }) => data);
91
+ };
92
+ //#endregion
93
+ //#region src/refund.ts
94
+ const schema$2 = zod.default.object({
95
+ amount: zod.default.number().min(0).optional(),
96
+ note: zod.default.string().trim().nullable().optional(),
97
+ paymentIntentPspReference: zod.default.string().trim().min(1).optional()
98
+ });
99
+ const refund = async (client, payload) => {
100
+ const result = schema$2.safeParse(payload);
101
+ if (!result.success) throw new TypeError("Invalid args", { cause: result.error.issues });
102
+ const filteredData = Object.fromEntries(Object.entries(result.data).filter(([_, value]) => value !== void 0 && value !== null));
103
+ return client.post(`/boapi/proxy/billing/fleets/${client.clientOptions.fleetId}/invoices/${payload.invoiceId}/refund`, filteredData).then(({ data }) => data);
104
+ };
105
+ //#endregion
106
+ //#region src/getWalletsByEntity.ts
107
+ const getWalletsByEntity = async (client, entityId) => {
108
+ const result = zod.z.string().trim().min(1).uuid().safeParse(entityId);
109
+ if (!result.success) throw new TypeError("Invalid entityId", { cause: result.error.issues });
110
+ return client.get(`/boapi/proxy/billing/fleets/${client.clientOptions.fleetId}/wallet/entity/${entityId}`).then(({ data }) => data);
111
+ };
112
+ //#endregion
113
+ //#region src/updateWallet.ts
114
+ const schema$1 = zod.z.object({
115
+ walletId: zod.z.string().trim().min(1).uuid(),
116
+ actions: zod.z.array(zod.z.object({
117
+ op: zod.z.enum(["replace"]),
118
+ path: zod.z.enum(["/availableAmount", "/percentage"]),
119
+ value: zod.z.string().min(1)
120
+ })).min(1).max(1)
121
+ });
122
+ const updateWallet = async (client, walletId, actions) => {
123
+ const result = schema$1.safeParse({
124
+ walletId,
125
+ actions
126
+ });
127
+ if (!result.success) throw new TypeError("Invalid args", { cause: result.error.issues });
128
+ await client.patch(`/boapi/proxy/billing/fleets/${client.clientOptions.fleetId}/wallets/${walletId}`, actions, { headers: { "Content-Type": "application/json-patch+json" } });
129
+ };
130
+ //#endregion
131
+ //#region src/payInvoice.ts
132
+ const schema = zod.default.object({
133
+ invoiceId: zod.default.string().trim().min(1).uuid(),
134
+ manualPayment: zod.default.object({
135
+ requiresActionReturnUrl: zod.default.string().default(""),
136
+ online: zod.default.boolean().default(true),
137
+ scope: zod.default.enum(["RENTAL", "DEPOSIT"])
138
+ })
139
+ });
140
+ const payInvoice = async (client, invoiceId, manualPayment) => {
141
+ const result = schema.safeParse({
142
+ invoiceId,
143
+ manualPayment
144
+ });
145
+ if (!result.success) throw new TypeError("Invalid args", { cause: result.error.issues });
146
+ return client.post(`/boapi/proxy/billing/fleets/${client.clientOptions.fleetId}/invoices/${result.data.invoiceId}/payment`, result.data.manualPayment).then(({ data }) => data);
147
+ };
148
+ //#endregion
149
+ exports.addCredits = addCredits;
150
+ exports.chargeProduct = chargeProduct;
151
+ exports.getInvoiceById = getInvoiceById;
152
+ exports.getRefundableAmount = getRefundableAmount;
153
+ exports.getUserCreditsByEntityId = getUserCreditsByEntityId;
154
+ exports.getWalletsByEntity = getWalletsByEntity;
155
+ exports.payInvoice = payInvoice;
156
+ exports.refund = refund;
157
+ exports.updateWallet = updateWallet;
@@ -0,0 +1,179 @@
1
+ import { Client } from "@vulog/aima-client";
2
+ import { UUID } from "crypto";
3
+ import { PatchAction } from "@vulog/aima-core";
4
+
5
+ //#region src/types.d.ts
6
+ type ChargeProductInfo = {
7
+ productId: string;
8
+ serviceId?: string;
9
+ amount: number;
10
+ userId: string;
11
+ entityId: string;
12
+ subscriptionId?: string;
13
+ productNotes?: string;
14
+ originId?: string;
15
+ chargeProductRequestId?: string;
16
+ additionalInfo?: {
17
+ manualPayment?: boolean;
18
+ };
19
+ };
20
+ type ManualPayment = {
21
+ requiresActionReturnUrl: string;
22
+ online?: boolean;
23
+ scope: 'RENTAL' | 'DEPOSIT';
24
+ };
25
+ type Invoice = {
26
+ id: string;
27
+ sequence: number;
28
+ refundSequence?: number;
29
+ userId: string;
30
+ pricingId?: string;
31
+ tripId?: string;
32
+ invoiceDate: string;
33
+ updateDate: string;
34
+ fleetId: string;
35
+ invoiceYear: number;
36
+ invoicesStatus: 'PENDING' | 'PAID' | 'REFUSED' | 'ERROR' | 'REFUNDED' | 'CANCELLED' | 'PENDING_EXTERNAL_PAYMENT' | 'PENDING_MANUAL_PAYMENT' | 'PENDING_AUTHENTICATION' | 'MOP_MISSING';
37
+ amount: number;
38
+ productId?: string;
39
+ currency: string;
40
+ serviceId?: string;
41
+ tokenId?: string;
42
+ entityId: string;
43
+ amountPayWithSystemCredit?: number;
44
+ attempts: number;
45
+ pspName?: string;
46
+ pspReference: string;
47
+ withTaxRefundAmount: number;
48
+ isRefunded?: boolean;
49
+ paymentInProgress: boolean;
50
+ subscriptionId?: string;
51
+ paymentDate?: string;
52
+ externalPaymentRequesterId?: string;
53
+ externalPaymentNotes?: string;
54
+ isPaidExternally?: boolean;
55
+ refundInProgress?: boolean;
56
+ originId?: string;
57
+ originRole?: string;
58
+ pspIdempotency: string;
59
+ paidExternally?: boolean;
60
+ refunded?: boolean;
61
+ productTaxIncluded?: boolean;
62
+ pspReferencePreAuth?: string;
63
+ amountPreAuth?: number;
64
+ preAuthEnabled?: boolean;
65
+ [key: string]: any;
66
+ };
67
+ type Credit = {
68
+ initialAmount: number;
69
+ validityStartDate: string;
70
+ validityEndDate: string;
71
+ notes: string;
72
+ discountCategory: 'CREDITS' | 'PERCENTAGE';
73
+ oneTimeUsage: boolean;
74
+ id: UUID;
75
+ availableAmount: number;
76
+ usedAmount: number;
77
+ originId: UUID;
78
+ entityId: UUID;
79
+ creditAlreadyUsed: boolean;
80
+ updateDate: string;
81
+ type: 'LOCAL' | 'GLOBAL' | 'PERIODIC';
82
+ usage: 'TRIP' | 'REGISTRATION' | 'PRODUCTS' | 'ALL';
83
+ [key: string]: any;
84
+ };
85
+ type Receipt = {
86
+ id: string;
87
+ pspName: string;
88
+ pspReference: string;
89
+ pspPublishableKey: string;
90
+ amount: number;
91
+ currency: string;
92
+ date: string;
93
+ status: string;
94
+ paymentMethodType: string;
95
+ paymentMethodPspReference: string;
96
+ paymentIntentPspReference: string;
97
+ number: number;
98
+ code: string;
99
+ declineCode: string;
100
+ pspClientSecret: string;
101
+ reason: string;
102
+ note: string;
103
+ nextAction: {
104
+ nextActionRedirectUrl: {
105
+ url: string;
106
+ method: string;
107
+ data: {
108
+ [key: string]: unknown;
109
+ };
110
+ };
111
+ type: string;
112
+ };
113
+ metadatas: {
114
+ [key: string]: unknown;
115
+ };
116
+ };
117
+ type RefundableAmount = {
118
+ invoiceId: string;
119
+ fleetId: string;
120
+ refundableAmount: number;
121
+ currency: string;
122
+ refundablePaymentReceipts: Receipt[];
123
+ refundedPaymentReceipts: Receipt[];
124
+ };
125
+ type Wallet = {
126
+ initialAmount: number;
127
+ validityStartDate: string;
128
+ validityEndDate: string;
129
+ notes: string;
130
+ discountCategory: string;
131
+ oneTimeUsage: boolean;
132
+ id: string;
133
+ availableAmount: number;
134
+ usedAmount: number;
135
+ originId: string;
136
+ entityId: string;
137
+ creditAlreadyUsed: boolean;
138
+ updateDate: string;
139
+ type: string;
140
+ usage: string;
141
+ };
142
+ //#endregion
143
+ //#region src/chargeProduct.d.ts
144
+ declare const chargeProduct: (client: Client, info: ChargeProductInfo) => Promise<Invoice>;
145
+ //#endregion
146
+ //#region src/getUserCreditsByEntityId.d.ts
147
+ declare const getUserCreditsByEntityId: (client: Client, id: string) => Promise<Credit>;
148
+ //#endregion
149
+ //#region src/addCredits.d.ts
150
+ interface Payload$1 extends Omit<Credit, 'id' | 'availableAmount' | 'usedAmount' | 'originId' | 'creditAlreadyUsed' | 'updateDate'> {}
151
+ declare const addCredits: (client: Client, payload: Payload$1) => Promise<Credit>;
152
+ //#endregion
153
+ //#region src/getInvoiceById.d.ts
154
+ declare const getInvoiceById: (client: Client, id: string) => Promise<Invoice>;
155
+ //#endregion
156
+ //#region src/getRefundableAmount.d.ts
157
+ declare const getRefundableAmount: (client: Client, invoiceId: string) => Promise<RefundableAmount>;
158
+ //#endregion
159
+ //#region src/refund.d.ts
160
+ interface Payload {
161
+ invoiceId: string;
162
+ amount?: number;
163
+ note?: string | null;
164
+ paymentIntentPspReference?: string;
165
+ }
166
+ declare const refund: (client: Client, payload: Payload) => Promise<void>;
167
+ //#endregion
168
+ //#region src/getWalletsByEntity.d.ts
169
+ declare const getWalletsByEntity: (client: Client, entityId: string) => Promise<Wallet[]>;
170
+ //#endregion
171
+ //#region src/updateWallet.d.ts
172
+ declare const paths: readonly ["/availableAmount", "/percentage"];
173
+ type Paths = (typeof paths)[number];
174
+ declare const updateWallet: (client: Client, walletId: string, actions: PatchAction<Paths>[]) => Promise<void>;
175
+ //#endregion
176
+ //#region src/payInvoice.d.ts
177
+ declare const payInvoice: (client: Client, invoiceId: string, manualPayment: ManualPayment) => Promise<Invoice>;
178
+ //#endregion
179
+ export { ChargeProductInfo, Credit, Invoice, ManualPayment, Paths, Receipt, RefundableAmount, Wallet, addCredits, chargeProduct, getInvoiceById, getRefundableAmount, getUserCreditsByEntityId, getWalletsByEntity, payInvoice, refund, updateWallet };
package/dist/index.d.mts CHANGED
@@ -1,170 +1,179 @@
1
- import { Client } from '@vulog/aima-client';
2
- import { UUID } from 'crypto';
3
- import { PatchAction } from '@vulog/aima-core';
1
+ import { Client } from "@vulog/aima-client";
2
+ import { UUID } from "crypto";
3
+ import { PatchAction } from "@vulog/aima-core";
4
4
 
5
+ //#region src/types.d.ts
5
6
  type ChargeProductInfo = {
6
- productId: string;
7
- serviceId?: string;
8
- amount: number;
9
- userId: string;
10
- entityId: string;
11
- subscriptionId?: string;
12
- productNotes?: string;
13
- originId?: string;
14
- chargeProductRequestId?: string;
15
- additionalInfo?: {
16
- manualPayment?: boolean;
17
- };
7
+ productId: string;
8
+ serviceId?: string;
9
+ amount: number;
10
+ userId: string;
11
+ entityId: string;
12
+ subscriptionId?: string;
13
+ productNotes?: string;
14
+ originId?: string;
15
+ chargeProductRequestId?: string;
16
+ additionalInfo?: {
17
+ manualPayment?: boolean;
18
+ };
18
19
  };
19
20
  type ManualPayment = {
20
- requiresActionReturnUrl: string;
21
- online?: boolean;
22
- scope: 'RENTAL' | 'DEPOSIT';
21
+ requiresActionReturnUrl: string;
22
+ online?: boolean;
23
+ scope: 'RENTAL' | 'DEPOSIT';
23
24
  };
24
25
  type Invoice = {
25
- id: string;
26
- sequence: number;
27
- refundSequence?: number;
28
- userId: string;
29
- pricingId?: string;
30
- tripId?: string;
31
- invoiceDate: string;
32
- updateDate: string;
33
- fleetId: string;
34
- invoiceYear: number;
35
- invoicesStatus: 'PENDING' | 'PAID' | 'REFUSED' | 'ERROR' | 'REFUNDED' | 'CANCELLED' | 'PENDING_EXTERNAL_PAYMENT' | 'PENDING_MANUAL_PAYMENT' | 'PENDING_AUTHENTICATION' | 'MOP_MISSING';
36
- amount: number;
37
- productId?: string;
38
- currency: string;
39
- serviceId?: string;
40
- tokenId?: string;
41
- entityId: string;
42
- amountPayWithSystemCredit?: number;
43
- attempts: number;
44
- pspName?: string;
45
- pspReference: string;
46
- withTaxRefundAmount: number;
47
- isRefunded?: boolean;
48
- paymentInProgress: boolean;
49
- subscriptionId?: string;
50
- paymentDate?: string;
51
- externalPaymentRequesterId?: string;
52
- externalPaymentNotes?: string;
53
- isPaidExternally?: boolean;
54
- refundInProgress?: boolean;
55
- originId?: string;
56
- originRole?: string;
57
- pspIdempotency: string;
58
- paidExternally?: boolean;
59
- refunded?: boolean;
60
- productTaxIncluded?: boolean;
61
- pspReferencePreAuth?: string;
62
- amountPreAuth?: number;
63
- preAuthEnabled?: boolean;
64
- [key: string]: any;
26
+ id: string;
27
+ sequence: number;
28
+ refundSequence?: number;
29
+ userId: string;
30
+ pricingId?: string;
31
+ tripId?: string;
32
+ invoiceDate: string;
33
+ updateDate: string;
34
+ fleetId: string;
35
+ invoiceYear: number;
36
+ invoicesStatus: 'PENDING' | 'PAID' | 'REFUSED' | 'ERROR' | 'REFUNDED' | 'CANCELLED' | 'PENDING_EXTERNAL_PAYMENT' | 'PENDING_MANUAL_PAYMENT' | 'PENDING_AUTHENTICATION' | 'MOP_MISSING';
37
+ amount: number;
38
+ productId?: string;
39
+ currency: string;
40
+ serviceId?: string;
41
+ tokenId?: string;
42
+ entityId: string;
43
+ amountPayWithSystemCredit?: number;
44
+ attempts: number;
45
+ pspName?: string;
46
+ pspReference: string;
47
+ withTaxRefundAmount: number;
48
+ isRefunded?: boolean;
49
+ paymentInProgress: boolean;
50
+ subscriptionId?: string;
51
+ paymentDate?: string;
52
+ externalPaymentRequesterId?: string;
53
+ externalPaymentNotes?: string;
54
+ isPaidExternally?: boolean;
55
+ refundInProgress?: boolean;
56
+ originId?: string;
57
+ originRole?: string;
58
+ pspIdempotency: string;
59
+ paidExternally?: boolean;
60
+ refunded?: boolean;
61
+ productTaxIncluded?: boolean;
62
+ pspReferencePreAuth?: string;
63
+ amountPreAuth?: number;
64
+ preAuthEnabled?: boolean;
65
+ [key: string]: any;
65
66
  };
66
67
  type Credit = {
67
- initialAmount: number;
68
- validityStartDate: string;
69
- validityEndDate: string;
70
- notes: string;
71
- discountCategory: 'CREDITS' | 'PERCENTAGE';
72
- oneTimeUsage: boolean;
73
- id: UUID;
74
- availableAmount: number;
75
- usedAmount: number;
76
- originId: UUID;
77
- entityId: UUID;
78
- creditAlreadyUsed: boolean;
79
- updateDate: string;
80
- type: 'LOCAL' | 'GLOBAL' | 'PERIODIC';
81
- usage: 'TRIP' | 'REGISTRATION' | 'PRODUCTS' | 'ALL';
82
- [key: string]: any;
68
+ initialAmount: number;
69
+ validityStartDate: string;
70
+ validityEndDate: string;
71
+ notes: string;
72
+ discountCategory: 'CREDITS' | 'PERCENTAGE';
73
+ oneTimeUsage: boolean;
74
+ id: UUID;
75
+ availableAmount: number;
76
+ usedAmount: number;
77
+ originId: UUID;
78
+ entityId: UUID;
79
+ creditAlreadyUsed: boolean;
80
+ updateDate: string;
81
+ type: 'LOCAL' | 'GLOBAL' | 'PERIODIC';
82
+ usage: 'TRIP' | 'REGISTRATION' | 'PRODUCTS' | 'ALL';
83
+ [key: string]: any;
83
84
  };
84
85
  type Receipt = {
85
- id: string;
86
- pspName: string;
87
- pspReference: string;
88
- pspPublishableKey: string;
89
- amount: number;
90
- currency: string;
91
- date: string;
92
- status: string;
93
- paymentMethodType: string;
94
- paymentMethodPspReference: string;
95
- paymentIntentPspReference: string;
96
- number: number;
97
- code: string;
98
- declineCode: string;
99
- pspClientSecret: string;
100
- reason: string;
101
- note: string;
102
- nextAction: {
103
- nextActionRedirectUrl: {
104
- url: string;
105
- method: string;
106
- data: {
107
- [key: string]: unknown;
108
- };
109
- };
110
- type: string;
111
- };
112
- metadatas: {
86
+ id: string;
87
+ pspName: string;
88
+ pspReference: string;
89
+ pspPublishableKey: string;
90
+ amount: number;
91
+ currency: string;
92
+ date: string;
93
+ status: string;
94
+ paymentMethodType: string;
95
+ paymentMethodPspReference: string;
96
+ paymentIntentPspReference: string;
97
+ number: number;
98
+ code: string;
99
+ declineCode: string;
100
+ pspClientSecret: string;
101
+ reason: string;
102
+ note: string;
103
+ nextAction: {
104
+ nextActionRedirectUrl: {
105
+ url: string;
106
+ method: string;
107
+ data: {
113
108
  [key: string]: unknown;
109
+ };
114
110
  };
111
+ type: string;
112
+ };
113
+ metadatas: {
114
+ [key: string]: unknown;
115
+ };
115
116
  };
116
117
  type RefundableAmount = {
117
- invoiceId: string;
118
- fleetId: string;
119
- refundableAmount: number;
120
- currency: string;
121
- refundablePaymentReceipts: Receipt[];
122
- refundedPaymentReceipts: Receipt[];
118
+ invoiceId: string;
119
+ fleetId: string;
120
+ refundableAmount: number;
121
+ currency: string;
122
+ refundablePaymentReceipts: Receipt[];
123
+ refundedPaymentReceipts: Receipt[];
123
124
  };
124
125
  type Wallet = {
125
- initialAmount: number;
126
- validityStartDate: string;
127
- validityEndDate: string;
128
- notes: string;
129
- discountCategory: string;
130
- oneTimeUsage: boolean;
131
- id: string;
132
- availableAmount: number;
133
- usedAmount: number;
134
- originId: string;
135
- entityId: string;
136
- creditAlreadyUsed: boolean;
137
- updateDate: string;
138
- type: string;
139
- usage: string;
126
+ initialAmount: number;
127
+ validityStartDate: string;
128
+ validityEndDate: string;
129
+ notes: string;
130
+ discountCategory: string;
131
+ oneTimeUsage: boolean;
132
+ id: string;
133
+ availableAmount: number;
134
+ usedAmount: number;
135
+ originId: string;
136
+ entityId: string;
137
+ creditAlreadyUsed: boolean;
138
+ updateDate: string;
139
+ type: string;
140
+ usage: string;
140
141
  };
141
-
142
+ //#endregion
143
+ //#region src/chargeProduct.d.ts
142
144
  declare const chargeProduct: (client: Client, info: ChargeProductInfo) => Promise<Invoice>;
143
-
145
+ //#endregion
146
+ //#region src/getUserCreditsByEntityId.d.ts
144
147
  declare const getUserCreditsByEntityId: (client: Client, id: string) => Promise<Credit>;
145
-
146
- interface Payload$1 extends Omit<Credit, 'id' | 'availableAmount' | 'usedAmount' | 'originId' | 'creditAlreadyUsed' | 'updateDate'> {
147
- }
148
+ //#endregion
149
+ //#region src/addCredits.d.ts
150
+ interface Payload$1 extends Omit<Credit, 'id' | 'availableAmount' | 'usedAmount' | 'originId' | 'creditAlreadyUsed' | 'updateDate'> {}
148
151
  declare const addCredits: (client: Client, payload: Payload$1) => Promise<Credit>;
149
-
152
+ //#endregion
153
+ //#region src/getInvoiceById.d.ts
150
154
  declare const getInvoiceById: (client: Client, id: string) => Promise<Invoice>;
151
-
155
+ //#endregion
156
+ //#region src/getRefundableAmount.d.ts
152
157
  declare const getRefundableAmount: (client: Client, invoiceId: string) => Promise<RefundableAmount>;
153
-
158
+ //#endregion
159
+ //#region src/refund.d.ts
154
160
  interface Payload {
155
- invoiceId: string;
156
- amount?: number;
157
- note?: string | null;
158
- paymentIntentPspReference?: string;
161
+ invoiceId: string;
162
+ amount?: number;
163
+ note?: string | null;
164
+ paymentIntentPspReference?: string;
159
165
  }
160
166
  declare const refund: (client: Client, payload: Payload) => Promise<void>;
161
-
167
+ //#endregion
168
+ //#region src/getWalletsByEntity.d.ts
162
169
  declare const getWalletsByEntity: (client: Client, entityId: string) => Promise<Wallet[]>;
163
-
170
+ //#endregion
171
+ //#region src/updateWallet.d.ts
164
172
  declare const paths: readonly ["/availableAmount", "/percentage"];
165
173
  type Paths = (typeof paths)[number];
166
174
  declare const updateWallet: (client: Client, walletId: string, actions: PatchAction<Paths>[]) => Promise<void>;
167
-
175
+ //#endregion
176
+ //#region src/payInvoice.d.ts
168
177
  declare const payInvoice: (client: Client, invoiceId: string, manualPayment: ManualPayment) => Promise<Invoice>;
169
-
170
- export { type ChargeProductInfo, type Credit, type Invoice, type ManualPayment, type Paths, type Receipt, type RefundableAmount, type Wallet, addCredits, chargeProduct, getInvoiceById, getRefundableAmount, getUserCreditsByEntityId, getWalletsByEntity, payInvoice, refund, updateWallet };
178
+ //#endregion
179
+ export { ChargeProductInfo, Credit, Invoice, ManualPayment, Paths, Receipt, RefundableAmount, Wallet, addCredits, chargeProduct, getInvoiceById, getRefundableAmount, getUserCreditsByEntityId, getWalletsByEntity, payInvoice, refund, updateWallet };