@stacksjs/payments 0.64.6 → 0.67.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/drivers/stripe.d.ts +42 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -4
- package/package.json +11 -18
- package/dist/index.js.map +0 -175
- package/src/drivers/stripe.ts +0 -116
- package/src/index.ts +0 -1
package/src/drivers/stripe.ts
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import Stripe from 'stripe'
|
|
2
|
-
|
|
3
|
-
const apiKey = ''
|
|
4
|
-
|
|
5
|
-
const stripe = new Stripe(apiKey, {
|
|
6
|
-
apiVersion: '2023-10-16',
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
// TODO: learn about subscriptions
|
|
10
|
-
export const paymentIntent = (() => {
|
|
11
|
-
async function create(params: Stripe.PaymentIntentCreateParams) {
|
|
12
|
-
return await stripe.paymentIntents.create(params)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
async function retrieve(stripeId: string) {
|
|
16
|
-
return await stripe.paymentIntents.retrieve(stripeId)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
async function update(stripeId: string, params: Stripe.PaymentIntentCreateParams) {
|
|
20
|
-
return await stripe.paymentIntents.update(stripeId, params)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async function cancel(stripeId: string) {
|
|
24
|
-
return await stripe.paymentIntents.cancel(stripeId)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return { create, retrieve, update, cancel }
|
|
28
|
-
})()
|
|
29
|
-
|
|
30
|
-
export const balance = (() => {
|
|
31
|
-
async function retrieve() {
|
|
32
|
-
return await stripe.balance.retrieve()
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return { retrieve }
|
|
36
|
-
})()
|
|
37
|
-
|
|
38
|
-
export const customer = (() => {
|
|
39
|
-
async function create(params: Stripe.CustomerCreateParams) {
|
|
40
|
-
return await stripe.customers.create(params)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
async function update(stripeId: string, params: Stripe.CustomerCreateParams) {
|
|
44
|
-
return await stripe.customers.update(stripeId, params)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
async function retrieve(stripeId: string) {
|
|
48
|
-
return await stripe.customers.retrieve(stripeId)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return { create, update, retrieve }
|
|
52
|
-
})()
|
|
53
|
-
|
|
54
|
-
export const charge = (() => {
|
|
55
|
-
async function create(params: Stripe.ChargeCreateParams) {
|
|
56
|
-
return await stripe.charges.create(params)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
async function update(stripeId: string, params: Stripe.ChargeCreateParams) {
|
|
60
|
-
return await stripe.charges.update(stripeId, params)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
async function capture(stripeId: string) {
|
|
64
|
-
return await stripe.charges.capture(stripeId)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
async function retrieve(stripeId: string) {
|
|
68
|
-
return await stripe.charges.retrieve(stripeId)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return { create, update, retrieve, capture }
|
|
72
|
-
})()
|
|
73
|
-
|
|
74
|
-
export const balanceTransactions = (() => {
|
|
75
|
-
async function retrieve(stripeId: string) {
|
|
76
|
-
await stripe.balanceTransactions.retrieve(stripeId)
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
async function list(limit: number) {
|
|
80
|
-
await stripe.balanceTransactions.list({ limit })
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return { retrieve, list }
|
|
84
|
-
})()
|
|
85
|
-
|
|
86
|
-
export const dispute = (() => {
|
|
87
|
-
async function retrieve(stripeId: string) {
|
|
88
|
-
return await stripe.disputes.retrieve(stripeId)
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
async function update(stripeId: string, params: Stripe.DisputeUpdateParams) {
|
|
92
|
-
return await stripe.disputes.update(stripeId, params)
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
async function close(stripeId: string) {
|
|
96
|
-
return await stripe.disputes.close(stripeId)
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
async function list(limit: number) {
|
|
100
|
-
return await stripe.disputes.list({ limit })
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return { retrieve, update, close, list }
|
|
104
|
-
})()
|
|
105
|
-
|
|
106
|
-
export const events = (() => {
|
|
107
|
-
async function retrieve(stripeId: string) {
|
|
108
|
-
await stripe.events.retrieve(stripeId)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
async function list(limit: number) {
|
|
112
|
-
await stripe.events.list({ limit })
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return { retrieve, list }
|
|
116
|
-
})()
|
package/src/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * as stripe from './drivers/stripe'
|