@stacksjs/payments 0.65.0 → 0.68.0
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 +987 -3
- 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 +9 -9
- package/dist/drivers/stripe.d.ts +0 -42
- package/dist/index.js.map +0 -187
- package/src/drivers/stripe.ts +0 -157
- package/src/index.ts +0 -1
package/src/drivers/stripe.ts
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import Stripe from 'stripe'
|
|
2
|
-
|
|
3
|
-
const apiKey = ''
|
|
4
|
-
|
|
5
|
-
const client = new Stripe(apiKey, {
|
|
6
|
-
apiVersion: '2024-06-20',
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
// TODO: learn about subscriptions
|
|
10
|
-
export interface PaymentIntent {
|
|
11
|
-
create: (params: Stripe.PaymentIntentCreateParams) => Promise<Stripe.Response<Stripe.PaymentIntent>>
|
|
12
|
-
retrieve: (stripeId: string) => Promise<Stripe.Response<Stripe.PaymentIntent>>
|
|
13
|
-
update: (stripeId: string, params: Stripe.PaymentIntentCreateParams) => Promise<Stripe.Response<Stripe.PaymentIntent>>
|
|
14
|
-
cancel: (stripeId: string) => Promise<Stripe.Response<Stripe.PaymentIntent>>
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const paymentIntent: PaymentIntent = (() => {
|
|
18
|
-
async function create(params: Stripe.PaymentIntentCreateParams) {
|
|
19
|
-
return await client.paymentIntents.create(params)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
async function retrieve(stripeId: string) {
|
|
23
|
-
return await client.paymentIntents.retrieve(stripeId)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
async function update(stripeId: string, params: Stripe.PaymentIntentCreateParams) {
|
|
27
|
-
return await client.paymentIntents.update(stripeId, params)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
async function cancel(stripeId: string) {
|
|
31
|
-
return await client.paymentIntents.cancel(stripeId)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return { create, retrieve, update, cancel }
|
|
35
|
-
})()
|
|
36
|
-
|
|
37
|
-
export interface Balance {
|
|
38
|
-
retrieve: () => Promise<Stripe.Response<Stripe.Balance>>
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const balance: Balance = (() => {
|
|
42
|
-
async function retrieve() {
|
|
43
|
-
return await client.balance.retrieve()
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return { retrieve }
|
|
47
|
-
})()
|
|
48
|
-
|
|
49
|
-
export interface Customer {
|
|
50
|
-
create: (params: Stripe.CustomerCreateParams) => Promise<Stripe.Response<Stripe.Customer>>
|
|
51
|
-
update: (stripeId: string, params: Stripe.CustomerCreateParams) => Promise<Stripe.Response<Stripe.Customer>>
|
|
52
|
-
retrieve: (stripeId: string) => Promise<Stripe.Response<Stripe.Customer | Stripe.DeletedCustomer>>
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export const customer: Customer = (() => {
|
|
56
|
-
async function create(params: Stripe.CustomerCreateParams) {
|
|
57
|
-
return await client.customers.create(params)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
async function update(stripeId: string, params: Stripe.CustomerCreateParams) {
|
|
61
|
-
return await client.customers.update(stripeId, params)
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
async function retrieve(stripeId: string) {
|
|
65
|
-
return await client.customers.retrieve(stripeId)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return { create, update, retrieve }
|
|
69
|
-
})()
|
|
70
|
-
|
|
71
|
-
export interface Charge {
|
|
72
|
-
create: (params: Stripe.ChargeCreateParams) => Promise<Stripe.Response<Stripe.Charge>>
|
|
73
|
-
update: (stripeId: string, params: Stripe.ChargeCreateParams) => Promise<Stripe.Response<Stripe.Charge>>
|
|
74
|
-
capture: (stripeId: string) => Promise<Stripe.Response<Stripe.Charge>>
|
|
75
|
-
retrieve: (stripeId: string) => Promise<Stripe.Response<Stripe.Charge>>
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export const charge: Charge = (() => {
|
|
79
|
-
async function create(params: Stripe.ChargeCreateParams) {
|
|
80
|
-
return await client.charges.create(params)
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
async function update(stripeId: string, params: Stripe.ChargeCreateParams) {
|
|
84
|
-
return await client.charges.update(stripeId, params)
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
async function capture(stripeId: string) {
|
|
88
|
-
return await client.charges.capture(stripeId)
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
async function retrieve(stripeId: string) {
|
|
92
|
-
return await client.charges.retrieve(stripeId)
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return { create, update, retrieve, capture }
|
|
96
|
-
})()
|
|
97
|
-
|
|
98
|
-
export interface BalanceTransactions {
|
|
99
|
-
retrieve: (stripeId: string) => Promise<Stripe.Response<Stripe.BalanceTransaction>>
|
|
100
|
-
list: (limit: number) => Promise<Stripe.Response<Stripe.ApiList<Stripe.BalanceTransaction>>>
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export const balanceTransactions: BalanceTransactions = (() => {
|
|
104
|
-
async function retrieve(stripeId: string) {
|
|
105
|
-
return await client.balanceTransactions.retrieve(stripeId)
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
async function list(limit: number) {
|
|
109
|
-
return await client.balanceTransactions.list({ limit })
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
return { retrieve, list }
|
|
113
|
-
})()
|
|
114
|
-
|
|
115
|
-
export interface Dispute {
|
|
116
|
-
retrieve: (stripeId: string) => Promise<Stripe.Response<Stripe.Dispute>>
|
|
117
|
-
update: (stripeId: string, params: Stripe.DisputeUpdateParams) => Promise<Stripe.Response<Stripe.Dispute>>
|
|
118
|
-
close: (stripeId: string) => Promise<Stripe.Response<Stripe.Dispute>>
|
|
119
|
-
list: (limit: number) => Promise<Stripe.Response<Stripe.ApiList<Stripe.Dispute>>>
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export const dispute: Dispute = (() => {
|
|
123
|
-
async function retrieve(stripeId: string) {
|
|
124
|
-
return await client.disputes.retrieve(stripeId)
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
async function update(stripeId: string, params: Stripe.DisputeUpdateParams) {
|
|
128
|
-
return await client.disputes.update(stripeId, params)
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
async function close(stripeId: string) {
|
|
132
|
-
return await client.disputes.close(stripeId)
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
async function list(limit: number) {
|
|
136
|
-
return await client.disputes.list({ limit })
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
return { retrieve, update, close, list }
|
|
140
|
-
})()
|
|
141
|
-
|
|
142
|
-
export interface PaymentEvents {
|
|
143
|
-
retrieve: (stripeId: string) => Promise<Stripe.Response<Stripe.Event>>
|
|
144
|
-
list: (limit: number) => Promise<Stripe.Response<Stripe.ApiList<Stripe.Event>>>
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export const events: PaymentEvents = (() => {
|
|
148
|
-
async function retrieve(stripeId: string) {
|
|
149
|
-
return await client.events.retrieve(stripeId)
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
async function list(limit: number) {
|
|
153
|
-
return await client.events.list({ limit })
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
return { retrieve, list }
|
|
157
|
-
})()
|
package/src/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * as stripe from './drivers/stripe'
|