@blocklet/payment-types 1.20.5 → 1.20.6
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/checkout-session.d.ts +22 -0
- package/lib/index.d.ts +3 -0
- package/lib/payout.d.ts +6 -0
- package/lib/product-vendor.d.ts +96 -0
- package/lib/product.d.ts +10 -0
- package/package.json +2 -2
|
@@ -103,6 +103,27 @@ export declare class CheckoutSession extends Model<InferAttributes<CheckoutSessi
|
|
|
103
103
|
nft_mint_settings?: NftMintSettings;
|
|
104
104
|
nft_mint_details?: NftMintDetails;
|
|
105
105
|
cross_sell_behavior?: LiteralUnion<'auto' | 'required', string>;
|
|
106
|
+
fulfillment_status?: LiteralUnion<'pending' | 'processing' | 'completed' | 'failed' | 'cancelled' | 'max_retries_exceeded' | 'return_requested' | 'sent', string>;
|
|
107
|
+
vendor_info?: Array<{
|
|
108
|
+
vendor_id: string;
|
|
109
|
+
vendor_key: string;
|
|
110
|
+
order_id: string;
|
|
111
|
+
status: 'pending' | 'processing' | 'completed' | 'failed' | 'cancelled' | 'max_retries_exceeded' | 'return_requested' | 'sent';
|
|
112
|
+
service_url?: string;
|
|
113
|
+
app_url?: string;
|
|
114
|
+
error_message?: string;
|
|
115
|
+
amount: string;
|
|
116
|
+
attempts?: number;
|
|
117
|
+
lastAttemptAt?: string;
|
|
118
|
+
completedAt?: string;
|
|
119
|
+
commissionAmount?: string;
|
|
120
|
+
returnRequest?: {
|
|
121
|
+
reason: string;
|
|
122
|
+
requestedAt: string;
|
|
123
|
+
status: 'pending' | 'accepted' | 'rejected';
|
|
124
|
+
returnDetails?: string;
|
|
125
|
+
};
|
|
126
|
+
}>;
|
|
106
127
|
created_at: CreationOptional<Date>;
|
|
107
128
|
created_via: LiteralUnion<'api' | 'dashboard' | 'portal', string>;
|
|
108
129
|
updated_at: CreationOptional<Date>;
|
|
@@ -290,5 +311,6 @@ export declare class CheckoutSession extends Model<InferAttributes<CheckoutSessi
|
|
|
290
311
|
static cleanupExpiredSessions(): Promise<number>;
|
|
291
312
|
isImmutable(): boolean;
|
|
292
313
|
static findBySubscriptionId(subscriptionId: string, options?: FindOptions<CheckoutSession>): Promise<CheckoutSession | null>;
|
|
314
|
+
static findByPaymentIntentId(paymentIntentId: string): Promise<CheckoutSession | null>;
|
|
293
315
|
}
|
|
294
316
|
export type TCheckoutSession = InferAttributes<CheckoutSession>;
|
package/lib/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ import { CreditTransaction, TCreditTransaction } from './credit-transaction';
|
|
|
32
32
|
import { Meter, TMeter } from './meter';
|
|
33
33
|
import { MeterEvent, TMeterEvent } from './meter-event';
|
|
34
34
|
import { AutoRechargeConfig } from './auto-recharge-config';
|
|
35
|
+
import { ProductVendor } from './product-vendor';
|
|
35
36
|
declare const models: {
|
|
36
37
|
CheckoutSession: typeof CheckoutSession;
|
|
37
38
|
Coupon: typeof Coupon;
|
|
@@ -66,6 +67,7 @@ declare const models: {
|
|
|
66
67
|
Meter: typeof Meter;
|
|
67
68
|
MeterEvent: typeof MeterEvent;
|
|
68
69
|
AutoRechargeConfig: typeof AutoRechargeConfig;
|
|
70
|
+
ProductVendor: typeof ProductVendor;
|
|
69
71
|
};
|
|
70
72
|
export declare function initialize(sequelize: any): void;
|
|
71
73
|
export default models;
|
|
@@ -103,6 +105,7 @@ export * from './credit-transaction';
|
|
|
103
105
|
export * from './meter';
|
|
104
106
|
export * from './meter-event';
|
|
105
107
|
export * from './auto-recharge-config';
|
|
108
|
+
export * from './product-vendor';
|
|
106
109
|
export type TPriceExpanded = TPrice & {
|
|
107
110
|
object: 'price';
|
|
108
111
|
product: TProduct;
|
package/lib/payout.d.ts
CHANGED
|
@@ -15,6 +15,12 @@ export declare class Payout extends Model<InferAttributes<Payout>, InferCreation
|
|
|
15
15
|
payment_intent_id: string;
|
|
16
16
|
payment_method_id: string;
|
|
17
17
|
metadata?: Record<string, any>;
|
|
18
|
+
vendor_info?: {
|
|
19
|
+
vendor_id: string;
|
|
20
|
+
app_pid?: string;
|
|
21
|
+
order_id: string;
|
|
22
|
+
commission_amount: string;
|
|
23
|
+
};
|
|
18
24
|
status: LiteralUnion<'pending' | 'paid' | 'failed' | 'canceled' | 'in_transit', string>;
|
|
19
25
|
failure_message?: string;
|
|
20
26
|
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>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { CreationOptional, DataTypes, InferAttributes, InferCreationAttributes, Model } from 'sequelize';
|
|
2
|
+
export declare const nextProductVendorId: (size?: number) => string;
|
|
3
|
+
export declare class ProductVendor extends Model<InferAttributes<ProductVendor>, InferCreationAttributes<ProductVendor>> {
|
|
4
|
+
id: CreationOptional<string>;
|
|
5
|
+
vendor_key: string;
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
app_url: string;
|
|
9
|
+
webhook_path?: string;
|
|
10
|
+
default_commission_rate: number;
|
|
11
|
+
default_commission_type: 'percentage' | 'fixed_amount';
|
|
12
|
+
order_create_params: Record<string, any>;
|
|
13
|
+
app_pid?: string;
|
|
14
|
+
app_logo?: string;
|
|
15
|
+
status: 'active' | 'inactive';
|
|
16
|
+
metadata: Record<string, any>;
|
|
17
|
+
created_by: string;
|
|
18
|
+
created_at: CreationOptional<Date>;
|
|
19
|
+
updated_at: CreationOptional<Date>;
|
|
20
|
+
static readonly GENESIS_ATTRIBUTES: {
|
|
21
|
+
id: {
|
|
22
|
+
type: DataTypes.StringDataType;
|
|
23
|
+
primaryKey: boolean;
|
|
24
|
+
allowNull: boolean;
|
|
25
|
+
defaultValue: (size?: number) => string;
|
|
26
|
+
};
|
|
27
|
+
vendor_key: {
|
|
28
|
+
type: DataTypes.StringDataType;
|
|
29
|
+
allowNull: boolean;
|
|
30
|
+
unique: boolean;
|
|
31
|
+
};
|
|
32
|
+
name: {
|
|
33
|
+
type: DataTypes.StringDataType;
|
|
34
|
+
allowNull: boolean;
|
|
35
|
+
};
|
|
36
|
+
description: {
|
|
37
|
+
type: DataTypes.TextDataTypeConstructor;
|
|
38
|
+
allowNull: boolean;
|
|
39
|
+
};
|
|
40
|
+
app_url: {
|
|
41
|
+
type: DataTypes.StringDataType;
|
|
42
|
+
allowNull: boolean;
|
|
43
|
+
};
|
|
44
|
+
webhook_path: {
|
|
45
|
+
type: DataTypes.StringDataType;
|
|
46
|
+
allowNull: boolean;
|
|
47
|
+
};
|
|
48
|
+
default_commission_rate: {
|
|
49
|
+
type: DataTypes.DecimalDataType;
|
|
50
|
+
allowNull: boolean;
|
|
51
|
+
};
|
|
52
|
+
default_commission_type: {
|
|
53
|
+
type: DataTypes.EnumDataType<"percentage" | "fixed_amount">;
|
|
54
|
+
allowNull: boolean;
|
|
55
|
+
};
|
|
56
|
+
order_create_params: {
|
|
57
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
58
|
+
allowNull: boolean;
|
|
59
|
+
defaultValue: {};
|
|
60
|
+
};
|
|
61
|
+
app_pid: {
|
|
62
|
+
type: DataTypes.StringDataType;
|
|
63
|
+
allowNull: boolean;
|
|
64
|
+
};
|
|
65
|
+
app_logo: {
|
|
66
|
+
type: DataTypes.StringDataType;
|
|
67
|
+
allowNull: boolean;
|
|
68
|
+
};
|
|
69
|
+
status: {
|
|
70
|
+
type: DataTypes.EnumDataType<"active" | "inactive">;
|
|
71
|
+
allowNull: boolean;
|
|
72
|
+
defaultValue: string;
|
|
73
|
+
};
|
|
74
|
+
metadata: {
|
|
75
|
+
type: DataTypes.AbstractDataTypeConstructor;
|
|
76
|
+
allowNull: boolean;
|
|
77
|
+
defaultValue: {};
|
|
78
|
+
};
|
|
79
|
+
created_by: {
|
|
80
|
+
type: DataTypes.StringDataType;
|
|
81
|
+
allowNull: boolean;
|
|
82
|
+
};
|
|
83
|
+
created_at: {
|
|
84
|
+
type: DataTypes.DateDataTypeConstructor;
|
|
85
|
+
defaultValue: DataTypes.AbstractDataTypeConstructor;
|
|
86
|
+
allowNull: boolean;
|
|
87
|
+
};
|
|
88
|
+
updated_at: {
|
|
89
|
+
type: DataTypes.DateDataTypeConstructor;
|
|
90
|
+
defaultValue: DataTypes.AbstractDataTypeConstructor;
|
|
91
|
+
allowNull: boolean;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
static initialize(sequelize: any): void;
|
|
95
|
+
}
|
|
96
|
+
export type TProductVendor = InferAttributes<ProductVendor>;
|
package/lib/product.d.ts
CHANGED
|
@@ -22,6 +22,16 @@ export declare class Product extends Model<InferAttributes<Product>, InferCreati
|
|
|
22
22
|
cross_sell?: {
|
|
23
23
|
cross_sells_to_id: string;
|
|
24
24
|
};
|
|
25
|
+
vendor_config?: Array<{
|
|
26
|
+
vendor_id: string;
|
|
27
|
+
vendor_key: string;
|
|
28
|
+
name?: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
commission_rate?: number;
|
|
31
|
+
commission_type?: 'percentage' | 'fixed_amount';
|
|
32
|
+
amount?: string;
|
|
33
|
+
custom_params?: Record<string, any>;
|
|
34
|
+
}>;
|
|
25
35
|
created_at: CreationOptional<Date>;
|
|
26
36
|
created_via: LiteralUnion<'api' | 'dashboard' | 'portal' | 'donation', string>;
|
|
27
37
|
updated_at: CreationOptional<Date>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/payment-types",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.6",
|
|
4
4
|
"description": "Typings for Payment Kit SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"types",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"sequelize": "^6.37.7",
|
|
49
49
|
"type-fest": "^4.41.0"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "d04ed7906bd1e13240198623aa0d4eef4db8886e"
|
|
52
52
|
}
|