Skip to content

Commit 835eabe

Browse files
committed
chore: wip
1 parent 2848506 commit 835eabe

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

.stacks/core/payments/src/drivers/stripe.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { payment as config } from '@stacksjs/config'
2-
import type { ChargeOptions, CustomerOptions, DisputeOptions } from '@stacksjs/types'
2+
import type { ChargeOptions, CustomerOptions, DisputeOptions, EventOptions } from '@stacksjs/types'
33

44
const stripe = require('stripe')(config.drivers.stripe.key);
55

@@ -102,15 +102,23 @@ const customer = async (options: CustomerOptions) => {
102102
}
103103
}
104104
}
105-
const events = async (event_key: string) => {
106-
return await stripe.events.retrieve(event_key);
105+
106+
const events = async (options: EventOptions) => {
107+
return {
108+
retrieve: async () => {
109+
await stripe.events.retrieve(options.event_id)
110+
},
111+
list: async () => {
112+
await stripe.events.list(options.listOptions)
113+
}
114+
};
107115
}
108116

109117
export {
110118
balance,
111119
balanceTransactions,
112-
events,
113120
charge,
114121
customer,
115-
dispute
122+
dispute,
123+
events,
116124
}

.stacks/core/types/src/payments.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,15 @@ export interface DisputeOptions {
5555
starting_after?: string;
5656
}
5757
}
58+
59+
export interface EventOptions {
60+
event_id?: string;
61+
listOptions?: {
62+
created?: object,
63+
delivery_success?: boolean;
64+
ending_before?: string;
65+
limit?: number;
66+
starting_after?: string;
67+
type?: string
68+
}
69+
}

0 commit comments

Comments
 (0)