mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
feat(server): support lifetime subscription (#7405)
closes CLOUD-48 - [x] lifetime subscription quota - [ ] tests
This commit is contained in:
@@ -45,9 +45,16 @@ export class StripeWebhook {
|
||||
setImmediate(() => {
|
||||
// handle duplicated events?
|
||||
// see https://stripe.com/docs/webhooks#handle-duplicate-events
|
||||
this.event.emitAsync(event.type, event.data.object).catch(e => {
|
||||
this.logger.error('Failed to handle Stripe Webhook event.', e);
|
||||
});
|
||||
this.event
|
||||
.emitAsync(
|
||||
event.type,
|
||||
event.data.object,
|
||||
// here to let event listeners know what exactly the event is if a handler can handle multiple events
|
||||
event.type
|
||||
)
|
||||
.catch(e => {
|
||||
this.logger.error('Failed to handle Stripe Webhook event.', e);
|
||||
});
|
||||
});
|
||||
} catch (err: any) {
|
||||
throw new InternalServerError(err.message);
|
||||
|
||||
Reference in New Issue
Block a user