@blocklet/payment-types 1.18.29 → 1.18.31
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 +4 -0
- package/lib/index.d.ts +1 -0
- package/lib/payment-link.d.ts +1 -0
- package/lib/subscription.d.ts +2 -6
- package/lib/types.d.ts +30 -1
- package/package.json +2 -2
|
@@ -12,6 +12,9 @@ export declare class CheckoutSession extends Model<InferAttributes<CheckoutSessi
|
|
|
12
12
|
customer_did?: string;
|
|
13
13
|
payment_link_id?: string;
|
|
14
14
|
subscription_id?: string;
|
|
15
|
+
enable_subscription_grouping?: boolean;
|
|
16
|
+
subscription_groups?: Record<string, string>;
|
|
17
|
+
success_subscription_count?: number;
|
|
15
18
|
recovered_from?: string;
|
|
16
19
|
payment_intent_id?: string;
|
|
17
20
|
setup_intent_id?: string;
|
|
@@ -285,5 +288,6 @@ export declare class CheckoutSession extends Model<InferAttributes<CheckoutSessi
|
|
|
285
288
|
static findByPkOrClientRefId(id: string, options?: FindOptions<CheckoutSession>): Promise<CheckoutSession | null>;
|
|
286
289
|
static cleanupExpiredSessions(): Promise<number>;
|
|
287
290
|
isImmutable(): boolean;
|
|
291
|
+
static findBySubscriptionId(subscriptionId: string, options?: FindOptions<CheckoutSession>): Promise<CheckoutSession | null>;
|
|
288
292
|
}
|
|
289
293
|
export type TCheckoutSession = InferAttributes<CheckoutSession>;
|
package/lib/index.d.ts
CHANGED
|
@@ -131,6 +131,7 @@ export type TCheckoutSessionExpanded = TCheckoutSession & {
|
|
|
131
131
|
payment_intent?: TPaymentIntent;
|
|
132
132
|
subscription?: TSubscription;
|
|
133
133
|
customer?: TCustomer;
|
|
134
|
+
subscriptions?: TSubscription[];
|
|
134
135
|
};
|
|
135
136
|
export type TPaymentIntentExpanded = TPaymentIntent & {
|
|
136
137
|
object: 'payment_intent';
|
package/lib/payment-link.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export declare class PaymentLink extends Model<InferAttributes<PaymentLink>, Inf
|
|
|
37
37
|
donation_settings?: DonationSettings;
|
|
38
38
|
metadata?: Record<string, any>;
|
|
39
39
|
payment_intent_data?: PaymentIntentData;
|
|
40
|
+
enable_subscription_grouping?: boolean;
|
|
40
41
|
created_at: CreationOptional<Date>;
|
|
41
42
|
created_via: LiteralUnion<'api' | 'dashboard' | 'portal', string>;
|
|
42
43
|
updated_at: CreationOptional<Date>;
|
package/lib/subscription.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 { PaymentDetails, PaymentSettings, PriceRecurring, ServiceAction } from './types';
|
|
3
|
+
import type { PaymentDetails, PaymentSettings, PriceRecurring, ServiceAction, SubscriptionBillingThresholds } from './types';
|
|
4
4
|
export declare const nextSubscriptionId: (size?: number) => string;
|
|
5
5
|
export declare class Subscription extends Model<InferAttributes<Subscription>, InferCreationAttributes<Subscription>> {
|
|
6
6
|
id: CreationOptional<string>;
|
|
@@ -36,11 +36,7 @@ export declare class Subscription extends Model<InferAttributes<Subscription>, I
|
|
|
36
36
|
requested_by?: string;
|
|
37
37
|
};
|
|
38
38
|
billing_cycle_anchor: number;
|
|
39
|
-
billing_thresholds?:
|
|
40
|
-
amount_gte: number;
|
|
41
|
-
stake_gte: number;
|
|
42
|
-
reset_billing_cycle_anchor: boolean;
|
|
43
|
-
};
|
|
39
|
+
billing_thresholds?: SubscriptionBillingThresholds;
|
|
44
40
|
collection_method: LiteralUnion<'charge_automatically' | 'send_invoice', string>;
|
|
45
41
|
days_until_due?: number;
|
|
46
42
|
days_until_cancel?: number;
|
package/lib/types.d.ts
CHANGED
|
@@ -150,6 +150,20 @@ export type LineItem = {
|
|
|
150
150
|
upsell_price_id?: string;
|
|
151
151
|
cross_sell?: boolean;
|
|
152
152
|
custom_amount?: string;
|
|
153
|
+
subscription_data?: SubscriptionData & {
|
|
154
|
+
service_actions?: ServiceAction[];
|
|
155
|
+
billing_cycle_anchor?: number;
|
|
156
|
+
metadata?: Record<string, any>;
|
|
157
|
+
proration_behavior?: LiteralUnion<'create_prorations' | 'none', string>;
|
|
158
|
+
trial_end?: number;
|
|
159
|
+
trial_settings?: {
|
|
160
|
+
end_behavior: {
|
|
161
|
+
missing_payment_method: LiteralUnion<'cancel' | 'pause' | 'create_invoice', string>;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
days_until_due?: number;
|
|
165
|
+
days_until_cancel?: number;
|
|
166
|
+
};
|
|
153
167
|
};
|
|
154
168
|
export type InvoiceData = {
|
|
155
169
|
description?: string;
|
|
@@ -241,6 +255,7 @@ export type VaultConfig = {
|
|
|
241
255
|
enabled: boolean;
|
|
242
256
|
deposit_threshold: string;
|
|
243
257
|
withdraw_threshold: string;
|
|
258
|
+
buffer_threshold: string;
|
|
244
259
|
};
|
|
245
260
|
export type PaymentSettings = {
|
|
246
261
|
payment_method_options: PaymentMethodOptions;
|
|
@@ -357,6 +372,15 @@ export type SubscriptionData = {
|
|
|
357
372
|
recovered_from?: string;
|
|
358
373
|
trial_end?: number;
|
|
359
374
|
trial_currency?: string;
|
|
375
|
+
no_stake?: boolean;
|
|
376
|
+
notification_settings?: NotificationSetting;
|
|
377
|
+
};
|
|
378
|
+
export type SubscriptionBillingThresholds = {
|
|
379
|
+
amount_gte: number;
|
|
380
|
+
stake_gte: number;
|
|
381
|
+
reset_billing_cycle_anchor: boolean;
|
|
382
|
+
no_stake?: boolean;
|
|
383
|
+
references_primary_stake?: boolean;
|
|
360
384
|
};
|
|
361
385
|
export type PricingTableItem = {
|
|
362
386
|
price_id: string;
|
|
@@ -400,7 +424,7 @@ export type SubscriptionUpdateItem = {
|
|
|
400
424
|
};
|
|
401
425
|
export type EventType = LiteralUnion<'account.application.authorized' | 'account.application.deauthorized' | 'account.external_account.created' | 'account.external_account.deleted' | 'account.external_account.updated' | 'account.updated' | 'application_fee.created' | 'application_fee.refund.updated' | 'application_fee.refunded' | 'balance.available' | 'billing_portal.configuration.created' | 'billing_portal.configuration.updated' | 'billing_portal.session.created' | 'capability.updated' | 'cash_balance.funds_available' | 'charge.captured' | 'charge.dispute.closed' | 'charge.dispute.created' | 'charge.dispute.funds_reinstated' | 'charge.dispute.funds_withdrawn' | 'charge.dispute.updated' | 'charge.expired' | 'charge.failed' | 'charge.pending' | 'charge.refund.updated' | 'charge.refunded' | 'charge.succeeded' | 'charge.updated' | 'checkout.session.async_payment_failed' | 'checkout.session.async_payment_succeeded' | 'checkout.session.nft_minted' | 'checkout.session.completed' | 'checkout.session.expired' | 'checkout.session.created' | 'coupon.created' | 'coupon.deleted' | 'coupon.updated' | 'credit_note.created' | 'credit_note.updated' | 'credit_note.voided' | 'customer_cash_balance_transaction.created' | 'customer.created' | 'customer.deleted' | 'customer.discount.created' | 'customer.discount.deleted' | 'customer.discount.updated' | 'customer.source.created' | 'customer.source.deleted' | 'customer.source.expiring' | 'customer.source.updated' | 'customer.subscription.created' | 'customer.subscription.deleted' | 'customer.subscription.paused' | 'customer.subscription.past_due' | 'customer.subscription.pending_update_applied' | 'customer.subscription.pending_update_expired' | 'customer.subscription.resumed' | 'customer.subscription.renewed' | 'customer.subscription.recovered' | 'customer.subscription.upgraded' | 'customer.subscription.renew_failed' | 'customer.subscription.trial_start' | 'customer.subscription.trial_will_end' | 'customer.subscription.trial_end' | 'customer.subscription.started' | 'customer.subscription.updated' | 'customer.tax_id.created' | 'customer.tax_id.deleted' | 'customer.tax_id.updated' | 'customer.updated' | 'file.created' | 'financial_connections.account.created' | 'financial_connections.account.deactivated' | 'financial_connections.account.disconnected' | 'financial_connections.account.reactivated' | 'financial_connections.account.refreshed_balance' | 'identity.verification_session.canceled' | 'identity.verification_session.created' | 'identity.verification_session.processing' | 'identity.verification_session.redacted' | 'identity.verification_session.requires_input' | 'identity.verification_session.verified' | 'invoice.created' | 'invoice.deleted' | 'invoice.finalization_failed' | 'invoice.finalized' | 'invoice.marked_uncollectible' | 'invoice.paid' | 'invoice.payment_action_required' | 'invoice.payment_failed' | 'invoice.payment_succeeded' | 'invoice.sent' | 'invoice.upcoming' | 'invoice.updated' | 'invoice.voided' | 'invoiceitem.created' | 'invoiceitem.deleted' | 'issuing_authorization.created' | 'issuing_authorization.request' | 'issuing_authorization.updated' | 'issuing_card.created' | 'issuing_card.updated' | 'issuing_cardholder.created' | 'issuing_cardholder.updated' | 'issuing_dispute.closed' | 'issuing_dispute.created' | 'issuing_dispute.funds_reinstated' | 'issuing_dispute.submitted' | 'issuing_dispute.updated' | 'issuing_transaction.created' | 'issuing_transaction.updated' | 'mandate.updated' | 'order.created' | 'payment_intent.amount_capturable_updated' | 'payment_intent.canceled' | 'payment_intent.created' | 'payment_intent.partially_funded' | 'payment_intent.payment_failed' | 'payment_intent.processing' | 'payment_intent.requires_action' | 'payment_intent.succeeded' | 'payment_link.created' | 'payment_link.updated' | 'payment_method.attached' | 'payment_method.automatically_updated' | 'payment_method.detached' | 'payment_method.updated' | 'payout.canceled' | 'payout.created' | 'payout.failed' | 'payout.paid' | 'payout.reconciliation_completed' | 'payout.updated' | 'person.created' | 'person.deleted' | 'person.updated' | 'plan.created' | 'plan.deleted' | 'plan.updated' | 'price.created' | 'price.deleted' | 'price.updated' | 'product.created' | 'product.deleted' | 'product.updated' | 'promotion_code.created' | 'promotion_code.updated' | 'quote.accepted' | 'quote.canceled' | 'quote.created' | 'quote.finalized' | 'radar.early_fraud_warning.created' | 'radar.early_fraud_warning.updated' | 'recipient.created' | 'recipient.deleted' | 'recipient.updated' | 'refund.created' | 'refund.updated' | 'refund.succeeded' | 'refund.canceled' | 'reporting.report_run.failed' | 'reporting.report_run.succeeded' | 'reporting.report_type.updated' | 'review.closed' | 'review.opened' | 'setup_intent.canceled' | 'setup_intent.created' | 'setup_intent.requires_action' | 'setup_intent.setup_failed' | 'setup_intent.succeeded' | 'sigma.scheduled_query_run.created' | 'sku.created' | 'sku.deleted' | 'sku.updated' | 'source.canceled' | 'source.chargeable' | 'source.failed' | 'source.mandate_notification' | 'source.refund_attributes_required' | 'source.transaction.created' | 'source.transaction.updated' | 'subscription_schedule.aborted' | 'subscription_schedule.canceled' | 'subscription_schedule.completed' | 'subscription_schedule.created' | 'subscription_schedule.expiring' | 'subscription_schedule.released' | 'subscription_schedule.updated' | 'tax_rate.created' | 'tax_rate.updated' | 'tax.settings.updated' | 'terminal.reader.action_failed' | 'terminal.reader.action_succeeded' | 'test_helpers.test_clock.advancing' | 'test_helpers.test_clock.created' | 'test_helpers.test_clock.deleted' | 'test_helpers.test_clock.internal_failure' | 'test_helpers.test_clock.ready' | 'topup.canceled' | 'topup.created' | 'topup.failed' | 'topup.reversed' | 'topup.succeeded' | 'transfer.created' | 'transfer.reversed' | 'transfer.updated' | 'billing.discrepancy' | 'usage.report.empty', string>;
|
|
402
426
|
export type StripeRefundReason = 'duplicate' | 'fraudulent' | 'requested_by_customer';
|
|
403
|
-
export type SettingType = LiteralUnion<'donate', string>;
|
|
427
|
+
export type SettingType = LiteralUnion<'donate' | 'notification', string>;
|
|
404
428
|
export type NotificationFrequency = 'default' | 'daily' | 'weekly' | 'monthly';
|
|
405
429
|
export type NotificationSchedule = {
|
|
406
430
|
time: string;
|
|
@@ -413,4 +437,9 @@ export type NotificationSettings = {
|
|
|
413
437
|
export type CustomerPreferences = {
|
|
414
438
|
notification?: NotificationSettings;
|
|
415
439
|
};
|
|
440
|
+
export type NotificationSetting = {
|
|
441
|
+
self_handle: boolean;
|
|
442
|
+
exclude_events?: EventType[];
|
|
443
|
+
include_events?: EventType[];
|
|
444
|
+
};
|
|
416
445
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/payment-types",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.31",
|
|
4
4
|
"description": "Typings for Payment Kit SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"types",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"sequelize": "^6.37.3",
|
|
49
49
|
"type-fest": "^4.23.0"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "c9b1eff248ecd07bc1f606df039464dafa786914"
|
|
52
52
|
}
|