@stacksjs/payments 0.67.0 → 0.68.1
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/dist/Customer.d.ts +16 -0
- package/dist/charge.d.ts +10 -0
- package/dist/checkout.d.ts +7 -0
- package/dist/fsevents-hj42pnne.node +0 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +988 -1
- package/dist/payment-method.d.ts +10 -0
- package/dist/price.d.ts +7 -0
- package/dist/setup-products.d.ts +1 -0
- package/dist/stripe.d.ts +105 -0
- package/dist/subscription.d.ts +9 -0
- package/package.json +4 -3
- package/dist/drivers/stripe.d.ts +0 -42
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Stripe } from 'stripe';
|
|
2
|
+
import type { UserModel } from '../../../../orm/src/models/User';
|
|
3
|
+
|
|
4
|
+
export declare interface ManagePaymentMethod {
|
|
5
|
+
addPaymentMethod: (user: UserModel, paymentMethod: string | Stripe.PaymentMethod) => Promise<Stripe.Response<Stripe.PaymentMethod>>
|
|
6
|
+
updatePaymentMethod: (user: UserModel, paymentMethodId: string, updateParams: Stripe.PaymentMethodUpdateParams) => Promise<Stripe.Response<Stripe.PaymentMethod>>
|
|
7
|
+
deletePaymentMethod: (user: UserModel, paymentMethodId: string) => Promise<Stripe.Response<Stripe.PaymentMethod>>
|
|
8
|
+
retrievePaymentMethod: (user: UserModel, paymentMethodId: string) => Promise<Stripe.Response<Stripe.PaymentMethod>>
|
|
9
|
+
}
|
|
10
|
+
export declare let managePaymentMethod: ManagePaymentMethod;
|
package/dist/price.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Stripe } from 'stripe';
|
|
2
|
+
|
|
3
|
+
export declare interface PriceManager {
|
|
4
|
+
retrieveByLookupKey: (lookupKey: string) => Promise<Stripe.Price | undefined>
|
|
5
|
+
createOrGet: (lookupKey: string, params: Stripe.PriceCreateParams) => Promise<Stripe.Price>
|
|
6
|
+
}
|
|
7
|
+
export declare const managePrice: PriceManager;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createStripeProduct(): Promise<any>;
|
package/dist/stripe.d.ts
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
declare const apiKey: unknown;
|
|
2
|
+
export declare interface PaymentIntent {
|
|
3
|
+
create: (params: Stripe.PaymentIntentCreateParams) => Promise<Stripe.Response<Stripe.PaymentIntent>>
|
|
4
|
+
retrieve: (stripeId: string) => Promise<Stripe.Response<Stripe.PaymentIntent>>
|
|
5
|
+
update: (stripeId: string, params: Stripe.PaymentIntentCreateParams) => Promise<Stripe.Response<Stripe.PaymentIntent>>
|
|
6
|
+
cancel: (stripeId: string) => Promise<Stripe.Response<Stripe.PaymentIntent>>
|
|
7
|
+
}
|
|
8
|
+
export declare const paymentIntent: PaymentIntent;
|
|
9
|
+
export declare interface Balance {
|
|
10
|
+
retrieve: () => Promise<Stripe.Response<Stripe.Balance>>
|
|
11
|
+
}
|
|
12
|
+
export declare const balance: Balance;
|
|
13
|
+
export declare interface Customer {
|
|
14
|
+
create: (params: Stripe.CustomerCreateParams) => Promise<Stripe.Response<Stripe.Customer>>
|
|
15
|
+
update: (stripeId: string, params: Stripe.CustomerCreateParams) => Promise<Stripe.Response<Stripe.Customer>>
|
|
16
|
+
del: (stripeId: string) => Promise<Stripe.Response<Stripe.DeletedCustomer>>
|
|
17
|
+
retrieve: (stripeId: string) => Promise<Stripe.Response<Stripe.Customer | Stripe.DeletedCustomer>>
|
|
18
|
+
}
|
|
19
|
+
export declare const customer: Customer;
|
|
20
|
+
export declare interface Charge {
|
|
21
|
+
create: (params: Stripe.ChargeCreateParams) => Promise<Stripe.Response<Stripe.Charge>>
|
|
22
|
+
update: (stripeId: string, params: Stripe.ChargeCreateParams) => Promise<Stripe.Response<Stripe.Charge>>
|
|
23
|
+
capture: (stripeId: string) => Promise<Stripe.Response<Stripe.Charge>>
|
|
24
|
+
retrieve: (stripeId: string) => Promise<Stripe.Response<Stripe.Charge>>
|
|
25
|
+
}
|
|
26
|
+
export declare const charge: Charge;
|
|
27
|
+
export declare interface Subscription {
|
|
28
|
+
create: (params: Stripe.SubscriptionCreateParams) => Promise<Stripe.Response<Stripe.Subscription>>
|
|
29
|
+
}
|
|
30
|
+
export declare const subscription: Subscription;
|
|
31
|
+
export declare interface Price {
|
|
32
|
+
retrieve: (priceId: string, params: Stripe.PriceRetrieveParams) => Promise<Stripe.Response<Stripe.Price>>
|
|
33
|
+
list: (params: Stripe.PriceListParams) => Promise<Stripe.ApiListPromise<Stripe.Price>>
|
|
34
|
+
create: (params: Stripe.PriceCreateParams) => Promise<Stripe.Response<Stripe.Price>>
|
|
35
|
+
update: (priceId: string, params: Stripe.PriceUpdateParams) => Promise<Stripe.Response<Stripe.Price>>
|
|
36
|
+
}
|
|
37
|
+
export declare const price: Price;
|
|
38
|
+
export declare interface Product {
|
|
39
|
+
create: (params: Stripe.ProductCreateParams) => Promise<Stripe.Response<Stripe.Product>>
|
|
40
|
+
retrieve: (productId: string, params?: Stripe.ProductRetrieveParams) => Promise<Stripe.Response<Stripe.Product>>
|
|
41
|
+
update: (productId: string, params: Stripe.ProductUpdateParams) => Promise<Stripe.Response<Stripe.Product>>
|
|
42
|
+
delete: (productId: string) => Promise<Stripe.Response<Stripe.DeletedProduct>>
|
|
43
|
+
list: (params?: Stripe.ProductListParams) => Promise<Stripe.ApiListPromise<Stripe.Product>>
|
|
44
|
+
}
|
|
45
|
+
export declare const product: Product;
|
|
46
|
+
export declare interface Refund {
|
|
47
|
+
create: (params: Stripe.RefundCreateParams) => Promise<Stripe.Response<Stripe.Refund>>
|
|
48
|
+
retrieve: (refundId: string) => Promise<Stripe.Response<Stripe.Refund>>
|
|
49
|
+
update: (refundId: string, params: Stripe.RefundUpdateParams) => Promise<Stripe.Response<Stripe.Refund>>
|
|
50
|
+
list: (params: Stripe.RefundListParams) => Promise<Stripe.Response<Stripe.ApiList<Stripe.Refund>>>
|
|
51
|
+
}
|
|
52
|
+
export declare const refund: Refund;
|
|
53
|
+
export declare interface PaymentMethod {
|
|
54
|
+
create: (params: Stripe.PaymentMethodCreateParams) => Promise<Stripe.Response<Stripe.PaymentMethod>>
|
|
55
|
+
retrieve: (paymentMethodId: string) => Promise<Stripe.Response<Stripe.PaymentMethod>>
|
|
56
|
+
update: (paymentMethodId: string, params: Stripe.PaymentMethodUpdateParams) => Promise<Stripe.Response<Stripe.PaymentMethod>>
|
|
57
|
+
list: (params: Stripe.PaymentMethodListParams) => Promise<Stripe.Response<Stripe.ApiList<Stripe.PaymentMethod>>>
|
|
58
|
+
attach: (paymentMethodId: string, params: Stripe.PaymentMethodAttachParams) => Promise<Stripe.Response<Stripe.PaymentMethod>>
|
|
59
|
+
detach: (paymentMethodId: string) => Promise<Stripe.Response<Stripe.PaymentMethod>>
|
|
60
|
+
}
|
|
61
|
+
export declare const paymentMethod: PaymentMethod;
|
|
62
|
+
export declare interface BalanceTransactions {
|
|
63
|
+
retrieve: (stripeId: string) => Promise<Stripe.Response<Stripe.BalanceTransaction>>
|
|
64
|
+
list: (limit: number) => Promise<Stripe.Response<Stripe.ApiList<Stripe.BalanceTransaction>>>
|
|
65
|
+
}
|
|
66
|
+
export declare const balanceTransactions: BalanceTransactions;
|
|
67
|
+
export declare interface Checkout {
|
|
68
|
+
create: (params: Stripe.Checkout.SessionCreateParams) => Promise<Stripe.Response<Stripe.Checkout.Session>>
|
|
69
|
+
retrieve: (sessionId: string) => Promise<Stripe.Response<Stripe.Checkout.Session>>
|
|
70
|
+
expire: (sessionId: string) => Promise<Stripe.Response<Stripe.Checkout.Session>>
|
|
71
|
+
list: (params: Stripe.Checkout.SessionListParams) => Promise<Stripe.Response<Stripe.ApiList<Stripe.Checkout.Session>>>
|
|
72
|
+
listLineItems: (sessionId: string, params?: Stripe.Checkout.SessionListLineItemsParams) => Promise<Stripe.Response<Stripe.ApiList<Stripe.LineItem>>>
|
|
73
|
+
}
|
|
74
|
+
export declare const checkout: Checkout;
|
|
75
|
+
export declare interface Dispute {
|
|
76
|
+
retrieve: (stripeId: string) => Promise<Stripe.Response<Stripe.Dispute>>
|
|
77
|
+
update: (stripeId: string, params: Stripe.DisputeUpdateParams) => Promise<Stripe.Response<Stripe.Dispute>>
|
|
78
|
+
close: (stripeId: string) => Promise<Stripe.Response<Stripe.Dispute>>
|
|
79
|
+
list: (limit: number) => Promise<Stripe.Response<Stripe.ApiList<Stripe.Dispute>>>
|
|
80
|
+
}
|
|
81
|
+
export declare const dispute: Dispute;
|
|
82
|
+
export declare interface Tax {
|
|
83
|
+
retrieve: (taxId: string) => Promise<Stripe.Response<Stripe.Tax.Calculation>>
|
|
84
|
+
create: (params: Stripe.Tax.CalculationCreateParams) => Promise<Stripe.Response<Stripe.Tax.Calculation>>
|
|
85
|
+
listTaxCodes: (params?: Stripe.TaxCodeListParams) => Promise<Stripe.Response<Stripe.ApiList<Stripe.TaxCode>>>
|
|
86
|
+
retrieveTaxCode: (taxCodeId: string) => Promise<Stripe.Response<Stripe.TaxCode>>
|
|
87
|
+
}
|
|
88
|
+
export declare const tax: Tax;
|
|
89
|
+
export declare interface Promotion {
|
|
90
|
+
createCoupon: (params: Stripe.CouponCreateParams) => Promise<Stripe.Response<Stripe.Coupon>>
|
|
91
|
+
retrieveCoupon: (couponId: string) => Promise<Stripe.Response<Stripe.Coupon>>
|
|
92
|
+
updateCoupon: (couponId: string, params: Stripe.CouponUpdateParams) => Promise<Stripe.Response<Stripe.Coupon>>
|
|
93
|
+
deleteCoupon: (couponId: string) => Promise<Stripe.Response<Stripe.DeletedCoupon>>
|
|
94
|
+
listCoupons: (params?: Stripe.CouponListParams) => Promise<Stripe.Response<Stripe.ApiList<Stripe.Coupon>>>
|
|
95
|
+
createPromoCode: (params: Stripe.PromotionCodeCreateParams) => Promise<Stripe.Response<Stripe.PromotionCode>>
|
|
96
|
+
retrievePromoCode: (promoCodeId: string) => Promise<Stripe.Response<Stripe.PromotionCode>>
|
|
97
|
+
updatePromoCode: (promoCodeId: string, params: Stripe.PromotionCodeUpdateParams) => Promise<Stripe.Response<Stripe.PromotionCode>>
|
|
98
|
+
listPromoCodes: (params?: Stripe.PromotionCodeListParams) => Promise<Stripe.Response<Stripe.ApiList<Stripe.PromotionCode>>>
|
|
99
|
+
}
|
|
100
|
+
export declare const promotion: Promotion;
|
|
101
|
+
export declare interface PaymentEvents {
|
|
102
|
+
retrieve: (stripeId: string) => Promise<Stripe.Response<Stripe.Event>>
|
|
103
|
+
list: (limit: number) => Promise<Stripe.Response<Stripe.ApiList<Stripe.Event>>>
|
|
104
|
+
}
|
|
105
|
+
export declare const events: PaymentEvents;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Stripe } from 'stripe';
|
|
2
|
+
import type { UserModel } from '../../../../orm/src/models/User';
|
|
3
|
+
|
|
4
|
+
export declare interface SubscriptionManager {
|
|
5
|
+
create: (user: UserModel, type: string, priceId: string, params: Partial<Stripe.SubscriptionCreateParams>) => Promise<Stripe.Response<Stripe.Subscription>>
|
|
6
|
+
isValid: (user: UserModel, type: string) => Promise<boolean>
|
|
7
|
+
isIncomplete: (user: UserModel, type: string) => Promise<boolean>
|
|
8
|
+
}
|
|
9
|
+
export declare const manageSubscription: SubscriptionManager;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/payments",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.68.1",
|
|
5
5
|
"description": "The Stacks payments package. Currently supporting Stripe.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": ["Chris Breuer <chris@stacksjs.org>"],
|
|
@@ -43,9 +43,10 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@stacksjs/utils": "0.67.0",
|
|
46
|
-
"@stripe/stripe-js": "^4.
|
|
46
|
+
"@stripe/stripe-js": "^4.9.0",
|
|
47
|
+
"@types/stripe": "^8.0.417",
|
|
47
48
|
"@vue-stripe/vue-stripe": "^4.5.0",
|
|
48
|
-
"stripe": "^17.2.
|
|
49
|
+
"stripe": "^17.2.1"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
52
|
"@stacksjs/config": "0.67.0",
|
package/dist/drivers/stripe.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import Stripe from "stripe";
|
|
2
|
-
export interface PaymentIntent {
|
|
3
|
-
create: (params: Stripe.PaymentIntentCreateParams) => Promise<Stripe.Response<Stripe.PaymentIntent>>;
|
|
4
|
-
retrieve: (stripeId: string) => Promise<Stripe.Response<Stripe.PaymentIntent>>;
|
|
5
|
-
update: (stripeId: string, params: Stripe.PaymentIntentCreateParams) => Promise<Stripe.Response<Stripe.PaymentIntent>>;
|
|
6
|
-
cancel: (stripeId: string) => Promise<Stripe.Response<Stripe.PaymentIntent>>;
|
|
7
|
-
}
|
|
8
|
-
export declare const paymentIntent: PaymentIntent;
|
|
9
|
-
export interface Balance {
|
|
10
|
-
retrieve: () => Promise<Stripe.Response<Stripe.Balance>>;
|
|
11
|
-
}
|
|
12
|
-
export declare const balance: Balance;
|
|
13
|
-
export interface Customer {
|
|
14
|
-
create: (params: Stripe.CustomerCreateParams) => Promise<Stripe.Response<Stripe.Customer>>;
|
|
15
|
-
update: (stripeId: string, params: Stripe.CustomerCreateParams) => Promise<Stripe.Response<Stripe.Customer>>;
|
|
16
|
-
retrieve: (stripeId: string) => Promise<Stripe.Response<Stripe.Customer | Stripe.DeletedCustomer>>;
|
|
17
|
-
}
|
|
18
|
-
export declare const customer: Customer;
|
|
19
|
-
export interface Charge {
|
|
20
|
-
create: (params: Stripe.ChargeCreateParams) => Promise<Stripe.Response<Stripe.Charge>>;
|
|
21
|
-
update: (stripeId: string, params: Stripe.ChargeCreateParams) => Promise<Stripe.Response<Stripe.Charge>>;
|
|
22
|
-
capture: (stripeId: string) => Promise<Stripe.Response<Stripe.Charge>>;
|
|
23
|
-
retrieve: (stripeId: string) => Promise<Stripe.Response<Stripe.Charge>>;
|
|
24
|
-
}
|
|
25
|
-
export declare const charge: Charge;
|
|
26
|
-
export interface BalanceTransactions {
|
|
27
|
-
retrieve: (stripeId: string) => Promise<Stripe.Response<Stripe.BalanceTransaction>>;
|
|
28
|
-
list: (limit: number) => Promise<Stripe.Response<Stripe.ApiList<Stripe.BalanceTransaction>>>;
|
|
29
|
-
}
|
|
30
|
-
export declare const balanceTransactions: BalanceTransactions;
|
|
31
|
-
export interface Dispute {
|
|
32
|
-
retrieve: (stripeId: string) => Promise<Stripe.Response<Stripe.Dispute>>;
|
|
33
|
-
update: (stripeId: string, params: Stripe.DisputeUpdateParams) => Promise<Stripe.Response<Stripe.Dispute>>;
|
|
34
|
-
close: (stripeId: string) => Promise<Stripe.Response<Stripe.Dispute>>;
|
|
35
|
-
list: (limit: number) => Promise<Stripe.Response<Stripe.ApiList<Stripe.Dispute>>>;
|
|
36
|
-
}
|
|
37
|
-
export declare const dispute: Dispute;
|
|
38
|
-
export interface PaymentEvents {
|
|
39
|
-
retrieve: (stripeId: string) => Promise<Stripe.Response<Stripe.Event>>;
|
|
40
|
-
list: (limit: number) => Promise<Stripe.Response<Stripe.ApiList<Stripe.Event>>>;
|
|
41
|
-
}
|
|
42
|
-
export declare const events: PaymentEvents;
|