Skip to content

Commit 63f92bd

Browse files
committed
fix small bug & delete fmt.Println logs
1 parent 131a3b3 commit 63f92bd

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

internal/subscriptions/service.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package subscriptions
33
import (
44
"database/sql"
55
"errors"
6-
"fmt"
76
"time"
87
"website-pb/config"
98

@@ -79,11 +78,8 @@ func (s *SubscriptionService) CreateCheckoutSession(user *core.Record, plan stri
7978
CancelURL: stripe.String(frontendURL),
8079
Mode: stripe.String(string(stripe.CheckoutSessionModeSubscription)),
8180
ClientReferenceID: stripe.String(user.Id),
82-
SubscriptionData: &stripe.CheckoutSessionSubscriptionDataParams{
83-
Metadata: map[string]string{"plan": "pro"}, // 存到订阅对象里
84-
},
85-
Metadata: map[string]string{"plan": plan},
86-
LineItems: []*stripe.CheckoutSessionLineItemParams{{Price: stripe.String(priceID), Quantity: stripe.Int64(1)}},
81+
Metadata: map[string]string{"plan": plan},
82+
LineItems: []*stripe.CheckoutSessionLineItemParams{{Price: stripe.String(priceID), Quantity: stripe.Int64(1)}},
8783
}
8884

8985
// 关联已有 Stripe Customer ID
@@ -127,7 +123,6 @@ func (s *SubscriptionService) HandleInvoicePaid(inv stripe.Invoice) error {
127123
priceID := inv.Lines.Data[0].Pricing.PriceDetails.Price
128124

129125
priceIDMap := s.cfg.PriceToPlan[priceID]
130-
fmt.Println(priceID)
131126

132127
if priceIDMap == "" {
133128
s.app.Logger().Warn("No prices found for invoice ", inv)

migrations/1769475161_init_settings.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func init() {
2020
return app.Save(settings)
2121
}, func(app core.App) error {
2222
// add down queries...
23-
println("[Init Settings] Cannot Down the migration")
23+
app.Logger().Info("[Init Settings] Cannot revert this migration")
2424
return nil
2525
})
2626
}

0 commit comments

Comments
 (0)