Skip to content

update unit21 on email capture #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewServices(config APIConfig, repos repository.Repositories) service.Servic
fingerprint := service.NewFingerprint(client)
// we don't need to pass in the entire repos struct, just the ones we need
verificationRepos := repository.Repositories{Contact: repos.Contact, User: repos.User, Device: repos.Device}
verification := service.NewVerification(verificationRepos)
verification := service.NewVerification(verificationRepos, unit21)

// device service
deviceRepos := repository.Repositories{Device: repos.Device}
Expand Down
2 changes: 1 addition & 1 deletion pkg/service/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ func (t transaction) sendEmailReceipt(p transactionProcessingData) error {
}

func floatToFixedString(value float64, decimals int) string {
return strconv.FormatUint(uint64(value*(math.Pow10(decimals-1))), 10)
return strconv.FormatUint(uint64(value*(math.Pow10(decimals))), 10)
}

func (t transaction) unit21CreateTransaction(transactionId string) (err error) {
Expand Down
9 changes: 6 additions & 3 deletions pkg/service/verification.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ type Verification interface {
}

type verification struct {
repos repository.Repositories
repos repository.Repositories
unit21 Unit21
}

func NewVerification(repos repository.Repositories) Verification {
return &verification{repos}
func NewVerification(repos repository.Repositories, unit21 Unit21) Verification {
return &verification{repos, unit21}
}

func (v verification) SendEmailVerification(userID, email string) error {
Expand Down Expand Up @@ -162,5 +163,7 @@ func (v verification) VerifyEmail(encrypted string) error {
return common.StringError(errors.New("User email verify error - userID: " + user.ID))
}

go v.unit21.Entity.Update(user)

return nil
}