@blocklet/payment-types 1.13.210 → 1.13.212
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/lib/customer.d.ts +2 -0
- package/lib/index.d.ts +11 -0
- package/lib/payment-intent.d.ts +2 -1
- package/lib/payment-link.d.ts +2 -1
- package/lib/payout.d.ts +122 -0
- package/lib/refund.d.ts +1 -1
- package/lib/types.d.ts +37 -0
- package/package.json +2 -2
package/lib/customer.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CreationOptional, DataTypes, FindOptions, InferAttributes, InferCreationAttributes, Model } from 'sequelize';
|
|
2
2
|
import type { CustomerAddress, CustomerShipping } from './types';
|
|
3
3
|
export declare const nextCustomerId: (size?: number | undefined) => string;
|
|
4
|
+
export declare const nextInvoicePrefix: (size?: number | undefined) => string;
|
|
4
5
|
export declare class Customer extends Model<InferAttributes<Customer>, InferCreationAttributes<Customer>> {
|
|
5
6
|
id: CreationOptional<string>;
|
|
6
7
|
livemode: boolean;
|
|
@@ -139,5 +140,6 @@ export declare class Customer extends Model<InferAttributes<Customer>, InferCrea
|
|
|
139
140
|
static initialize(sequelize: any): void;
|
|
140
141
|
static associate(models: any): void;
|
|
141
142
|
static findByPkOrDid(id: string, options?: FindOptions<Customer>): Promise<Customer | null>;
|
|
143
|
+
static getInvoicePrefix(): string;
|
|
142
144
|
}
|
|
143
145
|
export type TCustomer = InferAttributes<Customer>;
|
package/lib/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { PaymentCurrency, TPaymentCurrency } from './payment-currency';
|
|
|
11
11
|
import { PaymentIntent, TPaymentIntent } from './payment-intent';
|
|
12
12
|
import { PaymentLink, TPaymentLink } from './payment-link';
|
|
13
13
|
import { PaymentMethod, TPaymentMethod } from './payment-method';
|
|
14
|
+
import { Payout, TPayout } from './payout';
|
|
14
15
|
import { Price, TPrice } from './price';
|
|
15
16
|
import { PricingTable, TPricingTable } from './pricing-table';
|
|
16
17
|
import { Product, TProduct } from './product';
|
|
@@ -35,6 +36,7 @@ declare const models: {
|
|
|
35
36
|
PaymentCurrency: typeof PaymentCurrency;
|
|
36
37
|
PaymentIntent: typeof PaymentIntent;
|
|
37
38
|
PaymentLink: typeof PaymentLink;
|
|
39
|
+
Payout: typeof Payout;
|
|
38
40
|
PaymentMethod: typeof PaymentMethod;
|
|
39
41
|
Price: typeof Price;
|
|
40
42
|
PricingTable: typeof PricingTable;
|
|
@@ -66,6 +68,7 @@ export * from './payment-currency';
|
|
|
66
68
|
export * from './payment-intent';
|
|
67
69
|
export * from './payment-link';
|
|
68
70
|
export * from './payment-method';
|
|
71
|
+
export * from './payout';
|
|
69
72
|
export * from './price';
|
|
70
73
|
export * from './pricing-table';
|
|
71
74
|
export * from './product';
|
|
@@ -120,6 +123,7 @@ export type TCheckoutSessionExpanded = TCheckoutSession & {
|
|
|
120
123
|
payment_link?: TPaymentLink;
|
|
121
124
|
payment_intent?: TPaymentIntent;
|
|
122
125
|
subscription?: TSubscription;
|
|
126
|
+
customer?: TCustomer;
|
|
123
127
|
};
|
|
124
128
|
export type TPaymentIntentExpanded = TPaymentIntent & {
|
|
125
129
|
object: 'payment_intent';
|
|
@@ -208,3 +212,10 @@ export type TRefundExpanded = TRefund & {
|
|
|
208
212
|
invoice?: TInvoice;
|
|
209
213
|
subscription?: TSubscription;
|
|
210
214
|
};
|
|
215
|
+
export type TPayoutExpanded = TPayout & {
|
|
216
|
+
object: 'price';
|
|
217
|
+
paymentCurrency: TPaymentCurrency;
|
|
218
|
+
paymentMethod: TPaymentMethod;
|
|
219
|
+
paymentIntent: TPaymentIntent;
|
|
220
|
+
customer: TCustomer;
|
|
221
|
+
};
|
package/lib/payment-intent.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CreationOptional, DataTypes, InferAttributes, InferCreationAttributes, Model } from 'sequelize';
|
|
2
2
|
import type { LiteralUnion } from 'type-fest';
|
|
3
|
-
import type { GroupedBN, PaymentDetails, PaymentError } from './types';
|
|
3
|
+
import type { GroupedBN, PaymentBeneficiary, PaymentDetails, PaymentError } from './types';
|
|
4
4
|
export declare const nextPaymentIntentId: (size?: number | undefined) => string;
|
|
5
5
|
export declare class PaymentIntent extends Model<InferAttributes<PaymentIntent>, InferCreationAttributes<PaymentIntent>> {
|
|
6
6
|
id: CreationOptional<string>;
|
|
@@ -31,6 +31,7 @@ export declare class PaymentIntent extends Model<InferAttributes<PaymentIntent>,
|
|
|
31
31
|
review?: string;
|
|
32
32
|
payment_details?: PaymentDetails;
|
|
33
33
|
setup_future_usage?: LiteralUnion<'off_session' | 'on_session', string>;
|
|
34
|
+
beneficiaries?: PaymentBeneficiary[];
|
|
34
35
|
created_at: CreationOptional<Date>;
|
|
35
36
|
updated_at: CreationOptional<Date>;
|
|
36
37
|
static readonly GENESIS_ATTRIBUTES: {
|
package/lib/payment-link.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CreationOptional, DataTypes, InferAttributes, InferCreationAttributes, Model } from 'sequelize';
|
|
2
2
|
import type { LiteralUnion } from 'type-fest';
|
|
3
|
-
import type { AfterPayment, CustomField, LineItem, NftMintSettings } from './types';
|
|
3
|
+
import type { AfterPayment, CustomField, DonationSettings, LineItem, NftMintSettings } from './types';
|
|
4
4
|
export declare const nextPaymentLinkId: (size?: number | undefined) => string;
|
|
5
5
|
export declare class PaymentLink extends Model<InferAttributes<PaymentLink>, InferCreationAttributes<PaymentLink>> {
|
|
6
6
|
id: CreationOptional<string>;
|
|
@@ -38,6 +38,7 @@ export declare class PaymentLink extends Model<InferAttributes<PaymentLink>, Inf
|
|
|
38
38
|
};
|
|
39
39
|
nft_mint_settings?: NftMintSettings;
|
|
40
40
|
cross_sell_behavior?: LiteralUnion<'auto' | 'required', string>;
|
|
41
|
+
donation_settings?: DonationSettings;
|
|
41
42
|
metadata?: Record<string, any>;
|
|
42
43
|
created_at: CreationOptional<Date>;
|
|
43
44
|
created_via: LiteralUnion<'api' | 'dashboard' | 'portal', string>;
|
package/lib/payout.d.ts
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { CreationOptional, DataTypes, InferAttributes, InferCreationAttributes, Model } from 'sequelize';
|
|
2
|
+
import type { LiteralUnion } from 'type-fest';
|
|
3
|
+
import type { GroupedBN, PaymentDetails, PaymentError } from './types';
|
|
4
|
+
export declare const nextPayoutId: (size?: number | undefined) => string;
|
|
5
|
+
export declare class Payout extends Model<InferAttributes<Payout>, InferCreationAttributes<Payout>> {
|
|
6
|
+
id: CreationOptional<string>;
|
|
7
|
+
livemode: boolean;
|
|
8
|
+
automatic: boolean;
|
|
9
|
+
description: string;
|
|
10
|
+
destination: string;
|
|
11
|
+
amount: string;
|
|
12
|
+
payment_details?: PaymentDetails;
|
|
13
|
+
currency_id: string;
|
|
14
|
+
customer_id: string;
|
|
15
|
+
payment_intent_id: string;
|
|
16
|
+
payment_method_id: string;
|
|
17
|
+
metadata?: Record<string, any>;
|
|
18
|
+
status: LiteralUnion<'pending' | 'paid' | 'failed' | 'canceled' | 'in_transit', string>;
|
|
19
|
+
failure_message?: string;
|
|
20
|
+
failure_code?: LiteralUnion<'account_closed' | 'account_frozen' | 'bank_account_restricted' | 'bank_ownership_changed' | 'could_not_process' | 'debit_not_authorized' | 'declined' | 'incorrect_account_holder_address' | 'incorrect_account_holder_name' | 'incorrect_account_holder_tax_id' | 'incorrect_account_type' | 'insufficient_funds' | 'invalid_account_number', string>;
|
|
21
|
+
attempt_count: number;
|
|
22
|
+
attempted: boolean;
|
|
23
|
+
next_attempt?: number;
|
|
24
|
+
last_attempt_error?: PaymentError | null;
|
|
25
|
+
created_at: CreationOptional<Date>;
|
|
26
|
+
updated_at: CreationOptional<Date>;
|
|
27
|
+
static readonly GENESIS_ATTRIBUTES: {
|
|
28
|
+
id: {
|
|
29
|
+
type: DataTypes.StringDataType;
|
|
30
|
+
primaryKey: boolean;
|
|
31
|
+
allowNull: boolean;
|
|
32
|
+
defaultValue: (size?: number | undefined) => string;
|
|
33
|
+
};
|
|
34
|
+
livemode: {
|
|
35
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
36
|
+
allowNull: boolean;
|
|
37
|
+
};
|
|
38
|
+
automatic: {
|
|
39
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
40
|
+
allowNull: boolean;
|
|
41
|
+
};
|
|
42
|
+
description: {
|
|
43
|
+
type: DataTypes.StringDataType;
|
|
44
|
+
allowNull: boolean;
|
|
45
|
+
};
|
|
46
|
+
amount: {
|
|
47
|
+
type: DataTypes.StringDataType;
|
|
48
|
+
allowNull: boolean;
|
|
49
|
+
};
|
|
50
|
+
destination: {
|
|
51
|
+
type: DataTypes.StringDataType;
|
|
52
|
+
allowNull: boolean;
|
|
53
|
+
};
|
|
54
|
+
payment_details: {
|
|
55
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
56
|
+
allowNull: boolean;
|
|
57
|
+
};
|
|
58
|
+
currency_id: {
|
|
59
|
+
type: DataTypes.StringDataType;
|
|
60
|
+
allowNull: boolean;
|
|
61
|
+
};
|
|
62
|
+
customer_id: {
|
|
63
|
+
type: DataTypes.StringDataType;
|
|
64
|
+
allowNull: boolean;
|
|
65
|
+
};
|
|
66
|
+
payment_intent_id: {
|
|
67
|
+
type: DataTypes.StringDataType;
|
|
68
|
+
allowNull: boolean;
|
|
69
|
+
};
|
|
70
|
+
payment_method_id: {
|
|
71
|
+
type: DataTypes.StringDataType;
|
|
72
|
+
allowNull: boolean;
|
|
73
|
+
};
|
|
74
|
+
metadata: {
|
|
75
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
76
|
+
allowNull: boolean;
|
|
77
|
+
};
|
|
78
|
+
status: {
|
|
79
|
+
type: DataTypes.EnumDataType<"paid" | "canceled" | "pending" | "failed" | "in_transit">;
|
|
80
|
+
allowNull: boolean;
|
|
81
|
+
};
|
|
82
|
+
failure_message: {
|
|
83
|
+
type: DataTypes.StringDataType;
|
|
84
|
+
allowNull: boolean;
|
|
85
|
+
};
|
|
86
|
+
failure_code: {
|
|
87
|
+
type: DataTypes.EnumDataType<"account_closed" | "account_frozen" | "bank_account_restricted" | "bank_ownership_changed" | "could_not_process" | "debit_not_authorized" | "declined" | "incorrect_account_holder_address" | "incorrect_account_holder_name" | "incorrect_account_holder_tax_id" | "incorrect_account_type" | "insufficient_funds" | "invalid_account_number">;
|
|
88
|
+
allowNull: boolean;
|
|
89
|
+
};
|
|
90
|
+
attempt_count: {
|
|
91
|
+
type: DataTypes.IntegerDataTypeConstructor;
|
|
92
|
+
defaultValue: number;
|
|
93
|
+
};
|
|
94
|
+
attempted: {
|
|
95
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
96
|
+
defaultValue: boolean;
|
|
97
|
+
};
|
|
98
|
+
next_attempt: {
|
|
99
|
+
type: DataTypes.IntegerDataTypeConstructor;
|
|
100
|
+
allowNull: boolean;
|
|
101
|
+
};
|
|
102
|
+
last_attempt_error: {
|
|
103
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
104
|
+
allowNull: boolean;
|
|
105
|
+
};
|
|
106
|
+
created_at: {
|
|
107
|
+
type: DataTypes.DateDataTypeConstructor;
|
|
108
|
+
defaultValue: DataTypes.AbstractDataTypeConstructor;
|
|
109
|
+
allowNull: boolean;
|
|
110
|
+
};
|
|
111
|
+
updated_at: {
|
|
112
|
+
type: DataTypes.DateDataTypeConstructor;
|
|
113
|
+
defaultValue: DataTypes.AbstractDataTypeConstructor;
|
|
114
|
+
allowNull: boolean;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
static initialize(sequelize: any): void;
|
|
118
|
+
static associate(models: any): void;
|
|
119
|
+
isImmutable(): boolean;
|
|
120
|
+
static getPayoutAmountByCustomer(customerId: string, status?: string): Promise<GroupedBN>;
|
|
121
|
+
}
|
|
122
|
+
export type TPayout = InferAttributes<Payout>;
|
package/lib/refund.d.ts
CHANGED
|
@@ -84,7 +84,7 @@ export declare class Refund extends Model<InferAttributes<Refund>, InferCreation
|
|
|
84
84
|
allowNull: boolean;
|
|
85
85
|
};
|
|
86
86
|
failure_reason: {
|
|
87
|
-
type: DataTypes.EnumDataType<"
|
|
87
|
+
type: DataTypes.EnumDataType<"declined" | "insufficient_funds" | "lost_or_stolen_card" | "expired_or_canceled_card" | "charge_for_pending_refund_disputed" | "merchant_request" | "unknown">;
|
|
88
88
|
allowNull: boolean;
|
|
89
89
|
};
|
|
90
90
|
attempt_count: {
|
package/lib/types.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ export type CustomUnitAmount = {
|
|
|
50
50
|
maximum: string;
|
|
51
51
|
minimum: string;
|
|
52
52
|
preset: string;
|
|
53
|
+
presets: string[];
|
|
53
54
|
};
|
|
54
55
|
export type PriceTier = {
|
|
55
56
|
flat_amount?: number;
|
|
@@ -138,6 +139,7 @@ export type LineItem = {
|
|
|
138
139
|
};
|
|
139
140
|
upsell_price_id?: string;
|
|
140
141
|
cross_sell?: boolean;
|
|
142
|
+
custom_amount?: string;
|
|
141
143
|
};
|
|
142
144
|
export type InvoiceData = {
|
|
143
145
|
description?: string;
|
|
@@ -243,6 +245,41 @@ export type PaymentDetails = {
|
|
|
243
245
|
confirmations: number;
|
|
244
246
|
};
|
|
245
247
|
};
|
|
248
|
+
export type PaymentBeneficiary = {
|
|
249
|
+
address: string;
|
|
250
|
+
share: string;
|
|
251
|
+
memo?: string;
|
|
252
|
+
};
|
|
253
|
+
export type DonationSettings = {
|
|
254
|
+
target: string;
|
|
255
|
+
title: string;
|
|
256
|
+
description: string;
|
|
257
|
+
reference: string;
|
|
258
|
+
beneficiaries: PaymentBeneficiary[];
|
|
259
|
+
amount: {
|
|
260
|
+
presets?: string[];
|
|
261
|
+
preset?: string;
|
|
262
|
+
minimum?: string;
|
|
263
|
+
maximum?: string;
|
|
264
|
+
custom?: boolean;
|
|
265
|
+
};
|
|
266
|
+
message?: {
|
|
267
|
+
success?: string;
|
|
268
|
+
summary?: string;
|
|
269
|
+
};
|
|
270
|
+
appearance: {
|
|
271
|
+
button: {
|
|
272
|
+
text: any;
|
|
273
|
+
icon?: any;
|
|
274
|
+
size?: string;
|
|
275
|
+
color?: string;
|
|
276
|
+
variant?: string;
|
|
277
|
+
};
|
|
278
|
+
history: {
|
|
279
|
+
variant: string;
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
};
|
|
246
283
|
export type NftMintSettings = {
|
|
247
284
|
enabled: boolean;
|
|
248
285
|
behavior?: LiteralUnion<'per_customer' | 'per_checkout_session', string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/payment-types",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.212",
|
|
4
4
|
"description": "Typings for Payment Kit SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"types",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"sequelize": "^6.36.0",
|
|
49
49
|
"type-fest": "^4.10.2"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "942de3b017723af85a6c271a7e4ddd35443bc84d"
|
|
52
52
|
}
|