Skip to content
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

通知部分のソースコードをシンプルにする #148

Closed
yoneyan opened this issue Aug 3, 2022 · 2 comments
Closed

通知部分のソースコードをシンプルにする #148

yoneyan opened this issue Aug 3, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@yoneyan
Copy link
Member

yoneyan commented Aug 3, 2022

attachment = slack.Attachment{}
attachment.Text = &[]string{"Payment"}[0]
attachment.AddField(slack.Field{Title: "Type", Value: dataType}).
	AddField(slack.Field{Title: "ID", Value: event.ID}).
	AddField(slack.Field{Title: "PaymentIntent", Value: paymentIntent}).
	AddField(slack.Field{Title: "Etc", Value: etc}).
	AddField(slack.Field{Title: "Fee", Value: strconv.Itoa(int(amountTotal))})
notification.SendSlack(notification.Slack{Attachment: attachment, ID: config.ToPaymentLogSlackNotify, Status: true})

以下のコードのように保守性を上げる。

notification.SendSlack(notification.Slack{
Title: "payment", 
Data: map[string]string{"Type":dataType, "ID": event.ID,"PaymentIntent":paymentIntent, "Etc": etc,"Fee":fee}
ID: config.ToPaymentLogSlackNotify, 
Status: notification.Good
})
@yoneyan yoneyan added the enhancement New feature or request label Aug 3, 2022
@yoneyan yoneyan self-assigned this Aug 3, 2022
@yoneyan
Copy link
Member Author

yoneyan commented Aug 4, 2022

slack-goに移行

@yoneyan
Copy link
Member Author

yoneyan commented Aug 4, 2022

#149 に移行のためCloseとします

@yoneyan yoneyan closed this as completed Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant