Skip to content

Commit a240d6c

Browse files
committed
Truncate company name to 50 chars
1 parent 3bfe350 commit a240d6c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

client/sub_account.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@ func (c *Client) CreateSubAccount(input *models.SubAccountInput) (*models.SubAcc
1111
return nil, errors.New("nil input")
1212
}
1313

14-
// Truncate first and last name to 30 characters to avoid Stripe API errors
14+
// Truncate fields to avoid Stripe API errors
1515
if len(input.FirstName) > 30 {
1616
input.FirstName = input.FirstName[:30]
1717
}
1818
if len(input.LastName) > 30 {
1919
input.LastName = input.LastName[:30]
2020
}
21+
if len(input.CompanyName) > 50 {
22+
input.CompanyName = input.CompanyName[:50]
23+
}
2124

2225
output := &models.SubAccount{}
2326
err := c.doWithoutVersion(http.MethodPost, "/shippo-accounts", input, output, nil)

0 commit comments

Comments
 (0)