@deliverart/sdk-js-payment 0.0.3 → 1.1.0
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/package.json +11 -26
- package/.changeset/config.json +0 -11
- package/.github/workflows/workflow.yml +0 -47
- package/.prettierrc +0 -7
- package/CHANGELOG.md +0 -49
- package/README.md +0 -3
- package/dist/index.cjs +0 -1080
- package/dist/index.d.cts +0 -4422
- package/dist/index.d.ts +0 -4422
- package/dist/index.js +0 -964
- package/eslint.config.js +0 -41
- package/src/index.ts +0 -3
- package/src/models.ts +0 -168
- package/src/requests/index.ts +0 -2
- package/src/requests/payment-configs/DeletePaymentConfig.ts +0 -27
- package/src/requests/payment-configs/GetPaymentConfigDetails.ts +0 -33
- package/src/requests/payment-configs/GetPaymentConfigs.ts +0 -50
- package/src/requests/payment-configs/bank-transfer/CreatePaymentConfigBankTransfer.ts +0 -38
- package/src/requests/payment-configs/bank-transfer/DeletePaymentConfigBankTransfer.ts +0 -27
- package/src/requests/payment-configs/bank-transfer/GetPaymentConfigBankTransferDetails.ts +0 -37
- package/src/requests/payment-configs/bank-transfer/GetPaymentConfigBankTransferList.ts +0 -54
- package/src/requests/payment-configs/bank-transfer/UpdatePaymentConfigBankTransfer.ts +0 -45
- package/src/requests/payment-configs/bank-transfer/index.ts +0 -5
- package/src/requests/payment-configs/cash/CreatePaymentConfigCash.ts +0 -36
- package/src/requests/payment-configs/cash/DeletePaymentConfigCash.ts +0 -27
- package/src/requests/payment-configs/cash/GetPaymentConfigCashDetails.ts +0 -33
- package/src/requests/payment-configs/cash/GetPaymentConfigCashList.ts +0 -52
- package/src/requests/payment-configs/cash/index.ts +0 -4
- package/src/requests/payment-configs/credit-card/CreatePaymentConfigCreditCard.ts +0 -38
- package/src/requests/payment-configs/credit-card/DeletePaymentConfigCreditCard.ts +0 -27
- package/src/requests/payment-configs/credit-card/GetPaymentConfigCreditCardDetails.ts +0 -36
- package/src/requests/payment-configs/credit-card/GetPaymentConfigCreditCardList.ts +0 -54
- package/src/requests/payment-configs/credit-card/index.ts +0 -4
- package/src/requests/payment-configs/index.ts +0 -7
- package/src/requests/payment-configs/stripe/CreatePaymentConfigStripe.ts +0 -36
- package/src/requests/payment-configs/stripe/DeletePaymentConfigStripe.ts +0 -27
- package/src/requests/payment-configs/stripe/GetPaymentConfigStripeDetails.ts +0 -33
- package/src/requests/payment-configs/stripe/GetPaymentConfigStripeList.ts +0 -53
- package/src/requests/payment-configs/stripe/UpdatePaymentConfigStripe.ts +0 -43
- package/src/requests/payment-configs/stripe/index.ts +0 -5
- package/src/requests/payments/DeletePayment.ts +0 -27
- package/src/requests/payments/GetPaymentDetails.ts +0 -30
- package/src/requests/payments/GetPayments.ts +0 -45
- package/src/requests/payments/GetPaymentsForPaymentConfig.ts +0 -53
- package/src/requests/payments/UpdatePayment.ts +0 -32
- package/src/requests/payments/index.ts +0 -5
- package/src/types.ts +0 -146
- package/tsconfig.json +0 -15
package/eslint.config.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
// eslint.config.js per @typescript-eslint v8
|
|
3
|
-
import js from '@eslint/js'
|
|
4
|
-
import prettier from 'eslint-config-prettier'
|
|
5
|
-
import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort'
|
|
6
|
-
import tsPlugin from '@typescript-eslint/eslint-plugin'
|
|
7
|
-
import tsParser from '@typescript-eslint/parser'
|
|
8
|
-
|
|
9
|
-
export default [
|
|
10
|
-
js.configs.recommended,
|
|
11
|
-
{
|
|
12
|
-
files: ['**/*.ts'],
|
|
13
|
-
languageOptions: {
|
|
14
|
-
parser: tsParser,
|
|
15
|
-
globals: {
|
|
16
|
-
process: 'readonly',
|
|
17
|
-
fetch: 'readonly',
|
|
18
|
-
Request: 'readonly',
|
|
19
|
-
Response: 'readonly',
|
|
20
|
-
Headers: 'readonly',
|
|
21
|
-
},
|
|
22
|
-
parserOptions: {
|
|
23
|
-
project: ['./tsconfig.json'],
|
|
24
|
-
tsconfigRootDir: process.cwd(),
|
|
25
|
-
sourceType: 'module',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
plugins: {
|
|
29
|
-
'@typescript-eslint': tsPlugin,
|
|
30
|
-
'simple-import-sort': simpleImportSortPlugin,
|
|
31
|
-
},
|
|
32
|
-
rules: {
|
|
33
|
-
'simple-import-sort/imports': 'error',
|
|
34
|
-
'simple-import-sort/exports': 'error',
|
|
35
|
-
'@typescript-eslint/no-unused-vars': 'warn',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
prettier,
|
|
39
|
-
]
|
|
40
|
-
|
|
41
|
-
export const ignores = ['dist', 'node_modules']
|
package/src/index.ts
DELETED
package/src/models.ts
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
datetimeSchema,
|
|
3
|
-
sortDirSchema,
|
|
4
|
-
timestampsFilterSchema,
|
|
5
|
-
} from '@deliverart/sdk-js-global-types'
|
|
6
|
-
import { pointOfSalePathSchema } from '@deliverart/sdk-js-point-of-sale'
|
|
7
|
-
import { z } from 'zod'
|
|
8
|
-
|
|
9
|
-
import { paymentConfigPathSchema, paymentMethodSchema, paymentStatusSchema } from './types'
|
|
10
|
-
|
|
11
|
-
export const paymentSchema = z.object({
|
|
12
|
-
id: z.string(),
|
|
13
|
-
method: paymentMethodSchema,
|
|
14
|
-
status: paymentStatusSchema,
|
|
15
|
-
amount: z.string(),
|
|
16
|
-
internalReference: z.string().nullable(),
|
|
17
|
-
externalReference: z.string().nullable(),
|
|
18
|
-
response: z.string().nullable(),
|
|
19
|
-
validUntil: datetimeSchema.nullable(),
|
|
20
|
-
createdAt: datetimeSchema,
|
|
21
|
-
updatedAt: datetimeSchema,
|
|
22
|
-
})
|
|
23
|
-
export type Payment = z.infer<typeof paymentSchema>
|
|
24
|
-
|
|
25
|
-
export const paymentDetailsSchema = paymentSchema.extend({
|
|
26
|
-
config: paymentConfigPathSchema,
|
|
27
|
-
})
|
|
28
|
-
export type PaymentDetails = z.infer<typeof paymentDetailsSchema>
|
|
29
|
-
|
|
30
|
-
export const writablePaymentSchema = paymentDetailsSchema.pick({
|
|
31
|
-
status: true,
|
|
32
|
-
response: true,
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
export const paymentConfigBaseSchema = z.object({
|
|
36
|
-
id: z.string(),
|
|
37
|
-
method: paymentMethodSchema,
|
|
38
|
-
configurationCompleted: z.boolean(),
|
|
39
|
-
createdAt: datetimeSchema,
|
|
40
|
-
updatedAt: datetimeSchema,
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
export const paymentConfigDetailsFieldsSchema = z.object({
|
|
44
|
-
pointOfSale: pointOfSalePathSchema,
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
export const paymentConfigBankTransferSchema = paymentConfigBaseSchema
|
|
48
|
-
.omit({ method: true })
|
|
49
|
-
.extend({
|
|
50
|
-
method: paymentMethodSchema.extract(['bank_transfer']),
|
|
51
|
-
iban: z.string(),
|
|
52
|
-
bic: z.string(),
|
|
53
|
-
accountHolder: z.string(),
|
|
54
|
-
bankName: z.string(),
|
|
55
|
-
bankAddress: z.string().nullable().optional(),
|
|
56
|
-
currency: z.string(),
|
|
57
|
-
})
|
|
58
|
-
export type PaymentConfigBankTransfer = z.infer<typeof paymentConfigBankTransferSchema>
|
|
59
|
-
|
|
60
|
-
export const paymentConfigBankTransferDetailsSchema = paymentConfigBankTransferSchema.extend(
|
|
61
|
-
paymentConfigDetailsFieldsSchema.shape,
|
|
62
|
-
)
|
|
63
|
-
export type PaymentConfigBankTransferDetails = z.infer<
|
|
64
|
-
typeof paymentConfigBankTransferDetailsSchema
|
|
65
|
-
>
|
|
66
|
-
|
|
67
|
-
export const writablePaymentConfigBankTransferSchema = paymentConfigBankTransferDetailsSchema.pick({
|
|
68
|
-
pointOfSale: true,
|
|
69
|
-
iban: true,
|
|
70
|
-
bic: true,
|
|
71
|
-
accountHolder: true,
|
|
72
|
-
bankName: true,
|
|
73
|
-
bankAddress: true,
|
|
74
|
-
currency: true,
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
export const paymentConfigCashSchema = paymentConfigBaseSchema.omit({ method: true }).extend({
|
|
78
|
-
method: paymentMethodSchema.extract(['cash']),
|
|
79
|
-
})
|
|
80
|
-
export type PaymentConfigCash = z.infer<typeof paymentConfigCashSchema>
|
|
81
|
-
|
|
82
|
-
export const paymentConfigCashDetailsSchema = paymentConfigCashSchema.extend(
|
|
83
|
-
paymentConfigDetailsFieldsSchema.shape,
|
|
84
|
-
)
|
|
85
|
-
export type PaymentConfigCashDetails = z.infer<typeof paymentConfigCashDetailsSchema>
|
|
86
|
-
|
|
87
|
-
export const writablePaymentConfigCashSchema = paymentConfigCashDetailsSchema.pick({
|
|
88
|
-
pointOfSale: true,
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
export const paymentConfigCreditCardSchema = paymentConfigBaseSchema.omit({ method: true }).extend({
|
|
92
|
-
method: paymentMethodSchema.extract(['credit_card']),
|
|
93
|
-
})
|
|
94
|
-
export type PaymentConfigCreditCard = z.infer<typeof paymentConfigCreditCardSchema>
|
|
95
|
-
|
|
96
|
-
export const paymentConfigCreditCardDetailsSchema = paymentConfigCreditCardSchema.extend(
|
|
97
|
-
paymentConfigDetailsFieldsSchema.shape,
|
|
98
|
-
)
|
|
99
|
-
export type PaymentConfigCreditCardDetails = z.infer<typeof paymentConfigCreditCardDetailsSchema>
|
|
100
|
-
|
|
101
|
-
export const writablePaymentConfigCreditCardSchema = paymentConfigCreditCardDetailsSchema.pick({
|
|
102
|
-
pointOfSale: true,
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
export const paymentConfigStripeSchema = paymentConfigBaseSchema.omit({ method: true }).extend({
|
|
106
|
-
method: paymentMethodSchema.extract(['stripe']),
|
|
107
|
-
secretKey: z.string(),
|
|
108
|
-
webhookSecret: z.string().nullable().optional(),
|
|
109
|
-
webhookId: z.string().nullable().optional(),
|
|
110
|
-
})
|
|
111
|
-
export type PaymentConfigStripe = z.infer<typeof paymentConfigStripeSchema>
|
|
112
|
-
|
|
113
|
-
export const paymentConfigStripeDetailsSchema = paymentConfigStripeSchema.extend(
|
|
114
|
-
paymentConfigDetailsFieldsSchema.shape,
|
|
115
|
-
)
|
|
116
|
-
export type PaymentConfigStripeDetails = z.infer<typeof paymentConfigStripeDetailsSchema>
|
|
117
|
-
|
|
118
|
-
export const writablePaymentConfigStripeSchema = paymentConfigStripeDetailsSchema.pick({
|
|
119
|
-
pointOfSale: true,
|
|
120
|
-
secretKey: true,
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
export const paymentConfigSchema = z.discriminatedUnion('method', [
|
|
124
|
-
paymentConfigBankTransferSchema,
|
|
125
|
-
paymentConfigCashSchema,
|
|
126
|
-
paymentConfigCreditCardSchema,
|
|
127
|
-
paymentConfigStripeSchema,
|
|
128
|
-
])
|
|
129
|
-
export type PaymentConfig = z.infer<typeof paymentConfigSchema>
|
|
130
|
-
|
|
131
|
-
export const paymentConfigDetailsSchema = z.discriminatedUnion('method', [
|
|
132
|
-
paymentConfigBankTransferDetailsSchema,
|
|
133
|
-
paymentConfigCashDetailsSchema,
|
|
134
|
-
paymentConfigCreditCardDetailsSchema,
|
|
135
|
-
paymentConfigStripeDetailsSchema,
|
|
136
|
-
])
|
|
137
|
-
export type PaymentConfigDetails = z.infer<typeof paymentConfigDetailsSchema>
|
|
138
|
-
|
|
139
|
-
export const paymentQuerySchema = z
|
|
140
|
-
.object({
|
|
141
|
-
internalReference: z.string().optional(),
|
|
142
|
-
externalReference: z.string().optional(),
|
|
143
|
-
method: paymentMethodSchema.optional(),
|
|
144
|
-
'method[]': z.array(paymentMethodSchema).optional(),
|
|
145
|
-
status: paymentStatusSchema.optional(),
|
|
146
|
-
'status[]': z.array(paymentStatusSchema).optional(),
|
|
147
|
-
'amount[between]': z.coerce.number().optional(),
|
|
148
|
-
'amount[gt]': z.coerce.number().optional(),
|
|
149
|
-
'amount[gte]': z.coerce.number().optional(),
|
|
150
|
-
'amount[lt]': z.coerce.number().optional(),
|
|
151
|
-
'amount[lte]': z.coerce.number().optional(),
|
|
152
|
-
'order[createdAt]': sortDirSchema.optional(),
|
|
153
|
-
'order[updatedAt]': sortDirSchema.optional(),
|
|
154
|
-
page: z.coerce.number().optional(),
|
|
155
|
-
})
|
|
156
|
-
.merge(timestampsFilterSchema)
|
|
157
|
-
export type PaymentQueryParams = z.infer<typeof paymentQuerySchema>
|
|
158
|
-
|
|
159
|
-
export const paymentConfigsQuerySchema = z
|
|
160
|
-
.object({
|
|
161
|
-
method: paymentMethodSchema.optional(),
|
|
162
|
-
configurationCompleted: z.coerce.boolean().optional(),
|
|
163
|
-
'order[createdAt]': sortDirSchema.optional(),
|
|
164
|
-
'order[updatedAt]': sortDirSchema.optional(),
|
|
165
|
-
page: z.coerce.number().optional(),
|
|
166
|
-
})
|
|
167
|
-
.merge(timestampsFilterSchema)
|
|
168
|
-
export type PaymentConfigsQueryParams = z.infer<typeof paymentConfigsQuerySchema>
|
package/src/requests/index.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
export const deletePaymentConfigInputSchema = z.undefined()
|
|
5
|
-
export const deletePaymentConfigResponseSchema = z.undefined()
|
|
6
|
-
|
|
7
|
-
export class DeletePaymentConfig extends AbstractApiRequest<void, void> {
|
|
8
|
-
readonly method = 'DELETE'
|
|
9
|
-
readonly contentType = 'application/json'
|
|
10
|
-
readonly accept = 'application/json'
|
|
11
|
-
|
|
12
|
-
readonly inputSchema = deletePaymentConfigInputSchema
|
|
13
|
-
readonly outputSchema = deletePaymentConfigResponseSchema
|
|
14
|
-
readonly querySchema = undefined
|
|
15
|
-
readonly headersSchema = undefined
|
|
16
|
-
|
|
17
|
-
private readonly paymentConfigId: string
|
|
18
|
-
|
|
19
|
-
constructor(paymentConfigId: string) {
|
|
20
|
-
super()
|
|
21
|
-
this.paymentConfigId = paymentConfigId
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
getPath(): string {
|
|
25
|
-
return `/payment_configs/${this.paymentConfigId}`
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
import { PaymentConfigDetails, paymentConfigDetailsSchema } from '../../models'
|
|
5
|
-
|
|
6
|
-
export const getPaymentConfigDetailsInputSchema = z.undefined()
|
|
7
|
-
|
|
8
|
-
export const getPaymentConfigDetailsResponseSchema = paymentConfigDetailsSchema
|
|
9
|
-
export type GetPaymentConfigDetailsResponse = PaymentConfigDetails
|
|
10
|
-
|
|
11
|
-
export class GetPaymentConfigDetails extends AbstractApiRequest<
|
|
12
|
-
void,
|
|
13
|
-
GetPaymentConfigDetailsResponse
|
|
14
|
-
> {
|
|
15
|
-
readonly method = 'GET'
|
|
16
|
-
readonly contentType = 'application/json'
|
|
17
|
-
readonly accept = 'application/json'
|
|
18
|
-
readonly inputSchema = getPaymentConfigDetailsInputSchema
|
|
19
|
-
readonly outputSchema = getPaymentConfigDetailsResponseSchema
|
|
20
|
-
readonly querySchema = undefined
|
|
21
|
-
readonly headersSchema = undefined
|
|
22
|
-
|
|
23
|
-
private readonly paymentConfigId: string
|
|
24
|
-
|
|
25
|
-
constructor(paymentConfigId: string) {
|
|
26
|
-
super()
|
|
27
|
-
this.paymentConfigId = paymentConfigId
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
getPath(): string {
|
|
31
|
-
return `/payment_configs/${this.paymentConfigId}`
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import {
|
|
3
|
-
createPaginatedSchema,
|
|
4
|
-
Paginated,
|
|
5
|
-
responseToPagination,
|
|
6
|
-
} from '@deliverart/sdk-js-global-types'
|
|
7
|
-
import { AxiosResponse } from 'axios'
|
|
8
|
-
import { z } from 'zod'
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
PaymentConfig,
|
|
12
|
-
paymentConfigSchema,
|
|
13
|
-
PaymentConfigsQueryParams,
|
|
14
|
-
paymentConfigsQuerySchema,
|
|
15
|
-
} from '../../models'
|
|
16
|
-
|
|
17
|
-
export type GetPaymentConfigsQueryParams = PaymentConfigsQueryParams
|
|
18
|
-
|
|
19
|
-
export const getPaymentConfigsResponseSchema = createPaginatedSchema(paymentConfigSchema)
|
|
20
|
-
export type GetPaymentConfigsResponse = z.infer<typeof getPaymentConfigsResponseSchema>
|
|
21
|
-
|
|
22
|
-
export const getPaymentConfigsInputSchema = z.undefined()
|
|
23
|
-
|
|
24
|
-
export class GetPaymentConfigs extends AbstractApiRequest<
|
|
25
|
-
void,
|
|
26
|
-
GetPaymentConfigsResponse,
|
|
27
|
-
GetPaymentConfigsQueryParams
|
|
28
|
-
> {
|
|
29
|
-
readonly method = 'GET'
|
|
30
|
-
readonly contentType = 'application/json'
|
|
31
|
-
readonly accept = 'application/json'
|
|
32
|
-
|
|
33
|
-
readonly inputSchema = getPaymentConfigsInputSchema
|
|
34
|
-
readonly outputSchema = getPaymentConfigsResponseSchema
|
|
35
|
-
readonly querySchema = paymentConfigsQuerySchema
|
|
36
|
-
readonly headersSchema = undefined
|
|
37
|
-
|
|
38
|
-
constructor(options?: { query?: GetPaymentConfigsQueryParams }) {
|
|
39
|
-
super(undefined, options)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
getPath(): string {
|
|
43
|
-
return '/payment_configs'
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
parseResponse(data: unknown, rawResponse: AxiosResponse): Paginated<PaymentConfig> {
|
|
47
|
-
const payments = z.array(paymentConfigSchema).parse(data)
|
|
48
|
-
return this.validateOutput({ data: payments, pagination: responseToPagination(rawResponse) })
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
PaymentConfigBankTransferDetails,
|
|
6
|
-
paymentConfigBankTransferDetailsSchema,
|
|
7
|
-
writablePaymentConfigBankTransferSchema,
|
|
8
|
-
} from '../../../models'
|
|
9
|
-
|
|
10
|
-
export const createPaymentConfigBankTransferInputSchema = writablePaymentConfigBankTransferSchema
|
|
11
|
-
export type CreatePaymentConfigBankTransferInput = z.infer<
|
|
12
|
-
typeof createPaymentConfigBankTransferInputSchema
|
|
13
|
-
>
|
|
14
|
-
|
|
15
|
-
export const createPaymentConfigBankTransferResponseSchema = paymentConfigBankTransferDetailsSchema
|
|
16
|
-
export type CreatePaymentConfigBankTransferResponse = PaymentConfigBankTransferDetails
|
|
17
|
-
|
|
18
|
-
export class CreatePaymentConfigBankTransfer extends AbstractApiRequest<
|
|
19
|
-
CreatePaymentConfigBankTransferInput,
|
|
20
|
-
CreatePaymentConfigBankTransferResponse
|
|
21
|
-
> {
|
|
22
|
-
readonly method = 'POST'
|
|
23
|
-
readonly contentType = 'application/json'
|
|
24
|
-
readonly accept = 'application/json'
|
|
25
|
-
|
|
26
|
-
readonly inputSchema = createPaymentConfigBankTransferInputSchema
|
|
27
|
-
readonly outputSchema = createPaymentConfigBankTransferResponseSchema
|
|
28
|
-
readonly querySchema = undefined
|
|
29
|
-
readonly headersSchema = undefined
|
|
30
|
-
|
|
31
|
-
constructor(input: CreatePaymentConfigBankTransferInput) {
|
|
32
|
-
super(input)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
getPath(): string {
|
|
36
|
-
return '/payment_configs/bank_transfer'
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
export const deletePaymentConfigBankTransferInputSchema = z.undefined()
|
|
5
|
-
export const deletePaymentConfigBankTransferResponseSchema = z.undefined()
|
|
6
|
-
|
|
7
|
-
export class DeletePaymentConfigBankTransfer extends AbstractApiRequest<void, void> {
|
|
8
|
-
readonly method = 'DELETE'
|
|
9
|
-
readonly contentType = 'application/json'
|
|
10
|
-
readonly accept = 'application/json'
|
|
11
|
-
|
|
12
|
-
readonly inputSchema = deletePaymentConfigBankTransferInputSchema
|
|
13
|
-
readonly outputSchema = deletePaymentConfigBankTransferResponseSchema
|
|
14
|
-
readonly querySchema = undefined
|
|
15
|
-
readonly headersSchema = undefined
|
|
16
|
-
|
|
17
|
-
private readonly paymentConfigId: string
|
|
18
|
-
|
|
19
|
-
constructor(paymentConfigId: string) {
|
|
20
|
-
super()
|
|
21
|
-
this.paymentConfigId = paymentConfigId
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
getPath(): string {
|
|
25
|
-
return `/payment_configs/bank_transfer/${this.paymentConfigId}`
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
PaymentConfigBankTransferDetails,
|
|
6
|
-
paymentConfigBankTransferDetailsSchema,
|
|
7
|
-
} from '../../../models'
|
|
8
|
-
|
|
9
|
-
export const getPaymentConfigBankTransferDetailsInputSchema = z.undefined()
|
|
10
|
-
|
|
11
|
-
export const getPaymentConfigBankTransferDetailsResponseSchema =
|
|
12
|
-
paymentConfigBankTransferDetailsSchema
|
|
13
|
-
export type GetPaymentConfigBankTransferDetailsResponse = PaymentConfigBankTransferDetails
|
|
14
|
-
|
|
15
|
-
export class GetPaymentConfigBankTransferDetails extends AbstractApiRequest<
|
|
16
|
-
void,
|
|
17
|
-
GetPaymentConfigBankTransferDetailsResponse
|
|
18
|
-
> {
|
|
19
|
-
readonly method = 'GET'
|
|
20
|
-
readonly contentType = 'application/json'
|
|
21
|
-
readonly accept = 'application/json'
|
|
22
|
-
readonly inputSchema = getPaymentConfigBankTransferDetailsInputSchema
|
|
23
|
-
readonly outputSchema = getPaymentConfigBankTransferDetailsResponseSchema
|
|
24
|
-
readonly querySchema = undefined
|
|
25
|
-
readonly headersSchema = undefined
|
|
26
|
-
|
|
27
|
-
private readonly paymentConfigId: string
|
|
28
|
-
|
|
29
|
-
constructor(paymentConfigId: string) {
|
|
30
|
-
super()
|
|
31
|
-
this.paymentConfigId = paymentConfigId
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
getPath(): string {
|
|
35
|
-
return `/payment_configs/bank_transfer/${this.paymentConfigId}`
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import {
|
|
3
|
-
createPaginatedSchema,
|
|
4
|
-
Paginated,
|
|
5
|
-
responseToPagination,
|
|
6
|
-
} from '@deliverart/sdk-js-global-types'
|
|
7
|
-
import { AxiosResponse } from 'axios'
|
|
8
|
-
import { z } from 'zod'
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
PaymentConfigBankTransfer,
|
|
12
|
-
paymentConfigBankTransferSchema,
|
|
13
|
-
PaymentConfigsQueryParams,
|
|
14
|
-
paymentConfigsQuerySchema,
|
|
15
|
-
} from '../../../models'
|
|
16
|
-
|
|
17
|
-
export type GetPaymentConfigBankTransferListQueryParams = PaymentConfigsQueryParams
|
|
18
|
-
|
|
19
|
-
export const getPaymentConfigBankTransferListResponseSchema = createPaginatedSchema(
|
|
20
|
-
paymentConfigBankTransferSchema,
|
|
21
|
-
)
|
|
22
|
-
export type GetPaymentConfigBankTransferListResponse = z.infer<
|
|
23
|
-
typeof getPaymentConfigBankTransferListResponseSchema
|
|
24
|
-
>
|
|
25
|
-
|
|
26
|
-
export const getPaymentConfigBankTransferListInputSchema = z.undefined()
|
|
27
|
-
|
|
28
|
-
export class GetPaymentConfigBankTransferList extends AbstractApiRequest<
|
|
29
|
-
void,
|
|
30
|
-
GetPaymentConfigBankTransferListResponse,
|
|
31
|
-
GetPaymentConfigBankTransferListQueryParams
|
|
32
|
-
> {
|
|
33
|
-
readonly method = 'GET'
|
|
34
|
-
readonly contentType = 'application/json'
|
|
35
|
-
readonly accept = 'application/json'
|
|
36
|
-
|
|
37
|
-
readonly inputSchema = getPaymentConfigBankTransferListInputSchema
|
|
38
|
-
readonly outputSchema = getPaymentConfigBankTransferListResponseSchema
|
|
39
|
-
readonly querySchema = paymentConfigsQuerySchema
|
|
40
|
-
readonly headersSchema = undefined
|
|
41
|
-
|
|
42
|
-
constructor(options?: { query?: GetPaymentConfigBankTransferListQueryParams }) {
|
|
43
|
-
super(undefined, options)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
getPath(): string {
|
|
47
|
-
return '/payment_configs/bank_transfer'
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
parseResponse(data: unknown, rawResponse: AxiosResponse): Paginated<PaymentConfigBankTransfer> {
|
|
51
|
-
const payments = z.array(paymentConfigBankTransferSchema).parse(data)
|
|
52
|
-
return this.validateOutput({ data: payments, pagination: responseToPagination(rawResponse) })
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
PaymentConfigBankTransferDetails,
|
|
6
|
-
paymentConfigBankTransferDetailsSchema,
|
|
7
|
-
writablePaymentConfigBankTransferSchema,
|
|
8
|
-
} from '../../../models'
|
|
9
|
-
|
|
10
|
-
export const updatePaymentConfigBankTransferInputSchema = writablePaymentConfigBankTransferSchema
|
|
11
|
-
.omit({
|
|
12
|
-
pointOfSale: true,
|
|
13
|
-
})
|
|
14
|
-
.partial()
|
|
15
|
-
export type UpdatePaymentConfigBankTransferInput = z.infer<
|
|
16
|
-
typeof updatePaymentConfigBankTransferInputSchema
|
|
17
|
-
>
|
|
18
|
-
|
|
19
|
-
export const updatePaymentConfigBankTransferResponseSchema = paymentConfigBankTransferDetailsSchema
|
|
20
|
-
export type UpdatePaymentConfigBankTransferResponse = PaymentConfigBankTransferDetails
|
|
21
|
-
|
|
22
|
-
export class UpdatePaymentConfigBankTransfer extends AbstractApiRequest<
|
|
23
|
-
UpdatePaymentConfigBankTransferInput,
|
|
24
|
-
UpdatePaymentConfigBankTransferResponse
|
|
25
|
-
> {
|
|
26
|
-
readonly method = 'PATCH'
|
|
27
|
-
readonly contentType = 'application/merge-patch+json'
|
|
28
|
-
readonly accept = 'application/json'
|
|
29
|
-
|
|
30
|
-
readonly inputSchema = updatePaymentConfigBankTransferInputSchema
|
|
31
|
-
readonly outputSchema = updatePaymentConfigBankTransferResponseSchema
|
|
32
|
-
readonly querySchema = undefined
|
|
33
|
-
readonly headersSchema = undefined
|
|
34
|
-
|
|
35
|
-
private readonly paymentConfigId: string
|
|
36
|
-
|
|
37
|
-
constructor(paymentConfigId: string, input: UpdatePaymentConfigBankTransferInput) {
|
|
38
|
-
super(input)
|
|
39
|
-
this.paymentConfigId = paymentConfigId
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
getPath(): string {
|
|
43
|
-
return `/payment_configs/bank_transfer/${this.paymentConfigId}`
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
PaymentConfigCashDetails,
|
|
6
|
-
paymentConfigCashDetailsSchema,
|
|
7
|
-
writablePaymentConfigCashSchema,
|
|
8
|
-
} from '../../../models'
|
|
9
|
-
|
|
10
|
-
export const createPaymentConfigCashInputSchema = writablePaymentConfigCashSchema
|
|
11
|
-
export type CreatePaymentConfigCashInput = z.infer<typeof createPaymentConfigCashInputSchema>
|
|
12
|
-
|
|
13
|
-
export const createPaymentConfigCashResponseSchema = paymentConfigCashDetailsSchema
|
|
14
|
-
export type CreatePaymentConfigCashResponse = PaymentConfigCashDetails
|
|
15
|
-
|
|
16
|
-
export class CreatePaymentConfigCash extends AbstractApiRequest<
|
|
17
|
-
CreatePaymentConfigCashInput,
|
|
18
|
-
CreatePaymentConfigCashResponse
|
|
19
|
-
> {
|
|
20
|
-
readonly method = 'POST'
|
|
21
|
-
readonly contentType = 'application/json'
|
|
22
|
-
readonly accept = 'application/json'
|
|
23
|
-
|
|
24
|
-
readonly inputSchema = createPaymentConfigCashInputSchema
|
|
25
|
-
readonly outputSchema = createPaymentConfigCashResponseSchema
|
|
26
|
-
readonly querySchema = undefined
|
|
27
|
-
readonly headersSchema = undefined
|
|
28
|
-
|
|
29
|
-
constructor(input: CreatePaymentConfigCashInput) {
|
|
30
|
-
super(input)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
getPath(): string {
|
|
34
|
-
return '/payment_configs/cash'
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
export const deletePaymentConfigCashInputSchema = z.undefined()
|
|
5
|
-
export const deletePaymentConfigCashResponseSchema = z.undefined()
|
|
6
|
-
|
|
7
|
-
export class DeletePaymentConfigCash extends AbstractApiRequest<void, void> {
|
|
8
|
-
readonly method = 'DELETE'
|
|
9
|
-
readonly contentType = 'application/json'
|
|
10
|
-
readonly accept = 'application/json'
|
|
11
|
-
|
|
12
|
-
readonly inputSchema = deletePaymentConfigCashInputSchema
|
|
13
|
-
readonly outputSchema = deletePaymentConfigCashResponseSchema
|
|
14
|
-
readonly querySchema = undefined
|
|
15
|
-
readonly headersSchema = undefined
|
|
16
|
-
|
|
17
|
-
private readonly paymentConfigId: string
|
|
18
|
-
|
|
19
|
-
constructor(paymentConfigId: string) {
|
|
20
|
-
super()
|
|
21
|
-
this.paymentConfigId = paymentConfigId
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
getPath(): string {
|
|
25
|
-
return `/payment_configs/cash/${this.paymentConfigId}`
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
import { PaymentConfigCashDetails, paymentConfigCashDetailsSchema } from '../../../models'
|
|
5
|
-
|
|
6
|
-
export const getPaymentConfigCashDetailsInputSchema = z.undefined()
|
|
7
|
-
|
|
8
|
-
export const getPaymentConfigCashDetailsResponseSchema = paymentConfigCashDetailsSchema
|
|
9
|
-
export type GetPaymentConfigCashDetailsResponse = PaymentConfigCashDetails
|
|
10
|
-
|
|
11
|
-
export class GetPaymentConfigCashDetails extends AbstractApiRequest<
|
|
12
|
-
void,
|
|
13
|
-
GetPaymentConfigCashDetailsResponse
|
|
14
|
-
> {
|
|
15
|
-
readonly method = 'GET'
|
|
16
|
-
readonly contentType = 'application/json'
|
|
17
|
-
readonly accept = 'application/json'
|
|
18
|
-
readonly inputSchema = getPaymentConfigCashDetailsInputSchema
|
|
19
|
-
readonly outputSchema = getPaymentConfigCashDetailsResponseSchema
|
|
20
|
-
readonly querySchema = undefined
|
|
21
|
-
readonly headersSchema = undefined
|
|
22
|
-
|
|
23
|
-
private readonly paymentConfigId: string
|
|
24
|
-
|
|
25
|
-
constructor(paymentConfigId: string) {
|
|
26
|
-
super()
|
|
27
|
-
this.paymentConfigId = paymentConfigId
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
getPath(): string {
|
|
31
|
-
return `/payment_configs/cash/${this.paymentConfigId}`
|
|
32
|
-
}
|
|
33
|
-
}
|