diff --git a/app/handlers/webhooks/paddle.go b/app/handlers/webhooks/paddle.go index f75c372b8..9469b6e56 100644 --- a/app/handlers/webhooks/paddle.go +++ b/app/handlers/webhooks/paddle.go @@ -73,7 +73,6 @@ func handlePaddleSubscriptionCreated(c *web.Context, params url.Values) error { c.Enqueue(tasks.UserListUpdateCompany(&dto.UserListUpdateCompany{ TenantID: passthrough.TenantID, BillingStatus: enum.BillingActive, - Name: c.Tenant().Name, })) } @@ -107,7 +106,6 @@ func handlePaddleSubscriptionCancelled(c *web.Context, params url.Values) error c.Enqueue(tasks.UserListUpdateCompany(&dto.UserListUpdateCompany{ TenantID: passthrough.TenantID, BillingStatus: enum.BillingCancelled, - Name: c.Tenant().Name, })) } diff --git a/app/services/userlist/userlist.go b/app/services/userlist/userlist.go index 46a34066e..89b7fbf8a 100644 --- a/app/services/userlist/userlist.go +++ b/app/services/userlist/userlist.go @@ -140,6 +140,7 @@ func updateUserListCompany(ctx context.Context, c *cmd.UserListUpdateCompany) er Identifier: strconv.Itoa(c.TenantId), Name: c.Name, } + if c.BillingStatus > 0 { company.Properties = map[string]interface{}{ "billing_status": c.BillingStatus, diff --git a/app/services/userlist/userlist_test.go b/app/services/userlist/userlist_test.go index 4937affd6..2e0d2f8cc 100644 --- a/app/services/userlist/userlist_test.go +++ b/app/services/userlist/userlist_test.go @@ -29,7 +29,7 @@ func reset() { bus.Init(userlist.Service{}, httpclientmock.Service{}, userlist_mock.Service{}) } -func TestCreatTenant_Success(t *testing.T) { +func TestCreateTenant_Success(t *testing.T) { RegisterT(t) env.Config.HostMode = "multi" reset()