Skip to content

Commit

Permalink
Remove Stripe customer prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
MauAraujo committed May 6, 2024
1 parent b81d4c5 commit 3af6621
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions internal/billing/stripe.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,17 @@ func (s StripeClient) CreateCustomer(ctx context.Context, userEmail string, proj
defer span.End()

if projectID == 0 || projectName == "" {
return "", fmt.Errorf("invalid project id or name")
return "", telemetry.Error(ctx, span, err, "invalid project id or name")
}

stripe.Key = s.SecretKey

// Create customer if not exists
customerName := fmt.Sprintf("project_%s", projectName)
projectIDStr := strconv.FormatUint(uint64(projectID), 10)
params := &stripe.CustomerParams{
Name: stripe.String(customerName),
Name: stripe.String(projectName),
Email: stripe.String(userEmail),
Metadata: map[string]string{
"porter_project_id": projectIDStr,
"project_id": projectIDStr,
},
}

Expand Down

0 comments on commit 3af6621

Please sign in to comment.