Answer the question
In order to leave comments, you need to log in
How to handle invoice.payment_* events in Stripe API?
The point is that before these events should use information from the database, but during these webhooks, the information is not yet stored in the database, hence the error.
async handle(event: any): Promise<void> {
// вот здесь подписка уже должен быть сохранен в базе данных, но webhook срабатывает раньше чем задумано
const subscription = await this.subscriptionService.getForEvent(
event.data.object.subscription,
SUBSCRIPTION_STATUS_PENDING,
);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question