@blocklet/payment-types 1.13.130 → 1.13.132

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/index.d.ts CHANGED
@@ -14,6 +14,7 @@ import { Price, TPrice } from './price';
14
14
  import { PricingTable, TPricingTable } from './pricing-table';
15
15
  import { Product, TProduct } from './product';
16
16
  import { PromotionCode } from './promotion-code';
17
+ import { Refund, TRefund } from './refund';
17
18
  import { SetupIntent, TSetupIntent } from './setup-intent';
18
19
  import { Subscription, TSubscription } from './subscription';
19
20
  import { SubscriptionItem, TSubscriptionItem } from './subscription-item';
@@ -38,6 +39,7 @@ declare const models: {
38
39
  PricingTable: typeof PricingTable;
39
40
  Product: typeof Product;
40
41
  PromotionCode: typeof PromotionCode;
42
+ Refund: typeof Refund;
41
43
  SetupIntent: typeof SetupIntent;
42
44
  Subscription: typeof Subscription;
43
45
  SubscriptionItem: typeof SubscriptionItem;
@@ -65,6 +67,7 @@ export * from './price';
65
67
  export * from './pricing-table';
66
68
  export * from './product';
67
69
  export * from './promotion-code';
70
+ export * from './refund';
68
71
  export * from './setup-intent';
69
72
  export * from './subscription';
70
73
  export * from './subscription-item';
@@ -194,3 +197,11 @@ export type TPricingTableExpanded = TPricingTable & {
194
197
  items: TPricingTableItem[];
195
198
  currency: TPaymentCurrency;
196
199
  };
200
+ export type TRefundExpanded = TRefund & {
201
+ customer: TCustomer;
202
+ paymentCurrency: TPaymentCurrency;
203
+ paymentMethod?: TPaymentMethod;
204
+ paymentIntent: TPaymentIntent;
205
+ invoice?: TInvoice;
206
+ subscription?: TSubscription;
207
+ };
@@ -0,0 +1,136 @@
1
+ import { CreationOptional, DataTypes, InferAttributes, InferCreationAttributes, Model } from 'sequelize';
2
+ import type { LiteralUnion } from 'type-fest';
3
+ import type { PaymentDetails, PaymentError } from './types';
4
+ export declare const nextRefundId: (size?: number | undefined) => string;
5
+ export declare class Refund extends Model<InferAttributes<Refund>, InferCreationAttributes<Refund>> {
6
+ id: CreationOptional<string>;
7
+ livemode: boolean;
8
+ description: string;
9
+ amount: string;
10
+ payment_details?: PaymentDetails;
11
+ currency_id: string;
12
+ customer_id: string;
13
+ payment_intent_id: string;
14
+ invoice_id?: string;
15
+ subscription_id?: string;
16
+ metadata?: Record<string, any>;
17
+ status: LiteralUnion<'pending' | 'requires_action' | 'failed' | 'canceled' | 'succeeded', string>;
18
+ reason?: LiteralUnion<'duplicate' | 'requested_by_customer' | 'requested_by_admin' | 'fraudulent' | 'expired_uncaptured_charge', string>;
19
+ failure_reason?: LiteralUnion<'lost_or_stolen_card' | 'expired_or_canceled_card' | 'charge_for_pending_refund_disputed' | 'insufficient_funds' | 'declined' | 'merchant_request' | 'unknown', string>;
20
+ attempt_count: number;
21
+ attempted: boolean;
22
+ next_attempt?: number;
23
+ last_attempt_error?: PaymentError | null;
24
+ starting_balance: string;
25
+ ending_balance: string;
26
+ starting_token_balance?: Record<string, string>;
27
+ ending_token_balance?: Record<string, string>;
28
+ created_at: CreationOptional<Date>;
29
+ updated_at: CreationOptional<Date>;
30
+ static readonly GENESIS_ATTRIBUTES: {
31
+ id: {
32
+ type: DataTypes.StringDataType;
33
+ primaryKey: boolean;
34
+ allowNull: boolean;
35
+ defaultValue: (size?: number | undefined) => string;
36
+ };
37
+ description: {
38
+ type: DataTypes.StringDataType;
39
+ allowNull: boolean;
40
+ };
41
+ livemode: {
42
+ type: DataTypes.AbstractDataTypeConstructor;
43
+ allowNull: boolean;
44
+ };
45
+ amount: {
46
+ type: DataTypes.StringDataType;
47
+ allowNull: boolean;
48
+ };
49
+ payment_details: {
50
+ type: DataTypes.AbstractDataTypeConstructor;
51
+ allowNull: boolean;
52
+ };
53
+ currency_id: {
54
+ type: DataTypes.StringDataType;
55
+ allowNull: boolean;
56
+ };
57
+ customer_id: {
58
+ type: DataTypes.StringDataType;
59
+ allowNull: boolean;
60
+ };
61
+ payment_intent_id: {
62
+ type: DataTypes.StringDataType;
63
+ allowNull: boolean;
64
+ };
65
+ invoice_id: {
66
+ type: DataTypes.StringDataType;
67
+ allowNull: boolean;
68
+ };
69
+ subscription_id: {
70
+ type: DataTypes.StringDataType;
71
+ allowNull: boolean;
72
+ };
73
+ metadata: {
74
+ type: DataTypes.AbstractDataTypeConstructor;
75
+ allowNull: boolean;
76
+ };
77
+ status: {
78
+ type: DataTypes.EnumDataType<"requires_action" | "canceled" | "succeeded" | "pending" | "failed">;
79
+ allowNull: boolean;
80
+ };
81
+ reason: {
82
+ type: DataTypes.EnumDataType<"duplicate" | "requested_by_customer" | "fraudulent" | "requested_by_admin">;
83
+ allowNull: boolean;
84
+ };
85
+ failure_reason: {
86
+ type: DataTypes.EnumDataType<"lost_or_stolen_card" | "expired_or_canceled_card" | "charge_for_pending_refund_disputed" | "insufficient_funds" | "declined" | "merchant_request" | "unknown">;
87
+ allowNull: boolean;
88
+ };
89
+ attempt_count: {
90
+ type: DataTypes.IntegerDataTypeConstructor;
91
+ defaultValue: number;
92
+ };
93
+ attempted: {
94
+ type: DataTypes.AbstractDataTypeConstructor;
95
+ defaultValue: boolean;
96
+ };
97
+ next_attempt: {
98
+ type: DataTypes.IntegerDataTypeConstructor;
99
+ allowNull: boolean;
100
+ };
101
+ last_attempt_error: {
102
+ type: DataTypes.AbstractDataTypeConstructor;
103
+ allowNull: boolean;
104
+ };
105
+ starting_balance: {
106
+ type: DataTypes.StringDataType;
107
+ defaultValue: string;
108
+ };
109
+ ending_balance: {
110
+ type: DataTypes.StringDataType;
111
+ defaultValue: string;
112
+ };
113
+ starting_token_balance: {
114
+ type: DataTypes.AbstractDataTypeConstructor;
115
+ defaultValue: {};
116
+ };
117
+ ending_token_balance: {
118
+ type: DataTypes.AbstractDataTypeConstructor;
119
+ defaultValue: {};
120
+ };
121
+ created_at: {
122
+ type: DataTypes.DateDataTypeConstructor;
123
+ defaultValue: DataTypes.AbstractDataTypeConstructor;
124
+ allowNull: boolean;
125
+ };
126
+ updated_at: {
127
+ type: DataTypes.DateDataTypeConstructor;
128
+ defaultValue: DataTypes.AbstractDataTypeConstructor;
129
+ allowNull: boolean;
130
+ };
131
+ };
132
+ static initialize(sequelize: any): void;
133
+ static associate(models: any): void;
134
+ isImmutable(): boolean;
135
+ }
136
+ export type TRefund = InferAttributes<Refund>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/payment-types",
3
- "version": "1.13.130",
3
+ "version": "1.13.132",
4
4
  "description": "Typings for Payment Kit SDK",
5
5
  "keywords": [
6
6
  "types",
@@ -48,5 +48,5 @@
48
48
  "sequelize": "^6.35.1",
49
49
  "type-fest": "^4.8.3"
50
50
  },
51
- "gitHead": "95aaa56f16ce303e514aa7dde9e542628d7acd2c"
51
+ "gitHead": "d1b6e7bace2743798d22c33f245c32a4c5ba3200"
52
52
  }