Skip to content

Commit 2f46b9c

Browse files
committed
some improvment
1 parent 79f4489 commit 2f46b9c

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/modules/subscriptions/subscriptions.controller.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ export class SubscriptionsController {
7777
object.amount,
7878
object.target_currency,
7979
);
80+
} else {
81+
await this.subscriptionService.handleRelayCheckout(
82+
object.id,
83+
metadata.pubkey,
84+
metadata.planId,
85+
object.amount,
86+
object.target_currency,
87+
);
8088
}
81-
82-
await this.subscriptionService.handleRelayCheckout(
83-
object.id,
84-
metadata.pubkey,
85-
metadata.planId,
86-
object.amount,
87-
object.target_currency,
88-
);
8989
}
9090

9191
return { success: true };

src/modules/subscriptions/subscriptions.service.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ export class SubscriptionsService {
5050
hexToBytes(this.apiConfig.getNostrConfig.privateKey),
5151
this.apiConfig.getNostrConfig.relays,
5252
);
53+
54+
this.seedRedis();
5355
}
5456

5557
private async getSubscriptionPlan(planId: string) {
@@ -146,6 +148,8 @@ export class SubscriptionsService {
146148
await this.subscriptionRepository.save(subscription);
147149
await this.createInvoiceRecord(checkoutSessionId, totalAmount, unit);
148150
await this.notifyUser(SubscriptionTemplate.welcomeRelay().content, pubkey);
151+
152+
return true;
149153
}
150154

151155
async handleNip05Checkout(
@@ -166,6 +170,8 @@ export class SubscriptionsService {
166170

167171
await this.createInvoiceRecord(checkoutSessionId, totalAmount, unit);
168172
await this.notifyUser(SubscriptionTemplate.welcomeNip05(res.fullIdentifier).content, pubkey);
173+
174+
return true;
169175
}
170176

171177
async seedRedis() {

0 commit comments

Comments
 (0)