mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-18 02:21:47 -05:00
Fixed webhook handling for Checkout Sessions (#245)
no-issue Fetching relations via the model returns a promise, and this was missing the `await` keyword. We also need to `get` the subscription_id attribute as we're working with models rather than subscription objects.
This commit is contained in:
parent
5bb1706f8d
commit
274412b051
1 changed files with 2 additions and 2 deletions
|
@ -157,11 +157,11 @@ module.exports = class StripeWebhookService {
|
|||
setupIntent.payment_method
|
||||
);
|
||||
|
||||
const subscriptions = member.related('stripeSubscriptions').fetch();
|
||||
const subscriptions = await member.related('stripeSubscriptions').fetch();
|
||||
|
||||
for (const subscription of subscriptions.models) {
|
||||
const updatedSubscription = await this._stripeAPIService.updateSubscriptionDefaultPaymentMethod(
|
||||
subscription.id,
|
||||
subscription.get('subscription_id'),
|
||||
setupIntent.payment_method
|
||||
);
|
||||
await this._memberRepository.linkSubscription({
|
||||
|
|
Loading…
Add table
Reference in a new issue