mirror of
https://github.com/hanzo-fi/payments.git
synced 2026-10-30 20:31:20 +00:00
* Return ConnectorBase as part of accounts response * Fix link to capabilities page in error message * Add connector to accounts response json functions * Return Connector info on v3 create account response * Address coderabbit feedback
20 lines
457 B
Go
20 lines
457 B
Go
package services
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/formancehq/payments/internal/models"
|
|
)
|
|
|
|
func (s *Service) AccountsCreate(ctx context.Context, account models.Account) (*models.Account, error) {
|
|
if err := s.engine.CreateFormanceAccount(ctx, account); err != nil {
|
|
return nil, handleEngineErrors(err)
|
|
}
|
|
|
|
acc, err := s.storage.AccountsGet(ctx, account.ID)
|
|
if err != nil {
|
|
return nil, newStorageError(err, "cannot get account")
|
|
}
|
|
return acc, nil
|
|
}
|