@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
|
@@ -1,52 +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
|
-
PaymentConfigCash,
|
|
12
|
-
paymentConfigCashSchema,
|
|
13
|
-
PaymentConfigsQueryParams,
|
|
14
|
-
paymentConfigsQuerySchema,
|
|
15
|
-
} from '../../../models'
|
|
16
|
-
|
|
17
|
-
export type GetPaymentConfigCashListQueryParams = PaymentConfigsQueryParams
|
|
18
|
-
|
|
19
|
-
export const getPaymentConfigCashListResponseSchema = createPaginatedSchema(paymentConfigCashSchema)
|
|
20
|
-
export type GetPaymentConfigCashListResponse = z.infer<
|
|
21
|
-
typeof getPaymentConfigCashListResponseSchema
|
|
22
|
-
>
|
|
23
|
-
|
|
24
|
-
export const getPaymentConfigCashListInputSchema = z.undefined()
|
|
25
|
-
|
|
26
|
-
export class GetPaymentConfigCashList extends AbstractApiRequest<
|
|
27
|
-
void,
|
|
28
|
-
GetPaymentConfigCashListResponse,
|
|
29
|
-
GetPaymentConfigCashListQueryParams
|
|
30
|
-
> {
|
|
31
|
-
readonly method = 'GET'
|
|
32
|
-
readonly contentType = 'application/json'
|
|
33
|
-
readonly accept = 'application/json'
|
|
34
|
-
|
|
35
|
-
readonly inputSchema = getPaymentConfigCashListInputSchema
|
|
36
|
-
readonly outputSchema = getPaymentConfigCashListResponseSchema
|
|
37
|
-
readonly querySchema = paymentConfigsQuerySchema
|
|
38
|
-
readonly headersSchema = undefined
|
|
39
|
-
|
|
40
|
-
constructor(options?: { query?: GetPaymentConfigCashListQueryParams }) {
|
|
41
|
-
super(undefined, options)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
getPath(): string {
|
|
45
|
-
return '/payment_configs/cash'
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
parseResponse(data: unknown, rawResponse: AxiosResponse): Paginated<PaymentConfigCash> {
|
|
49
|
-
const payments = z.array(paymentConfigCashSchema).parse(data)
|
|
50
|
-
return this.validateOutput({ data: payments, pagination: responseToPagination(rawResponse) })
|
|
51
|
-
}
|
|
52
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
PaymentConfigCreditCardDetails,
|
|
6
|
-
paymentConfigCreditCardDetailsSchema,
|
|
7
|
-
writablePaymentConfigCreditCardSchema,
|
|
8
|
-
} from '../../../models'
|
|
9
|
-
|
|
10
|
-
export const createPaymentConfigCreditCardInputSchema = writablePaymentConfigCreditCardSchema
|
|
11
|
-
export type CreatePaymentConfigCreditCardInput = z.infer<
|
|
12
|
-
typeof createPaymentConfigCreditCardInputSchema
|
|
13
|
-
>
|
|
14
|
-
|
|
15
|
-
export const createPaymentConfigCreditCardResponseSchema = paymentConfigCreditCardDetailsSchema
|
|
16
|
-
export type CreatePaymentConfigCreditCardResponse = PaymentConfigCreditCardDetails
|
|
17
|
-
|
|
18
|
-
export class CreatePaymentConfigCreditCard extends AbstractApiRequest<
|
|
19
|
-
CreatePaymentConfigCreditCardInput,
|
|
20
|
-
CreatePaymentConfigCreditCardResponse
|
|
21
|
-
> {
|
|
22
|
-
readonly method = 'POST'
|
|
23
|
-
readonly contentType = 'application/json'
|
|
24
|
-
readonly accept = 'application/json'
|
|
25
|
-
|
|
26
|
-
readonly inputSchema = createPaymentConfigCreditCardInputSchema
|
|
27
|
-
readonly outputSchema = createPaymentConfigCreditCardResponseSchema
|
|
28
|
-
readonly querySchema = undefined
|
|
29
|
-
readonly headersSchema = undefined
|
|
30
|
-
|
|
31
|
-
constructor(input: CreatePaymentConfigCreditCardInput) {
|
|
32
|
-
super(input)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
getPath(): string {
|
|
36
|
-
return '/payment_configs/credit_card'
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
export const deletePaymentConfigCreditCardInputSchema = z.undefined()
|
|
5
|
-
export const deletePaymentConfigCreditCardResponseSchema = z.undefined()
|
|
6
|
-
|
|
7
|
-
export class DeletePaymentConfigCreditCard extends AbstractApiRequest<void, void> {
|
|
8
|
-
readonly method = 'DELETE'
|
|
9
|
-
readonly contentType = 'application/json'
|
|
10
|
-
readonly accept = 'application/json'
|
|
11
|
-
|
|
12
|
-
readonly inputSchema = deletePaymentConfigCreditCardInputSchema
|
|
13
|
-
readonly outputSchema = deletePaymentConfigCreditCardResponseSchema
|
|
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/credit_card/${this.paymentConfigId}`
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
PaymentConfigCreditCardDetails,
|
|
6
|
-
paymentConfigCreditCardDetailsSchema,
|
|
7
|
-
} from '../../../models'
|
|
8
|
-
|
|
9
|
-
export const getPaymentConfigCreditCardDetailsInputSchema = z.undefined()
|
|
10
|
-
|
|
11
|
-
export const getPaymentConfigCreditCardDetailsResponseSchema = paymentConfigCreditCardDetailsSchema
|
|
12
|
-
export type GetPaymentConfigCreditCardDetailsResponse = PaymentConfigCreditCardDetails
|
|
13
|
-
|
|
14
|
-
export class GetPaymentConfigCreditCardDetails extends AbstractApiRequest<
|
|
15
|
-
void,
|
|
16
|
-
GetPaymentConfigCreditCardDetailsResponse
|
|
17
|
-
> {
|
|
18
|
-
readonly method = 'GET'
|
|
19
|
-
readonly contentType = 'application/json'
|
|
20
|
-
readonly accept = 'application/json'
|
|
21
|
-
readonly inputSchema = getPaymentConfigCreditCardDetailsInputSchema
|
|
22
|
-
readonly outputSchema = getPaymentConfigCreditCardDetailsResponseSchema
|
|
23
|
-
readonly querySchema = undefined
|
|
24
|
-
readonly headersSchema = undefined
|
|
25
|
-
|
|
26
|
-
private readonly paymentConfigId: string
|
|
27
|
-
|
|
28
|
-
constructor(paymentConfigId: string) {
|
|
29
|
-
super()
|
|
30
|
-
this.paymentConfigId = paymentConfigId
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
getPath(): string {
|
|
34
|
-
return `/payment_configs/credit_card/${this.paymentConfigId}`
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -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
|
-
PaymentConfigCreditCard,
|
|
12
|
-
paymentConfigCreditCardSchema,
|
|
13
|
-
PaymentConfigsQueryParams,
|
|
14
|
-
paymentConfigsQuerySchema,
|
|
15
|
-
} from '../../../models'
|
|
16
|
-
|
|
17
|
-
export type GetPaymentConfigCreditCardListQueryParams = PaymentConfigsQueryParams
|
|
18
|
-
|
|
19
|
-
export const getPaymentConfigCreditCardListResponseSchema = createPaginatedSchema(
|
|
20
|
-
paymentConfigCreditCardSchema,
|
|
21
|
-
)
|
|
22
|
-
export type GetPaymentConfigCreditCardListResponse = z.infer<
|
|
23
|
-
typeof getPaymentConfigCreditCardListResponseSchema
|
|
24
|
-
>
|
|
25
|
-
|
|
26
|
-
export const getPaymentConfigCreditCardListInputSchema = z.undefined()
|
|
27
|
-
|
|
28
|
-
export class GetPaymentConfigCreditCardList extends AbstractApiRequest<
|
|
29
|
-
void,
|
|
30
|
-
GetPaymentConfigCreditCardListResponse,
|
|
31
|
-
GetPaymentConfigCreditCardListQueryParams
|
|
32
|
-
> {
|
|
33
|
-
readonly method = 'GET'
|
|
34
|
-
readonly contentType = 'application/json'
|
|
35
|
-
readonly accept = 'application/json'
|
|
36
|
-
|
|
37
|
-
readonly inputSchema = getPaymentConfigCreditCardListInputSchema
|
|
38
|
-
readonly outputSchema = getPaymentConfigCreditCardListResponseSchema
|
|
39
|
-
readonly querySchema = paymentConfigsQuerySchema
|
|
40
|
-
readonly headersSchema = undefined
|
|
41
|
-
|
|
42
|
-
constructor(options?: { query?: GetPaymentConfigCreditCardListQueryParams }) {
|
|
43
|
-
super(undefined, options)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
getPath(): string {
|
|
47
|
-
return '/payment_configs/credit_card'
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
parseResponse(data: unknown, rawResponse: AxiosResponse): Paginated<PaymentConfigCreditCard> {
|
|
51
|
-
const payments = z.array(paymentConfigCreditCardSchema).parse(data)
|
|
52
|
-
return this.validateOutput({ data: payments, pagination: responseToPagination(rawResponse) })
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
PaymentConfigStripeDetails,
|
|
6
|
-
paymentConfigStripeDetailsSchema,
|
|
7
|
-
writablePaymentConfigStripeSchema,
|
|
8
|
-
} from '../../../models'
|
|
9
|
-
|
|
10
|
-
export const createPaymentConfigStripeInputSchema = writablePaymentConfigStripeSchema
|
|
11
|
-
export type CreatePaymentConfigStripeInput = z.infer<typeof createPaymentConfigStripeInputSchema>
|
|
12
|
-
|
|
13
|
-
export const createPaymentConfigStripeResponseSchema = paymentConfigStripeDetailsSchema
|
|
14
|
-
export type CreatePaymentConfigStripeResponse = PaymentConfigStripeDetails
|
|
15
|
-
|
|
16
|
-
export class CreatePaymentConfigStripe extends AbstractApiRequest<
|
|
17
|
-
CreatePaymentConfigStripeInput,
|
|
18
|
-
CreatePaymentConfigStripeResponse
|
|
19
|
-
> {
|
|
20
|
-
readonly method = 'POST'
|
|
21
|
-
readonly contentType = 'application/json'
|
|
22
|
-
readonly accept = 'application/json'
|
|
23
|
-
|
|
24
|
-
readonly inputSchema = createPaymentConfigStripeInputSchema
|
|
25
|
-
readonly outputSchema = createPaymentConfigStripeResponseSchema
|
|
26
|
-
readonly querySchema = undefined
|
|
27
|
-
readonly headersSchema = undefined
|
|
28
|
-
|
|
29
|
-
constructor(input: CreatePaymentConfigStripeInput) {
|
|
30
|
-
super(input)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
getPath(): string {
|
|
34
|
-
return '/payment_configs/stripe'
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
export const deletePaymentConfigStripeInputSchema = z.undefined()
|
|
5
|
-
export const deletePaymentConfigStripeResponseSchema = z.undefined()
|
|
6
|
-
|
|
7
|
-
export class DeletePaymentConfigStripe extends AbstractApiRequest<void, void> {
|
|
8
|
-
readonly method = 'DELETE'
|
|
9
|
-
readonly contentType = 'application/json'
|
|
10
|
-
readonly accept = 'application/json'
|
|
11
|
-
|
|
12
|
-
readonly inputSchema = deletePaymentConfigStripeInputSchema
|
|
13
|
-
readonly outputSchema = deletePaymentConfigStripeResponseSchema
|
|
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/stripe/${this.paymentConfigId}`
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
import { PaymentConfigStripeDetails, paymentConfigStripeDetailsSchema } from '../../../models'
|
|
5
|
-
|
|
6
|
-
export const getPaymentConfigStripeDetailsInputSchema = z.undefined()
|
|
7
|
-
|
|
8
|
-
export const getPaymentConfigStripeDetailsResponseSchema = paymentConfigStripeDetailsSchema
|
|
9
|
-
export type GetPaymentConfigStripeDetailsResponse = PaymentConfigStripeDetails
|
|
10
|
-
|
|
11
|
-
export class GetPaymentConfigStripeDetails extends AbstractApiRequest<
|
|
12
|
-
void,
|
|
13
|
-
GetPaymentConfigStripeDetailsResponse
|
|
14
|
-
> {
|
|
15
|
-
readonly method = 'GET'
|
|
16
|
-
readonly contentType = 'application/json'
|
|
17
|
-
readonly accept = 'application/json'
|
|
18
|
-
readonly inputSchema = getPaymentConfigStripeDetailsInputSchema
|
|
19
|
-
readonly outputSchema = getPaymentConfigStripeDetailsResponseSchema
|
|
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/stripe/${this.paymentConfigId}`
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,53 +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
|
-
PaymentConfigsQueryParams,
|
|
12
|
-
paymentConfigsQuerySchema,
|
|
13
|
-
PaymentConfigStripe,
|
|
14
|
-
paymentConfigStripeSchema,
|
|
15
|
-
} from '../../../models'
|
|
16
|
-
|
|
17
|
-
export type GetPaymentConfigStripeListQueryParams = PaymentConfigsQueryParams
|
|
18
|
-
|
|
19
|
-
export const getPaymentConfigStripeListResponseSchema =
|
|
20
|
-
createPaginatedSchema(paymentConfigStripeSchema)
|
|
21
|
-
export type GetPaymentConfigStripeListResponse = z.infer<
|
|
22
|
-
typeof getPaymentConfigStripeListResponseSchema
|
|
23
|
-
>
|
|
24
|
-
|
|
25
|
-
export const getPaymentConfigStripeListInputSchema = z.undefined()
|
|
26
|
-
|
|
27
|
-
export class GetPaymentConfigStripeList extends AbstractApiRequest<
|
|
28
|
-
void,
|
|
29
|
-
GetPaymentConfigStripeListResponse,
|
|
30
|
-
GetPaymentConfigStripeListQueryParams
|
|
31
|
-
> {
|
|
32
|
-
readonly method = 'GET'
|
|
33
|
-
readonly contentType = 'application/json'
|
|
34
|
-
readonly accept = 'application/json'
|
|
35
|
-
|
|
36
|
-
readonly inputSchema = getPaymentConfigStripeListInputSchema
|
|
37
|
-
readonly outputSchema = getPaymentConfigStripeListResponseSchema
|
|
38
|
-
readonly querySchema = paymentConfigsQuerySchema
|
|
39
|
-
readonly headersSchema = undefined
|
|
40
|
-
|
|
41
|
-
constructor(options?: { query?: GetPaymentConfigStripeListQueryParams }) {
|
|
42
|
-
super(undefined, options)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
getPath(): string {
|
|
46
|
-
return '/payment_configs/stripe'
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
parseResponse(data: unknown, rawResponse: AxiosResponse): Paginated<PaymentConfigStripe> {
|
|
50
|
-
const payments = z.array(paymentConfigStripeSchema).parse(data)
|
|
51
|
-
return this.validateOutput({ data: payments, pagination: responseToPagination(rawResponse) })
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
PaymentConfigStripeDetails,
|
|
6
|
-
paymentConfigStripeDetailsSchema,
|
|
7
|
-
writablePaymentConfigStripeSchema,
|
|
8
|
-
} from '../../../models'
|
|
9
|
-
|
|
10
|
-
export const updatePaymentConfigStripeInputSchema = writablePaymentConfigStripeSchema
|
|
11
|
-
.omit({
|
|
12
|
-
pointOfSale: true,
|
|
13
|
-
})
|
|
14
|
-
.partial()
|
|
15
|
-
export type UpdatePaymentConfigStripeInput = z.infer<typeof updatePaymentConfigStripeInputSchema>
|
|
16
|
-
|
|
17
|
-
export const updatePaymentConfigStripeResponseSchema = paymentConfigStripeDetailsSchema
|
|
18
|
-
export type UpdatePaymentConfigStripeResponse = PaymentConfigStripeDetails
|
|
19
|
-
|
|
20
|
-
export class UpdatePaymentConfigStripe extends AbstractApiRequest<
|
|
21
|
-
UpdatePaymentConfigStripeInput,
|
|
22
|
-
UpdatePaymentConfigStripeResponse
|
|
23
|
-
> {
|
|
24
|
-
readonly method = 'PATCH'
|
|
25
|
-
readonly contentType = 'application/merge-patch+json'
|
|
26
|
-
readonly accept = 'application/json'
|
|
27
|
-
|
|
28
|
-
readonly inputSchema = updatePaymentConfigStripeInputSchema
|
|
29
|
-
readonly outputSchema = updatePaymentConfigStripeResponseSchema
|
|
30
|
-
readonly querySchema = undefined
|
|
31
|
-
readonly headersSchema = undefined
|
|
32
|
-
|
|
33
|
-
private readonly paymentConfigId: string
|
|
34
|
-
|
|
35
|
-
constructor(paymentConfigId: string, input: UpdatePaymentConfigStripeInput) {
|
|
36
|
-
super(input)
|
|
37
|
-
this.paymentConfigId = paymentConfigId
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
getPath(): string {
|
|
41
|
-
return `/payment_configs/stripe/${this.paymentConfigId}`
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
export const deletePaymentInputSchema = z.undefined()
|
|
5
|
-
export const deletePaymentResponseSchema = z.undefined()
|
|
6
|
-
|
|
7
|
-
export class DeletePayment extends AbstractApiRequest<void, void> {
|
|
8
|
-
readonly method = 'DELETE'
|
|
9
|
-
readonly contentType = 'application/json'
|
|
10
|
-
readonly accept = 'application/json'
|
|
11
|
-
|
|
12
|
-
readonly inputSchema = deletePaymentInputSchema
|
|
13
|
-
readonly outputSchema = deletePaymentResponseSchema
|
|
14
|
-
readonly querySchema = undefined
|
|
15
|
-
readonly headersSchema = undefined
|
|
16
|
-
|
|
17
|
-
private readonly paymentId: string
|
|
18
|
-
|
|
19
|
-
constructor(paymentId: string) {
|
|
20
|
-
super()
|
|
21
|
-
this.paymentId = paymentId
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
getPath(): string {
|
|
25
|
-
return `/payments/${this.paymentId}`
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
import { PaymentDetails, paymentDetailsSchema } from '../../models'
|
|
5
|
-
|
|
6
|
-
export const getPaymentDetailsInputSchema = z.undefined()
|
|
7
|
-
|
|
8
|
-
export const getPaymentDetailsResponseSchema = paymentDetailsSchema
|
|
9
|
-
export type GetPaymentDetailsResponse = PaymentDetails
|
|
10
|
-
|
|
11
|
-
export class GetPaymentDetails extends AbstractApiRequest<void, GetPaymentDetailsResponse> {
|
|
12
|
-
readonly method = 'GET'
|
|
13
|
-
readonly contentType = 'application/json'
|
|
14
|
-
readonly accept = 'application/json'
|
|
15
|
-
readonly inputSchema = getPaymentDetailsInputSchema
|
|
16
|
-
readonly outputSchema = getPaymentDetailsResponseSchema
|
|
17
|
-
readonly querySchema = undefined
|
|
18
|
-
readonly headersSchema = undefined
|
|
19
|
-
|
|
20
|
-
private readonly paymentId: string
|
|
21
|
-
|
|
22
|
-
constructor(paymentId: string) {
|
|
23
|
-
super()
|
|
24
|
-
this.paymentId = paymentId
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
getPath(): string {
|
|
28
|
-
return `/payments/${this.paymentId}`
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,45 +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 { Payment, PaymentQueryParams, paymentQuerySchema, paymentSchema } from '../../models'
|
|
11
|
-
|
|
12
|
-
export type GetPaymentsQueryParams = PaymentQueryParams
|
|
13
|
-
|
|
14
|
-
export const getPaymentsResponseSchema = createPaginatedSchema(paymentSchema)
|
|
15
|
-
export type GetPaymentsResponse = z.infer<typeof getPaymentsResponseSchema>
|
|
16
|
-
|
|
17
|
-
export const getPaymentsInputSchema = z.undefined()
|
|
18
|
-
|
|
19
|
-
export class GetPayments extends AbstractApiRequest<
|
|
20
|
-
void,
|
|
21
|
-
GetPaymentsResponse,
|
|
22
|
-
GetPaymentsQueryParams
|
|
23
|
-
> {
|
|
24
|
-
readonly method = 'GET'
|
|
25
|
-
readonly contentType = 'application/json'
|
|
26
|
-
readonly accept = 'application/json'
|
|
27
|
-
|
|
28
|
-
readonly inputSchema = getPaymentsInputSchema
|
|
29
|
-
readonly outputSchema = getPaymentsResponseSchema
|
|
30
|
-
readonly querySchema = paymentQuerySchema
|
|
31
|
-
readonly headersSchema = undefined
|
|
32
|
-
|
|
33
|
-
constructor(options?: { query?: GetPaymentsQueryParams }) {
|
|
34
|
-
super(undefined, options)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
getPath(): string {
|
|
38
|
-
return '/payments'
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
parseResponse(data: unknown, rawResponse: AxiosResponse): Paginated<Payment> {
|
|
42
|
-
const payments = z.array(paymentSchema).parse(data)
|
|
43
|
-
return this.validateOutput({ data: payments, pagination: responseToPagination(rawResponse) })
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,53 +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 { Payment, PaymentQueryParams, paymentQuerySchema, paymentSchema } from '../../models'
|
|
11
|
-
|
|
12
|
-
export type GetPaymentsForPaymentConfigQueryParams = PaymentQueryParams
|
|
13
|
-
|
|
14
|
-
export const getPaymentsForPaymentConfigResponseSchema = createPaginatedSchema(paymentSchema)
|
|
15
|
-
export type GetPaymentsForPaymentConfigResponse = z.infer<
|
|
16
|
-
typeof getPaymentsForPaymentConfigResponseSchema
|
|
17
|
-
>
|
|
18
|
-
|
|
19
|
-
export const getPaymentsForPaymentConfigInputSchema = z.undefined()
|
|
20
|
-
|
|
21
|
-
export class GetPaymentsForPaymentConfig extends AbstractApiRequest<
|
|
22
|
-
void,
|
|
23
|
-
GetPaymentsForPaymentConfigResponse,
|
|
24
|
-
GetPaymentsForPaymentConfigQueryParams
|
|
25
|
-
> {
|
|
26
|
-
readonly method = 'GET'
|
|
27
|
-
readonly contentType = 'application/json'
|
|
28
|
-
readonly accept = 'application/json'
|
|
29
|
-
|
|
30
|
-
readonly inputSchema = getPaymentsForPaymentConfigInputSchema
|
|
31
|
-
readonly outputSchema = getPaymentsForPaymentConfigResponseSchema
|
|
32
|
-
readonly querySchema = paymentQuerySchema
|
|
33
|
-
readonly headersSchema = undefined
|
|
34
|
-
|
|
35
|
-
private readonly paymentConfigId: string
|
|
36
|
-
|
|
37
|
-
constructor(
|
|
38
|
-
paymentConfigId: string,
|
|
39
|
-
options?: { query?: GetPaymentsForPaymentConfigQueryParams },
|
|
40
|
-
) {
|
|
41
|
-
super(undefined, options)
|
|
42
|
-
this.paymentConfigId = paymentConfigId
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
getPath(): string {
|
|
46
|
-
return `/payment_configs/${this.paymentConfigId}/payments`
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
parseResponse(data: unknown, rawResponse: AxiosResponse): Paginated<Payment> {
|
|
50
|
-
const payments = z.array(paymentSchema).parse(data)
|
|
51
|
-
return this.validateOutput({ data: payments, pagination: responseToPagination(rawResponse) })
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { AbstractApiRequest } from '@deliverart/sdk-js-core'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
import { PaymentDetails, paymentDetailsSchema, writablePaymentSchema } from '../../models'
|
|
5
|
-
|
|
6
|
-
export const updatePaymentInputSchema = writablePaymentSchema.partial()
|
|
7
|
-
export type UpdatePaymentInput = z.infer<typeof updatePaymentInputSchema>
|
|
8
|
-
|
|
9
|
-
export const updatePaymentResponseSchema = paymentDetailsSchema
|
|
10
|
-
export type UpdatePaymentResponse = PaymentDetails
|
|
11
|
-
|
|
12
|
-
export class UpdatePayment extends AbstractApiRequest<UpdatePaymentInput, UpdatePaymentResponse> {
|
|
13
|
-
readonly method = 'PATCH'
|
|
14
|
-
readonly contentType = 'application/merge-patch+json'
|
|
15
|
-
readonly accept = 'application/json'
|
|
16
|
-
|
|
17
|
-
readonly inputSchema = updatePaymentInputSchema
|
|
18
|
-
readonly outputSchema = updatePaymentResponseSchema
|
|
19
|
-
readonly querySchema = undefined
|
|
20
|
-
readonly headersSchema = undefined
|
|
21
|
-
|
|
22
|
-
private readonly paymentId: string
|
|
23
|
-
|
|
24
|
-
constructor(paymentId: string, input: UpdatePaymentInput) {
|
|
25
|
-
super(input)
|
|
26
|
-
this.paymentId = paymentId
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
getPath(): string {
|
|
30
|
-
return `/payments/${this.paymentId}`
|
|
31
|
-
}
|
|
32
|
-
}
|